source: trunk/src/gcc/libiberty/basename.c@ 1124

Last change on this file since 1124 was 9, checked in by bird, 23 years ago

Applied initial diff from Platon.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.2 KB
Line 
1/* Return the basename of a pathname.
2 This file is in the public domain. */
3
4/*
5
6@deftypefn Supplemental char* basename (const char *@var{name})
7
8Returns a pointer to the last component of pathname @var{name}.
9Behavior is undefined if the pathname ends in a directory separator.
10
11@end deftypefn
12
13*/
14
15#include "ansidecl.h"
16#include "libiberty.h"
17#include "safe-ctype.h"
18
19#ifndef DIR_SEPARATOR
20#define DIR_SEPARATOR '/'
21#endif
22
23#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
24 defined (__OS2__) || defined (__EMX__)
25#define HAVE_DOS_BASED_FILE_SYSTEM
26#ifndef DIR_SEPARATOR_2
27#define DIR_SEPARATOR_2 '\\'
28#endif
29#endif
30
31/* Define IS_DIR_SEPARATOR. */