X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fdirname.c;h=483c33867258303cf196dd2f789e9bc09b0a5ca1;hb=691c858a4e2c7d47e41ca3b5c4ac4aab77b8f472;hp=237dd4b75b90ddb0106301a0e790125a49de11e2;hpb=ec4c2552456754b07b5d1d19b1c80c84d9cfa9c3;p=gnulib.git diff --git a/lib/dirname.c b/lib/dirname.c index 237dd4b75..483c33867 100644 --- a/lib/dirname.c +++ b/lib/dirname.c @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include #endif @@ -33,14 +33,7 @@ char *malloc (); # endif #endif -#include - -#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII) -# define IN_CTYPE_DOMAIN(c) 1 -#else -# define IN_CTYPE_DOMAIN(c) isascii(c) -#endif -#define ISALPHA(Ch) (IN_CTYPE_DOMAIN (Ch) && isalpha (Ch)) +#include "dirname.h" /* Return the leading directories part of PATH, allocated with malloc. If out of memory, return 0. @@ -48,8 +41,7 @@ char *malloc (); removed. */ char * -dirname (path) - char *path; +dir_name (const char *path) { char *newpath; char *slash; @@ -64,13 +56,6 @@ dirname (path) } else { - char *lim = path; - -#ifdef MSDOS - /* If canonicalized "d:/path", leave alone the root case "d:/". */ - lim = (ISALPHA (path[0]) && path[1] == ':') ? path + 2 : path; -#endif - /* Remove any trailing slashes from the result. */ while (slash > path && *slash == '/') --slash;