summaryrefslogtreecommitdiff
path: root/lib/dirname.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-07-29 08:00:11 +0000
committerJim Meyering <jim@meyering.net>2000-07-29 08:00:11 +0000
commit068326dbb1eabf05e68dab458bbaf44e71b924fb (patch)
treeceb91f5cfb567c1cf557a7b3d919ef5b68d7b93a /lib/dirname.c
parent651daba67126dc2dd4d3d1814f215f04ed57d7f0 (diff)
downloadgnulib-068326dbb1eabf05e68dab458bbaf44e71b924fb.tar.gz
(dir_name) [MSDOS]: Declare `lim' to be const.
Diffstat (limited to 'lib/dirname.c')
-rw-r--r--lib/dirname.c8
1 files changed, 6 insertions, 2 deletions
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 == '/')