summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-03-24 17:40:54 +0000
committerache <ache@FreeBSD.org>1995-03-24 17:40:54 +0000
commit89bccb0c6fab19c5c24cc80c7de0343b63d547c3 (patch)
treee55874351a4d653c61d7bf14d9fe3e4804992880 /lib
parent9524bc7a361d1ae78d0a0b4c6789134f53e7d7e9 (diff)
downloadFreeBSD-src-89bccb0c6fab19c5c24cc80c7de0343b63d547c3.zip
FreeBSD-src-89bccb0c6fab19c5c24cc80c7de0343b63d547c3.tar.gz
Get rid of strtok(), it is depricated in libs
Diffstat (limited to 'lib')
-rw-r--r--lib/libmytinfo/buildpath.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libmytinfo/buildpath.c b/lib/libmytinfo/buildpath.c
index b901ea6..5d1c64a 100644
--- a/lib/libmytinfo/buildpath.c
+++ b/lib/libmytinfo/buildpath.c
@@ -22,10 +22,6 @@
#include <ctype.h>
-#ifndef __FreeBSD__
-#include "strtok.c"
-#endif
-
#ifdef USE_SCCS_IDS
static const char SCCSid[] = "@(#) mytinfo buildpath.c 3.2 92/02/01 public domain, By Ross Ridge";
#endif
@@ -130,6 +126,7 @@ va_dcl
#endif
va_list ap;
register char *s, *d, *e;
+ char *p;
char line[MAX_BUF+1];
char name[MAX_NAME+1];
int i,j;
@@ -186,11 +183,14 @@ va_dcl
}
*d = '\0';
if (type == 0 || line[0] == '/') {
- s = strtok(line, SEPERATORS);
+ p = line;
+ while ((s = strsep(&p, SEPERATORS)) != NULL && *s == '\0')
+ ;
while(s != NULL) {
if (addfile(s, 0) == 0)
return NULL;
- s = strtok(NULL, SEPERATORS);
+ while ((s = strsep(&p, SEPERATORS)) != NULL && *s == '\0')
+ ;
}
} else
if (addfile(line, type) == 0)
OpenPOWER on IntegriCloud