diff options
author | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-04-13 01:18:56 +0000 |
---|---|---|
committer | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-04-13 01:18:56 +0000 |
commit | 3e1eedd1a1754ecc86affdbd873900213c172bab (patch) | |
tree | 1ea829e51641647a35c552e289f4482ab9f5db27 /coreutils/basename.c | |
parent | 3dc2375ccc0076966ace7c4b7a93830a93e2ae34 (diff) | |
download | busybox-w32-3e1eedd1a1754ecc86affdbd873900213c172bab.tar.gz busybox-w32-3e1eedd1a1754ecc86affdbd873900213c172bab.tar.bz2 busybox-w32-3e1eedd1a1754ecc86affdbd873900213c172bab.zip |
Upates to include copyright 2000 to everything
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@447 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/basename.c')
-rw-r--r-- | coreutils/basename.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/coreutils/basename.c b/coreutils/basename.c index 1db885f62..06e27663f 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c | |||
@@ -2,7 +2,7 @@ | |||
2 | /* | 2 | /* |
3 | * Mini basename implementation for busybox | 3 | * Mini basename implementation for busybox |
4 | * | 4 | * |
5 | * Copyright (C) 1999 by Lineo, inc. | 5 | * Copyright (C) 1999,2000 by Lineo, inc. |
6 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> | 6 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
@@ -26,13 +26,16 @@ | |||
26 | 26 | ||
27 | extern int basename_main(int argc, char **argv) | 27 | extern int basename_main(int argc, char **argv) |
28 | { | 28 | { |
29 | char* s; | 29 | char* s, *s1; |
30 | 30 | ||
31 | if ((argc < 2) || (**(argv + 1) == '-')) { | 31 | if ((argc < 2) || (**(argv + 1) == '-')) { |
32 | usage("basename [file ...]\n"); | 32 | usage("basename [file ...]\n"); |
33 | } | 33 | } |
34 | argv++; | 34 | argv++; |
35 | 35 | ||
36 | s1=*argv+strlen(*argv)-1; | ||
37 | if (*s1 == '/') | ||
38 | *s1 = '\0'; | ||
36 | s = strrchr(*argv, '/'); | 39 | s = strrchr(*argv, '/'); |
37 | printf("%s\n", (s)? s + 1 : *argv); | 40 | printf("%s\n", (s)? s + 1 : *argv); |
38 | exit(TRUE); | 41 | exit(TRUE); |