summaryrefslogtreecommitdiff
path: root/implicit.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-10-15 07:00:58 +0000
committerPaul Smith <psmith@gnu.org>1999-10-15 07:00:58 +0000
commit3e26bde6dbc9a8a46d5a1a694e6810e689cbd25a (patch)
tree20d000099ba9c0723a3c4d8925adba97aee4f2dc /implicit.c
parentc71200d0229f75fe99d508dd3aea013ceba4d32e (diff)
downloadgunmake-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.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/implicit.c b/implicit.c
index 5ff7e18..c60cbe3 100644
--- a/implicit.c
+++ b/implicit.c
@@ -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;