return NULL;
suffix += 1;
for (lang = lang_names; lang->name != NULL; lang++)
- if (lang->suffixes != NULL)
+ if (lang->suffixes != NULL) {
for (ext = lang->suffixes; *ext != NULL; ext++)
if (case_sensitive) {
if (streq (*ext, suffix))
return lang;
} else if (strcaseeq (*ext, suffix))
return lang;
+ }
return NULL;
}
LOOP_ON_INPUT_LINES (inf, lb, dummy)
continue;
+ (void)dummy; // Silence set-not-read warning.
}
\f
res_left = 3 * i + strlen(fp);
res = xnew( res_left + 1, char);
res[0] = '\0';
- for ( ; i-- > 0 ; res_left -= 4 )
+ for ( ; i-- > 0 ; res_left -= 3 )
strncat(res, "../", res_left );
/* Add the file name relative to the common root of file and dir. */
while (cp >= res && !filename_is_absolute (cp));
if (cp < res)
cp = slashp; /* the absolute name begins with "/.." */
- strcpy (cp, slashp + 3);
+ slashp += 3;
+ memmove(cp, slashp,strlen(slashp)+1);
slashp = cp;
continue;
}