# HG changeset patch # User Jim Meyering # Date 964857611 0 # Node ID 3b0b8b89f4f15cd0ed3c4755c6fdc477cfced4db # Parent dabe1431112dcbb211de818cd29c4eaef877f692 (dir_name) [MSDOS]: Declare `lim' to be const. diff --git a/lib/dirname.c b/lib/dirname.c --- a/lib/dirname.c +++ b/lib/dirname.c @@ -33,6 +33,10 @@ # endif #endif +#ifndef ISSLASH +# define ISSLASH(C) ((C) == '/') +#endif + #include "dirname.h" /* Return the leading directories part of PATH, @@ -58,8 +62,8 @@ { /* 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 == '/')