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 /implicit.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 'implicit.c')
-rw-r--r-- | implicit.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -88,7 +88,7 @@ pattern_search (file, archive, depth, recursions) unsigned int recursions; { /* Filename we are searching for a rule for. */ - char *filename = archive ? index (file->name, '(') : file->name; + char *filename = archive ? strchr (file->name, '(') : file->name; /* Length of FILENAME. */ unsigned int namelen = strlen (filename); @@ -165,14 +165,14 @@ pattern_search (file, archive, depth, recursions) but not counting any slash at the end. (foo/bar/ counts as bar/ in directory foo/, not empty in directory foo/bar/.) */ #ifdef VMS - lastslash = rindex (filename, ']'); + lastslash = strrchr (filename, ']'); #else - lastslash = rindex (filename, '/'); + lastslash = strrchr (filename, '/'); #if defined(__MSDOS__) || defined(WINDOWS32) /* Handle backslashes (possibly mixed with forward slashes) and the case of "d:file". */ { - char *bslash = rindex (filename, '\\'); + char *bslash = strrchr (filename, '\\'); if (lastslash == 0 || bslash > lastslash) lastslash = bslash; if (lastslash == 0 && filename[0] && filename[1] == ':') @@ -228,9 +228,9 @@ pattern_search (file, archive, depth, recursions) prefix and the target pattern does not contain a slash. */ #ifdef VMS - check_lastslash = lastslash != 0 && index (target, ']') == 0; + check_lastslash = lastslash != 0 && strchr (target, ']') == 0; #else - check_lastslash = lastslash != 0 && index (target, '/') == 0; + check_lastslash = lastslash != 0 && strchr (target, '/') == 0; #endif if (check_lastslash) { @@ -346,7 +346,7 @@ pattern_search (file, archive, depth, recursions) struct file *fp; /* If the dependency name has a %, substitute the stem. */ - p = index (dep_name (dep), '%'); + p = strchr (dep_name (dep), '%'); if (p != 0) { register unsigned int i; |