diff options
author | midipix <writeonce@midipix.org> | 2015-03-15 21:08:54 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2015-03-15 21:08:54 -0400 |
commit | 18bc92cb83fdf0f0472432fb7c30914a9cd4df01 (patch) | |
tree | 2d11f8c8d084e113cae1ef6175fc2e888e570f58 /libiberty/basename.c | |
parent | cf7e0e7656729af8bd8f3bb86c4d51f1089a0c37 (diff) | |
download | cbb-gcc-4.6.4-18bc92cb83fdf0f0472432fb7c30914a9cd4df01.tar.bz2 cbb-gcc-4.6.4-18bc92cb83fdf0f0472432fb7c30914a9cd4df01.tar.xz |
libiberty: remove source files that either duplicate functionality
already present in all modern libc implementations, or are
incompatible with modern development environments, or both.
Diffstat (limited to 'libiberty/basename.c')
-rw-r--r-- | libiberty/basename.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/libiberty/basename.c b/libiberty/basename.c deleted file mode 100644 index 0f2c069f0..000000000 --- a/libiberty/basename.c +++ /dev/null @@ -1,62 +0,0 @@ -/* Return the basename of a pathname. - This file is in the public domain. */ - -/* - -@deftypefn Supplemental char* basename (const char *@var{name}) - -Returns a pointer to the last component of pathname @var{name}. -Behavior is undefined if the pathname ends in a directory separator. - -@end deftypefn - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "ansidecl.h" -#include "libiberty.h" -#include "safe-ctype.h" - -#ifndef DIR_SEPARATOR -#define DIR_SEPARATOR '/' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -#define HAVE_DOS_BASED_FILE_SYSTEM -#ifndef DIR_SEPARATOR_2 -#define DIR_SEPARATOR_2 '\\' -#endif -#endif - -/* Define IS_DIR_SEPARATOR. */ -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -char * -basename (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (ISALPHA (name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - { - if (IS_DIR_SEPARATOR (*name)) - { - base = name + 1; - } - } - return (char *) base; -} - |