aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/basename.c7
-rw-r--r--coreutils/cat.c2
-rw-r--r--coreutils/chroot.c2
-rw-r--r--coreutils/dd.c10
-rw-r--r--coreutils/df.c10
-rw-r--r--coreutils/du.c4
-rw-r--r--coreutils/head.c4
-rw-r--r--coreutils/ln.c3
-rw-r--r--coreutils/mkdir.c3
-rw-r--r--coreutils/rm.c2
-rw-r--r--coreutils/rmdir.c2
-rw-r--r--coreutils/sort.c4
-rw-r--r--coreutils/tee.c4
-rw-r--r--coreutils/touch.c2
-rw-r--r--coreutils/uniq.c4
15 files changed, 33 insertions, 30 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
27extern int basename_main(int argc, char **argv) 27extern 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);
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 58a1b0f54..f7a6bfa7b 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini Cat implementation for busybox 3 * Mini Cat 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
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index 3622c26dc..63fa4d146 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -3,7 +3,7 @@
3 * Mini chroot implementation for busybox 3 * Mini chroot implementation for busybox
4 * 4 *
5 * 5 *
6 * Copyright (C) 1999 by Lineo, inc. 6 * Copyright (C) 1999,2000 by Lineo, inc.
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 9c7d872b1..303500008 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -2,13 +2,13 @@
2/* 2/*
3 * Mini dd implementation for busybox 3 * Mini dd 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 * based in part on code taken from sash.
8 * 7 *
9 * Copyright (c) 1999 by David I. Bell 8 * Based in part on code taken from sash.
10 * Permission is granted to use, distribute, or modify this source, 9 * Copyright (c) 1999 by David I. Bell
11 * provided that this copyright notice remains intact. 10 * Permission is granted to use, distribute, or modify this source,
11 * provided that this copyright notice remains intact.
12 * 12 *
13 * Permission to distribute this code under the GPL has been granted. 13 * Permission to distribute this code under the GPL has been granted.
14 * 14 *
diff --git a/coreutils/df.c b/coreutils/df.c
index 331ef2d49..c38720454 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini df implementation for busybox 3 * Mini df 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 * based on original code by (I think) Bruce Perens <bruce@pixar.com>. 7 * based on original code by (I think) Bruce Perens <bruce@pixar.com>.
8 * 8 *
@@ -28,9 +28,8 @@
28#include <sys/stat.h> 28#include <sys/stat.h>
29#include <sys/vfs.h> 29#include <sys/vfs.h>
30 30
31static const char df_usage[] = "df [filesystem ...]\n" 31static const char df_usage[] = "df [filesystem ...]\n\n"
32 32 "Print the filesystem space used and space available.\n";
33 "\n" "\tPrint the filesystem space used and space available.\n";
34 33
35extern const char mtab_file[]; /* Defined in utility.c */ 34extern const char mtab_file[]; /* Defined in utility.c */
36 35
@@ -76,6 +75,9 @@ extern int df_main(int argc, char **argv)
76 struct mntent *mountEntry; 75 struct mntent *mountEntry;
77 int status; 76 int status;
78 77
78 if (**(argv + 1) == '-') {
79 usage(df_usage);
80 }
79 while (argc > 1) { 81 while (argc > 1) {
80 if ((mountEntry = findMountPoint(argv[1], mtab_file)) == 0) { 82 if ((mountEntry = findMountPoint(argv[1], mtab_file)) == 0) {
81 fprintf(stderr, "%s: can't find mount point.\n", argv[1]); 83 fprintf(stderr, "%s: can't find mount point.\n", argv[1]);
diff --git a/coreutils/du.c b/coreutils/du.c
index b6ebaca7a..874538015 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -3,7 +3,7 @@
3 * Mini du implementation for busybox 3 * Mini du implementation for busybox
4 * 4 *
5 * 5 *
6 * Copyright (C) 1999 by Lineo, inc. 6 * Copyright (C) 1999,2000 by Lineo, inc.
7 * Written by John Beppu <beppu@lineo.com> 7 * Written by John Beppu <beppu@lineo.com>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -182,7 +182,7 @@ int du_main(int argc, char **argv)
182 exit(0); 182 exit(0);
183} 183}
184 184
185/* $Id: du.c,v 1.16 2000/03/04 21:19:32 erik Exp $ */ 185/* $Id: du.c,v 1.17 2000/04/13 01:18:56 erik Exp $ */
186/* 186/*
187Local Variables: 187Local Variables:
188c-file-style: "linux" 188c-file-style: "linux"
diff --git a/coreutils/head.c b/coreutils/head.c
index 82a73de2a..3db64b3bc 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -3,7 +3,7 @@
3 * Mini head implementation for busybox 3 * Mini head implementation for busybox
4 * 4 *
5 * 5 *
6 * Copyright (C) 1999 by Lineo, inc. 6 * Copyright (C) 1999,2000 by Lineo, inc.
7 * Written by John Beppu <beppu@lineo.com> 7 * Written by John Beppu <beppu@lineo.com>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -109,4 +109,4 @@ int head_main(int argc, char **argv)
109 exit(0); 109 exit(0);
110} 110}
111 111
112/* $Id: head.c,v 1.8 2000/02/08 19:58:47 erik Exp $ */ 112/* $Id: head.c,v 1.9 2000/04/13 01:18:56 erik Exp $ */
diff --git a/coreutils/ln.c b/coreutils/ln.c
index c54026c62..4be60624e 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -2,8 +2,7 @@
2/* 2/*
3 * Mini ln implementation for busybox 3 * Mini ln implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 1999,2000 by Lineo, inc.
6 * Copyright (C) 1999 by Lineo, inc.
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 6 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 7 *
9 * 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
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index 70fdbdfb5..b0a2d57d6 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -2,8 +2,7 @@
2/* 2/*
3 * Mini mkdir implementation for busybox 3 * Mini mkdir implementation for busybox
4 * 4 *
5 * 5 * Copyright (C) 1999,2000 by Lineo, inc.
6 * Copyright (C) 1999 by Lineo, inc.
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 6 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 7 *
9 * 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
diff --git a/coreutils/rm.c b/coreutils/rm.c
index 683bf8bdf..0cd795661 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -3,7 +3,7 @@
3 * Mini rm implementation for busybox 3 * Mini rm implementation for busybox
4 * 4 *
5 * 5 *
6 * Copyright (C) 1999 by Lineo, inc. 6 * Copyright (C) 1999,2000 by Lineo, inc.
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index f49569749..1d88de322 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -3,7 +3,7 @@
3 * Mini rmdir implementation for busybox 3 * Mini rmdir implementation for busybox
4 * 4 *
5 * 5 *
6 * Copyright (C) 1999 by Lineo, inc. 6 * Copyright (C) 1999,2000 by Lineo, inc.
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/sort.c b/coreutils/sort.c
index e6894f6c3..6ee6f207e 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -3,7 +3,7 @@
3 * Mini sort implementation for busybox 3 * Mini sort implementation for busybox
4 * 4 *
5 * 5 *
6 * Copyright (C) 1999 by Lineo, inc. 6 * Copyright (C) 1999,2000 by Lineo, inc.
7 * Written by John Beppu <beppu@lineo.com> 7 * Written by John Beppu <beppu@lineo.com>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -320,4 +320,4 @@ int sort_main(int argc, char **argv)
320 exit(0); 320 exit(0);
321} 321}
322 322
323/* $Id: sort.c,v 1.12 2000/03/04 21:19:32 erik Exp $ */ 323/* $Id: sort.c,v 1.13 2000/04/13 01:18:56 erik Exp $ */
diff --git a/coreutils/tee.c b/coreutils/tee.c
index 018fe117b..95b75edd7 100644
--- a/coreutils/tee.c
+++ b/coreutils/tee.c
@@ -3,7 +3,7 @@
3 * Mini tee implementation for busybox 3 * Mini tee implementation for busybox
4 * 4 *
5 * 5 *
6 * Copyright (C) 1999 by Lineo, inc. 6 * Copyright (C) 1999,2000 by Lineo, inc.
7 * Written by John Beppu <beppu@lineo.com> 7 * Written by John Beppu <beppu@lineo.com>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -131,4 +131,4 @@ int tee_main(int argc, char **argv)
131 exit(0); 131 exit(0);
132} 132}
133 133
134/* $Id: tee.c,v 1.8 2000/03/23 01:09:18 erik Exp $ */ 134/* $Id: tee.c,v 1.9 2000/04/13 01:18:56 erik Exp $ */
diff --git a/coreutils/touch.c b/coreutils/touch.c
index a0f21acdd..f8972dcf6 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -3,7 +3,7 @@
3 * Mini touch implementation for busybox 3 * Mini touch implementation for busybox
4 * 4 *
5 * 5 *
6 * Copyright (C) 1999 by Lineo, inc. 6 * Copyright (C) 1999,2000 by Lineo, inc.
7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 7 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/uniq.c b/coreutils/uniq.c
index 1e41eaacd..2eedb886d 100644
--- a/coreutils/uniq.c
+++ b/coreutils/uniq.c
@@ -3,7 +3,7 @@
3 * Mini uniq implementation for busybox 3 * Mini uniq implementation for busybox
4 * 4 *
5 * 5 *
6 * Copyright (C) 1999 by Lineo, inc. 6 * Copyright (C) 1999,2000 by Lineo, inc.
7 * Written by John Beppu <beppu@lineo.com> 7 * Written by John Beppu <beppu@lineo.com>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -190,4 +190,4 @@ int uniq_main(int argc, char **argv)
190 exit(0); 190 exit(0);
191} 191}
192 192
193/* $Id: uniq.c,v 1.7 2000/02/08 19:58:47 erik Exp $ */ 193/* $Id: uniq.c,v 1.8 2000/04/13 01:18:56 erik Exp $ */