Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4973 right-hear 1
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
2
/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
3
#include 
4
#include 
5
 
6
char *
7
basename (const char *fname)
8
{
9
  const char *base = fname;
10
 
11
  if (fname && *fname)
12
  {
13
    if (fname[1] == ':')
14
    {
15
      fname += 2;
16
      base = fname;
17
    }
18
 
19
    while (*fname)
20
    {
21
      if (*fname == '\\' || *fname == '/')
22
	base = fname + 1;
23
      fname++;
24
    }
25
  }
26
 
27
  return unconst (base, char *);
28
}