4 * Revision 1.1 2001/04/04 05:43:37 wang
5 * First commit: compiles on Linux, Amiga, Windows, Windows CE, generic gcc
7 * Revision 1.1 1998/07/02 17:18:00 bnv
14 /* ---------------- Llastpos --------------- */
16 Llastpos( const PLstr needle
, const PLstr haystack
, long p
)
24 if (p
<0 || p
>=LLEN(*haystack
)) p
= LLEN(*haystack
);
33 LINITSTR(N
); Lstrcpy(&N
,needle
);
34 LINITSTR(H
); Lstrcpy(&H
,haystack
);
39 if (p
>0) p
= LLEN(H
) - p
+ 1;
41 p
= Lindex(&H
, &N
, p
);
42 if (p
!=LNOTFOUND
) p
= LLEN(H
)-(p
+LLEN(N
))+2;