1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 11:16:16 +02:00

(dir_name) [MSDOS]: Declare `lim' to be const.

This commit is contained in:
Jim Meyering
2000-07-29 08:00:11 +00:00
parent 7102df4dd3
commit e32586114e

View File

@@ -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 == '/')