diff options
Diffstat (limited to 'newlib/libc/unix/basename.c')
-rw-r--r-- | newlib/libc/unix/basename.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/newlib/libc/unix/basename.c b/newlib/libc/unix/basename.c deleted file mode 100644 index 703e532d5..000000000 --- a/newlib/libc/unix/basename.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2005 Shaun Jackman - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <libgen.h> -#include <string.h> - -char* -_DEFUN (basename, (path), - char *path) -{ - char *p; - if( path == NULL || *path == '\0' ) - return "."; - p = path + strlen(path) - 1; - while( *p == '/' ) { - if( p == path ) - return path; - *p-- = '\0'; - } - while( p >= path && *p != '/' ) - p--; - return p + 1; -} |