From: Jim Meyering Date: Sat, 29 Jul 2000 08:00:11 +0000 (+0000) Subject: (dir_name) [MSDOS]: Declare `lim' to be const. X-Git-Tag: TEXTUTILS-2_0g~97 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=e32586114e9b5080ab28fcf0fc72780130da47d6;p=thirdparty%2Fcoreutils.git (dir_name) [MSDOS]: Declare `lim' to be const. --- diff --git a/lib/dirname.c b/lib/dirname.c index 2fc5f24dbd..acaeba16cd 100644 --- a/lib/dirname.c +++ b/lib/dirname.c @@ -33,6 +33,10 @@ char *malloc (); # endif #endif +#ifndef ISSLASH +# define ISSLASH(C) ((C) == '/') +#endif + #include "dirname.h" /* Return the leading directories part of PATH, @@ -58,8 +62,8 @@ dir_name (const char *path) { /* Remove any trailing slashes from the result. */ #ifdef MSDOS - char *lim = (path[0] >= 'A' && path[0] <= 'z' && path[1] == ':') - ? path + 2 : path; + const char *lim = ((path[0] >= 'A' && path[0] <= 'z' && path[1] == ':') + ? path + 2 : path); /* If canonicalized "d:/path", leave alone the root case "d:/". */ while (slash > lim && *slash == '/')