diff options
author | Paul Smith <psmith@gnu.org> | 1999-10-15 07:00:58 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 1999-10-15 07:00:58 +0000 |
commit | 3e26bde6dbc9a8a46d5a1a694e6810e689cbd25a (patch) | |
tree | 20d000099ba9c0723a3c4d8925adba97aee4f2dc /dir.c | |
parent | c71200d0229f75fe99d508dd3aea013ceba4d32e (diff) | |
download | gunmake-3e26bde6dbc9a8a46d5a1a694e6810e689cbd25a.tar.gz |
* Fix PR/1394.
* Apply changes from Paul Eggert.
* Many other cleanups (index/rindex --> strchr/strrchr, etc.)
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -84,7 +84,7 @@ dosify (filename) /* First, transform the name part. */ for (i = 0; *filename != '\0' && i < 8 && *filename != '.'; ++i) - *df++ = tolower (*filename++); + *df++ = tolower ((unsigned char)*filename++); /* Now skip to the next dot. */ while (*filename != '\0' && *filename != '.') @@ -93,7 +93,7 @@ dosify (filename) { *df++ = *filename++; for (i = 0; *filename != '\0' && i < 3 && *filename != '.'; ++i) - *df++ = tolower (*filename++); + *df++ = tolower ((unsigned char)*filename++); } /* Look for more dots. */ @@ -135,7 +135,7 @@ downcase (filename) /* First, transform the name part. */ for (i = 0; *filename != '\0'; ++i) { - *df++ = tolower (*filename); + *df++ = tolower ((unsigned char)*filename); ++filename; } @@ -635,16 +635,16 @@ file_exists_p (name) #endif #ifdef VMS - dirend = rindex (name, ']'); + dirend = strrchr (name, ']'); dirend++; if (dirend == (char *)1) return dir_file_exists_p ("[]", name); #else /* !VMS */ - dirend = rindex (name, '/'); + dirend = strrchr (name, '/'); #if defined (WINDOWS32) || defined (__MSDOS__) /* Forward and backslashes might be mixed. We need the rightmost one. */ { - char *bslash = rindex(name, '\\'); + char *bslash = strrchr(name, '\\'); if (!dirend || bslash > dirend) dirend = bslash; /* The case of "d:file". */ @@ -693,16 +693,16 @@ file_impossible (filename) register struct dirfile *new; #ifdef VMS - dirend = rindex (p, ']'); + dirend = strrchr (p, ']'); dirend++; if (dirend == (char *)1) dir = find_directory ("[]"); #else - dirend = rindex (p, '/'); + dirend = strrchr (p, '/'); #if defined (WINDOWS32) || defined (__MSDOS__) /* Forward and backslashes might be mixed. We need the rightmost one. */ { - char *bslash = rindex(p, '\\'); + char *bslash = strrchr(p, '\\'); if (!dirend || bslash > dirend) dirend = bslash; /* The case of "d:file". */ @@ -796,15 +796,15 @@ file_impossible_p (filename) register struct dirfile *next; #ifdef VMS - dirend = rindex (filename, ']'); + dirend = strrchr (filename, ']'); if (dirend == 0) dir = find_directory ("[]")->contents; #else - dirend = rindex (filename, '/'); + dirend = strrchr (filename, '/'); #if defined (WINDOWS32) || defined (__MSDOS__) /* Forward and backslashes might be mixed. We need the rightmost one. */ { - char *bslash = rindex(filename, '\\'); + char *bslash = strrchr(filename, '\\'); if (!dirend || bslash > dirend) dirend = bslash; /* The case of "d:file". */ |