summaryrefslogtreecommitdiff
path: root/src/basename.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/basename.c')
-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]);