summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/lib/strsep.c
diff options
context:
space:
mode:
authorNicolas Planel <nplanel@mandriva.com>2003-10-29 16:07:11 +0000
committerNicolas Planel <nplanel@mandriva.com>2003-10-29 16:07:11 +0000
commitde47eb59bb829423b1d0f47ba13099073999b3cb (patch)
tree827f35c4666e15ec66edae7c1fa05d963324602b /mdk-stage1/dietlibc/lib/strsep.c
parent1fece42e9c460ca017fc4facad380f05163d8977 (diff)
downloaddrakx-backup-do-not-use-topic/Corpo_2_1.tar
drakx-backup-do-not-use-topic/Corpo_2_1.tar.gz
drakx-backup-do-not-use-topic/Corpo_2_1.tar.bz2
drakx-backup-do-not-use-topic/Corpo_2_1.tar.xz
drakx-backup-do-not-use-topic/Corpo_2_1.zip
Corporate Server 2.1.1 releasetopic/Corpo_2_1
Diffstat (limited to 'mdk-stage1/dietlibc/lib/strsep.c')
-rw-r--r--mdk-stage1/dietlibc/lib/strsep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mdk-stage1/dietlibc/lib/strsep.c b/mdk-stage1/dietlibc/lib/strsep.c
index a1bf1872a..db76f89b5 100644
--- a/mdk-stage1/dietlibc/lib/strsep.c
+++ b/mdk-stage1/dietlibc/lib/strsep.c
@@ -4,6 +4,7 @@ char *strsep(char **stringp, const char *delim) {
register char *tmp=*stringp;
register char *tmp2=tmp;
register const char *tmp3;
+ if (!*stringp) return 0;
for (tmp2=tmp; *tmp2; ++tmp2) {
for (tmp3=delim; *tmp3; ++tmp3)
if (*tmp2==*tmp3) { /* delimiter found */
@@ -12,5 +13,6 @@ char *strsep(char **stringp, const char *delim) {
return tmp;
}
}
- return 0;
+ *stringp=0;
+ return tmp;
}