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.3 2000/09/28 15:52:19 bnv
8 * Corrected a bug if the input string had repeated targets.
10 * Revision 1.2 2000/02/07 11:21:35 bnv
11 * Corrected: The case where the old string has length equal to ZERO.
13 * Revision 1.1 1998/07/02 17:17:00 bnv
20 /* ----------------- Lchagestr ------------------- */
22 Lchangestr( const PLstr to
, const PLstr oldstr
,
23 const PLstr str
, const PLstr newstr
)
28 if (LLEN(*oldstr
)==0) {
40 foundpos
= Lindex(str
,oldstr
,pos
);
41 if (foundpos
==0) break;
43 _Lsubstr(&tmp
,str
,pos
,foundpos
-pos
);
47 pos
= foundpos
+ LLEN(*oldstr
);
49 _Lsubstr(&tmp
,str
,pos
,0);