Shorter var names

This commit is contained in:
Bruce Hill 2019-06-04 21:24:26 -07:00
parent 64aaffb068
commit 66c4861b11

18
ask.c
View File

@ -38,18 +38,18 @@ static int score(const char *str, const char *patt)
{
if (!patt[0]) return 0;
int score = 0;
const char *sp = str, *pp = patt;
while (*sp && !EQ(*sp, *pp)) ++sp;
while (*sp && *pp && EQ(*sp, *pp)) {
const char *s = str, *p = patt;
while (*s && !EQ(*s, *p)) ++s;
while (*s && *p && EQ(*s, *p)) {
++score;
++sp;
++pp;
++s;
++p;
}
for (; *pp; ++sp, ++pp) {
while (*sp && !EQ(*sp, *pp)) ++sp;
if (!*sp) return 0;
for (; *p; ++s, ++p) {
while (*s && !EQ(*s, *p)) ++s;
if (!*s) return 0;
}
if (*pp && !*sp) return 0;
if (*p && !*s) return 0;
return score;
}