diff options
author | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-04-13 18:49:43 +0000 |
---|---|---|
committer | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-04-13 18:49:43 +0000 |
commit | 9c24ee20ab75047beebcf1a5766fdbdbd82ba662 (patch) | |
tree | 61d03a8d473f2d253c80f5bb3acc13d488351250 /coreutils/basename.c | |
parent | 243153c09634fdbd0ac39af35677a4a7929e9c64 (diff) | |
download | busybox-w32-9c24ee20ab75047beebcf1a5766fdbdbd82ba662.tar.gz busybox-w32-9c24ee20ab75047beebcf1a5766fdbdbd82ba662.tar.bz2 busybox-w32-9c24ee20ab75047beebcf1a5766fdbdbd82ba662.zip |
More doc updates for BusyBox, with fixes to apps for bugs revealed
while trying to write docs . :-)
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@451 69ca8d6d-28ef-0310-b511-8ec308f3f277
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 06e27663f..5fe5e0f03 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c | |||
@@ -34,8 +34,10 @@ extern int basename_main(int argc, char **argv) | |||
34 | argv++; | 34 | argv++; |
35 | 35 | ||
36 | s1=*argv+strlen(*argv)-1; | 36 | s1=*argv+strlen(*argv)-1; |
37 | if (*s1 == '/') | 37 | while (s1 && *s1 == '/') { |
38 | *s1 = '\0'; | 38 | *s1 = '\0'; |
39 | s1=*argv+strlen(*argv)-1; | ||
40 | } | ||
39 | s = strrchr(*argv, '/'); | 41 | s = strrchr(*argv, '/'); |
40 | printf("%s\n", (s)? s + 1 : *argv); | 42 | printf("%s\n", (s)? s + 1 : *argv); |
41 | exit(TRUE); | 43 | exit(TRUE); |