projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change `function_symbols' to std::vector
[deliverable/binutils-gdb.git]
/
libiberty
/
lbasename.c
diff --git
a/libiberty/lbasename.c
b/libiberty/lbasename.c
index 200a87f23871c2313b020fde2063bd4668f5957c..62670f679292584ef746c830aa5d36f2d33e7446 100644
(file)
--- a/
libiberty/lbasename.c
+++ b/
libiberty/lbasename.c
@@
-1,6
+1,6
@@
/* Libiberty basename. Like basename, but is not overridden by the
system C library.
/* Libiberty basename. Like basename, but is not overridden by the
system C library.
- Copyright (C) 2001
, 2002
Free Software Foundation, Inc.
+ Copyright (C) 2001
-2018
Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
@@
-15,8
+15,8
@@
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with libiberty; see the file COPYING.LIB. If
You should have received a copy of the GNU Library General Public
License along with libiberty; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 5
9 Temple Place - Suite 330
,
-Boston, MA 0211
1-1307
, USA. */
+not, write to the Free Software Foundation, Inc., 5
1 Franklin Street - Fifth Floor
,
+Boston, MA 0211
0-1301
, USA. */
/*
/*
@@
-37,26
+37,48
@@
and a path ending in @code{/} returns the empty string after it.
*/
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "ansidecl.h"
#include "libiberty.h"
#include "safe-ctype.h"
#include "filenames.h"
const char *
#include "ansidecl.h"
#include "libiberty.h"
#include "safe-ctype.h"
#include "filenames.h"
const char *
-lbasename (name)
- const char *name;
+unix_lbasename (const char *name)
+{
+ const char *base;
+
+ for (base = name; *name; name++)
+ if (IS_UNIX_DIR_SEPARATOR (*name))
+ base = name + 1;
+
+ return base;
+}
+
+const char *
+dos_lbasename (const char *name)
{
const char *base;
{
const char *base;
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
/* Skip over a possible disk name. */
if (ISALPHA (name[0]) && name[1] == ':')
name += 2;
/* Skip over a possible disk name. */
if (ISALPHA (name[0]) && name[1] == ':')
name += 2;
-#endif
for (base = name; *name; name++)
for (base = name; *name; name++)
- if (IS_DIR_SEPARATOR (*name))
+ if (IS_D
OS_D
IR_SEPARATOR (*name))
base = name + 1;
return base;
}
base = name + 1;
return base;
}
+
+const char *
+lbasename (const char *name)
+{
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ return dos_lbasename (name);
+#else
+ return unix_lbasename (name);
+#endif
+}
This page took
0.023862 seconds
and
4
git commands to generate.