From ca9dc63de974d1335dce533d310ffbb11812fce0 Mon Sep 17 00:00:00 2001 From: jbj Date: Tue, 16 Mar 1999 20:04:26 +0000 Subject: Fix newSpec in "rpm -q --specfile --specedit" CVS patchset: 2892 CVS date: 1999/03/16 20:04:26 --- misc/Makefile.am | 14 +++++++------- misc/basename.c | 13 +++++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 misc/basename.c (limited to 'misc') diff --git a/misc/Makefile.am b/misc/Makefile.am index b590e4636..38f91558f 100644 --- a/misc/Makefile.am +++ b/misc/Makefile.am @@ -5,13 +5,13 @@ AUTOMAKE_OPTIONS = 1.4 foreign INCLUDES = -I$(top_srcdir) @INCPATH@ EXTRA_DIST = \ - alloca.c error.c fakefork.c fnmatch.c \ - getcwd.c getmntent.c getwd.c glob.c \ - inet_aton.c memcmp.c mktime.c myrealloc.c \ - putenv.c realpath.c stpcpy.c stpncpy.c \ - strcasecmp.c strncasecmp.c strcspn.c strdup.c \ - strerror.c strftime.c strcspn.c strstr.c \ - strtol.c strtoul.c + alloca.c basename.c error.c fakefork.c \ + fnmatch.c getcwd.c getmntent.c getwd.c \ + glob.c inet_aton.c memcmp.c mktime.c \ + myrealloc.c putenv.c realpath.c stpcpy.c \ + stpncpy.c strcasecmp.c strncasecmp.c strcspn.c \ + strdup.c strerror.c strftime.c strcspn.c \ + strstr.c strtol.c strtoul.c noinst_HEADERS = \ error.h fnmatch.h glob.h \ diff --git a/misc/basename.c b/misc/basename.c new file mode 100644 index 000000000..7fea76ed7 --- /dev/null +++ b/misc/basename.c @@ -0,0 +1,13 @@ +#ifdef HAVE_CONFIG_H +# include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +char * +basename(const char *file) +{ + char *fn = strrchr(file, '/'); + return fn ? fn+1 : (char *)file; +} -- cgit v1.2.3