~ubuntu-branches/ubuntu/gutsy/findutils/gutsy-proposed

« back to all changes in this revision

Viewing changes to gnulib/lib/basename.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2005-07-04 11:37:37 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050704113737-ll89ui8be35r0pir
Tags: 4.2.22-2
* Remove locatedb on purge. (Closes: #315343)
* revert regex-syntax back to emacs-re. (Closes: #315136) Future versions
  will allow to select this by commandline parameter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* basename.c -- return the last element in a path
2
 
   Copyright (C) 1990, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 
1
/* basename.c -- return the last element in a file name
 
2
 
 
3
   Copyright (C) 1990, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free
 
4
   Software Foundation, Inc.
3
5
 
4
6
   This program is free software; you can redistribute it and/or modify
5
7
   it under the terms of the GNU General Public License as published by
13
15
 
14
16
   You should have received a copy of the GNU General Public License
15
17
   along with this program; if not, write to the Free Software Foundation,
16
 
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
18
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
17
19
 
18
20
#if HAVE_CONFIG_H
19
21
# include <config.h>
20
22
#endif
21
23
 
22
 
#if STDC_HEADERS || HAVE_STRING_H
23
 
# include <string.h>
24
 
#endif
25
24
#include "dirname.h"
 
25
#include <string.h>
26
26
 
27
27
/* In general, we can't use the builtin `basename' function if available,
28
28
   since it has different meanings in different environments.
35
35
char *
36
36
base_name (char const *name)
37
37
{
38
 
  char const *base = name + FILESYSTEM_PREFIX_LEN (name);
 
38
  char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);
39
39
  char const *p;
40
40
 
41
41
  for (p = base; *p; p++)