Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/unix/dirname.c')
-rw-r--r--newlib/libc/unix/dirname.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/newlib/libc/unix/dirname.c b/newlib/libc/unix/dirname.c
deleted file mode 100644
index f026e3056..000000000
--- a/newlib/libc/unix/dirname.c
+++ /dev/null
@@ -1,28 +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 (dirname, (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 < path ? "." :
- p == path ? "/" :
- (*p = '\0', path);
-}