diff options
author | Erik Andersen | 2000-04-13 18:49:43 +0000 |
---|---|---|
committer | Erik Andersen | 2000-04-13 18:49:43 +0000 |
commit | 9cf3bfa7c1bf3ad959c61711c9a5ac1969149300 (patch) | |
tree | 61d03a8d473f2d253c80f5bb3acc13d488351250 /coreutils/basename.c | |
parent | b4f8606c05f8a256b515633e48df954ead1260ef (diff) | |
download | busybox-9cf3bfa7c1bf3ad959c61711c9a5ac1969149300.zip busybox-9cf3bfa7c1bf3ad959c61711c9a5ac1969149300.tar.gz |
More doc updates for BusyBox, with fixes to apps for bugs revealed
while trying to write docs . :-)
-Erik
Diffstat (limited to 'coreutils/basename.c')
-rw-r--r-- | coreutils/basename.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/coreutils/basename.c b/coreutils/basename.c index 06e2766..5fe5e0f 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c @@ -34,8 +34,10 @@ extern int basename_main(int argc, char **argv) argv++; s1=*argv+strlen(*argv)-1; - if (*s1 == '/') + while (s1 && *s1 == '/') { *s1 = '\0'; + s1=*argv+strlen(*argv)-1; + } s = strrchr(*argv, '/'); printf("%s\n", (s)? s + 1 : *argv); exit(TRUE); |