summaryrefslogtreecommitdiff
path: root/function.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1992-08-19 22:16:15 +0000
committerRoland McGrath <roland@redhat.com>1992-08-19 22:16:15 +0000
commit3c660b4d5575ccd0345166d3258cb2236f29e591 (patch)
tree8ed8fae7cc2abb6877a048e3d03b665bbf7c4860 /function.c
parent0fad0bd5c5e245eb6b2dd45cc9033c4078c77ca6 (diff)
downloadgunmake-3c660b4d5575ccd0345166d3258cb2236f29e591.tar.gz
Formerly function.c.~21~
Diffstat (limited to 'function.c')
-rw-r--r--function.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/function.c b/function.c
index 993667f..96ecb86 100644
--- a/function.c
+++ b/function.c
@@ -265,7 +265,7 @@ int
pattern_matches (pattern, percent, word)
register char *pattern, *percent, *word;
{
- unsigned int len;
+ unsigned int sfxlen, wordlen;
if (percent == 0)
{
@@ -278,13 +278,14 @@ pattern_matches (pattern, percent, word)
return streq (pattern, word);
}
- len = strlen (percent + 1);
+ sfxlen = strlen (percent + 1);
+ wordlen = strlen (word);
- if (strlen (word) < (percent - pattern) + len
+ if (wordlen < (percent - pattern) + sfxlen
|| strncmp (pattern, word, percent - pattern))
return 0;
- return !strcmp (percent + 1, word + (strlen (word) - len));
+ return !strcmp (percent + 1, word + (wordlen - sfxlen));
}
int shell_function_pid = 0, shell_function_completed;