Import upstream 2.3.14
[packages/xinetd.git] / libs / src / misc / misc.c
1 /*
2  * (c) Copyright 1992 by Panagiotis Tsirigotis
3  * (c) Portions Copyright 1998-2001 by Rob Braun
4  * All rights reserved.  The file named COPYRIGHT specifies the terms 
5  * and conditions for redistribution.
6  */
7
8 #include "config.h"
9 #include <stdlib.h>
10 #include <string.h>
11
12 /*
13  * MISCELLANEOUS FUNCTIONS
14  */
15
16 #include "misc.h"
17
18
19 /*
20  * We always return a pointer in pathname
21  */
22 #if !defined(linux)
23 char *basename( char *pathname )
24 {
25    char *s = strrchr( pathname, '/' ) ;
26
27    if ( s == NULL )
28       return( pathname ) ;
29    else
30       return( s+1 ) ;
31 }
32 #endif
33
34