summaryrefslogtreecommitdiff
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 1db885f..06e2766 100644
--- a/coreutils/basename.c
+++ b/coreutils/basename.c
@@ -2,7 +2,7 @@
/*
* Mini basename implementation for busybox
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -26,13 +26,16 @@
extern int basename_main(int argc, char **argv)
{
- char* s;
+ char* s, *s1;
if ((argc < 2) || (**(argv + 1) == '-')) {
usage("basename [file ...]\n");
}
argv++;
+ s1=*argv+strlen(*argv)-1;
+ if (*s1 == '/')
+ *s1 = '\0';
s = strrchr(*argv, '/');
printf("%s\n", (s)? s + 1 : *argv);
exit(TRUE);
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 58a1b0f..f7a6bfa 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -2,7 +2,7 @@
/*
* Mini Cat implementation for busybox
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index 3622c26..63fa4d1 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -3,7 +3,7 @@
* Mini chroot implementation for busybox
*
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 9c7d872..3035000 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -2,13 +2,13 @@
/*
* Mini dd implementation for busybox
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999, 2000 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
- * based in part on code taken from sash.
*
- * Copyright (c) 1999 by David I. Bell
- * Permission is granted to use, distribute, or modify this source,
- * provided that this copyright notice remains intact.
+ * Based in part on code taken from sash.
+ * Copyright (c) 1999 by David I. Bell
+ * Permission is granted to use, distribute, or modify this source,
+ * provided that this copyright notice remains intact.
*
* Permission to distribute this code under the GPL has been granted.
*
diff --git a/coreutils/df.c b/coreutils/df.c
index 331ef2d..c387204 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -2,7 +2,7 @@
/*
* Mini df implementation for busybox
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
* based on original code by (I think) Bruce Perens <bruce@pixar.com>.
*
@@ -28,9 +28,8 @@
#include <sys/stat.h>
#include <sys/vfs.h>
-static const char df_usage[] = "df [filesystem ...]\n"
-
- "\n" "\tPrint the filesystem space used and space available.\n";
+static const char df_usage[] = "df [filesystem ...]\n\n"
+ "Print the filesystem space used and space available.\n";
extern const char mtab_file[]; /* Defined in utility.c */
@@ -76,6 +75,9 @@ extern int df_main(int argc, char **argv)
struct mntent *mountEntry;
int status;
+ if (**(argv + 1) == '-') {
+ usage(df_usage);
+ }
while (argc > 1) {
if ((mountEntry = findMountPoint(argv[1], mtab_file)) == 0) {
fprintf(stderr, "%s: can't find mount point.\n", argv[1]);
diff --git a/coreutils/du.c b/coreutils/du.c
index b6ebaca..8745380 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -3,7 +3,7 @@
* Mini du implementation for busybox
*
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by John Beppu <beppu@lineo.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -182,7 +182,7 @@ int du_main(int argc, char **argv)
exit(0);
}
-/* $Id: du.c,v 1.16 2000/03/04 21:19:32 erik Exp $ */
+/* $Id: du.c,v 1.17 2000/04/13 01:18:56 erik Exp $ */
/*
Local Variables:
c-file-style: "linux"
diff --git a/coreutils/head.c b/coreutils/head.c
index 82a73de..3db64b3 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -3,7 +3,7 @@
* Mini head implementation for busybox
*
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by John Beppu <beppu@lineo.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -109,4 +109,4 @@ int head_main(int argc, char **argv)
exit(0);
}
-/* $Id: head.c,v 1.8 2000/02/08 19:58:47 erik Exp $ */
+/* $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 c54026c..4be6062 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -2,8 +2,7 @@
/*
* Mini ln implementation for busybox
*
- *
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index 70fdbdf..b0a2d57 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -2,8 +2,7 @@
/*
* Mini mkdir implementation for busybox
*
- *
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/rm.c b/coreutils/rm.c
index 683bf8b..0cd7956 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -3,7 +3,7 @@
* Mini rm implementation for busybox
*
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index f495697..1d88de3 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -3,7 +3,7 @@
* Mini rmdir implementation for busybox
*
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/sort.c b/coreutils/sort.c
index e6894f6..6ee6f20 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -3,7 +3,7 @@
* Mini sort implementation for busybox
*
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by John Beppu <beppu@lineo.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -320,4 +320,4 @@ int sort_main(int argc, char **argv)
exit(0);
}
-/* $Id: sort.c,v 1.12 2000/03/04 21:19:32 erik Exp $ */
+/* $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 018fe11..95b75ed 100644
--- a/coreutils/tee.c
+++ b/coreutils/tee.c
@@ -3,7 +3,7 @@
* Mini tee implementation for busybox
*
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by John Beppu <beppu@lineo.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -131,4 +131,4 @@ int tee_main(int argc, char **argv)
exit(0);
}
-/* $Id: tee.c,v 1.8 2000/03/23 01:09:18 erik Exp $ */
+/* $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 a0f21ac..f8972dc 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -3,7 +3,7 @@
* Mini touch implementation for busybox
*
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/uniq.c b/coreutils/uniq.c
index 1e41eaa..2eedb88 100644
--- a/coreutils/uniq.c
+++ b/coreutils/uniq.c
@@ -3,7 +3,7 @@
* Mini uniq implementation for busybox
*
*
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
* Written by John Beppu <beppu@lineo.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -190,4 +190,4 @@ int uniq_main(int argc, char **argv)
exit(0);
}
-/* $Id: uniq.c,v 1.7 2000/02/08 19:58:47 erik Exp $ */
+/* $Id: uniq.c,v 1.8 2000/04/13 01:18:56 erik Exp $ */