Mercurial > hg > octave-nkf > gnulib-hg
changeset 2781:3b0b8b89f4f1
(dir_name) [MSDOS]: Declare `lim' to be const.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sat, 29 Jul 2000 08:00:11 +0000 |
parents | dabe1431112d |
children | f9406fb86c7f |
files | lib/dirname.c |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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 == '/')