summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2001-05-12 16:05:12 +0000
committerJim Meyering <jim@meyering.net>2001-05-12 16:05:12 +0000
commit04a872f0d3db6a95b28c9640e2d9c5f3e3d2d7f6 (patch)
tree4c63b382e62356f145c82534e9998c68426b2ab3 /src
parent992b068bd2c377d38a25b92e30e0717603f061d3 (diff)
downloadcoreutils-04a872f0d3db6a95b28c9640e2d9c5f3e3d2d7f6.tar.xz
Include "dirname.h".
(base_name, strip_trailing_slashes): Remove decls; now in dirname.h. (main): Use base_len instead of strip_trailing_slashes to strip trailing slashes.
Diffstat (limited to 'src')
-rw-r--r--src/basename.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/basename.c b/src/basename.c
index 5ac75a534..2c7f8d7d2 100644
--- a/src/basename.c
+++ b/src/basename.c
@@ -1,5 +1,5 @@
/* basename -- strip directory and suffix from filenames
- Copyright (C) 1990-1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1990-1997, 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,6 +31,7 @@
#include "system.h"
#include "long-options.h"
+#include "dirname.h"
#include "error.h"
#include "closeout.h"
@@ -39,9 +40,6 @@
#define AUTHORS "FIXME unknown"
-char *base_name ();
-void strip_trailing_slashes ();
-
/* The name this program was run with. */
char *program_name;
@@ -118,9 +116,8 @@ main (int argc, char **argv)
usage (1);
}
- strip_trailing_slashes (argv[1]);
-
name = base_name (argv[1]);
+ name[base_len (name)] = '\0';
if (argc == 3)
remove_suffix (name, argv[2]);