# HG changeset patch # User Jim Meyering # Date 976198312 0 # Node ID c98368348dc3a29d45859d6c632436ec9ce6c5b8 # Parent cd8da840fa9d1760b5a0a30d47f7b9be5daf93f7 convert a > expression to the equivalent < one diff --git a/lib/dirname.c b/lib/dirname.c --- a/lib/dirname.c +++ b/lib/dirname.c @@ -113,7 +113,7 @@ canonicalized "d:/path", leave alone the root case "d:/". */ char const *lim = path + FILESYSTEM_PREFIX_LEN (path); - while (slash > lim && ISSLASH (*slash)) + while (lim < slash && ISSLASH (*slash)) --slash; length = slash - path + 1; diff --git a/lib/stripslash.c b/lib/stripslash.c --- a/lib/stripslash.c +++ b/lib/stripslash.c @@ -19,12 +19,16 @@ # include #endif -#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) +#if STDC_HEADERS || HAVE_STRING_H # include #else # include #endif +#ifndef ISSLASH +# define ISSLASH(C) ((C) == '/') +#endif + /* Remove trailing slashes from PATH. This is useful when using filename completion from a shell that adds a "/" after directory names (such as tcsh and bash), because @@ -37,6 +41,6 @@ int last; last = strlen (path) - 1; - while (last > 0 && path[last] == '/') + while (0 < last && ISSLASH (path[last])) path[last--] = '\0'; }