make sure "S" is generated.
[AROS-Contrib.git] / rexx / lstring / countstr.c
blobf28ce8bf9599dd33fba5ef2617e7e709182a2a57
1 /*
2 * $Header$
3 * $Log$
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:17:00 bnv
8 * Initial revision
12 #include <lstring.h>
14 /* ----------------- Lcountstr ------------------- *
15 * Counts the appearances of the first string 'target'
16 * in the second argument 'source'
18 long
19 Lcountstr( const PLstr target, const PLstr source )
21 long output=0, position;
23 position = Lpos(target,source,0);
24 while (position>0) {
25 output++;
26 position = Lpos(target,source,position+LLEN(*target));
28 return output;
29 } /* Lcountstr */