From 3e26bde6dbc9a8a46d5a1a694e6810e689cbd25a Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Fri, 15 Oct 1999 07:00:58 +0000 Subject: * Fix PR/1394. * Apply changes from Paul Eggert. * Many other cleanups (index/rindex --> strchr/strrchr, etc.) --- expand.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'expand.c') diff --git a/expand.c b/expand.c index aebbe3f..edf6c9c 100644 --- a/expand.c +++ b/expand.c @@ -189,7 +189,7 @@ variable_expand_string (line, string, length) variable output buffer, and skip them. Uninteresting chars end at the next $ or the end of the input. */ - p1 = index (p, '$'); + p1 = strchr (p, '$'); o = variable_buffer_output (o, p, p1 != 0 ? p1 - p : strlen (p) + 1); @@ -229,7 +229,7 @@ variable_expand_string (line, string, length) /* Is there a variable reference inside the parens or braces? If so, expand it before expanding the entire reference. */ - end = index (beg, closeparen); + end = strchr (beg, closeparen); if (end == 0) /* Unterminated variable reference. */ fatal (reading_file, _("unterminated variable reference")); @@ -253,7 +253,7 @@ variable_expand_string (line, string, length) { beg = expand_argument (beg, p); /* Expand the name. */ free_beg = 1; /* Remember to free BEG when finished. */ - end = index (beg, '\0'); + end = strchr (beg, '\0'); } } else @@ -273,7 +273,7 @@ variable_expand_string (line, string, length) char *subst_beg, *subst_end, *replace_beg, *replace_end; subst_beg = colon + 1; - subst_end = index (subst_beg, '='); + subst_end = strchr (subst_beg, '='); if (subst_end == 0) /* There is no = in sight. Punt on the substitution reference and treat this as a variable name containing -- cgit v1.2.3