tweaks: remove some unneeded braces, not used elsewhere either

master
Benno Schulenberg 2020-02-21 17:07:11 +01:00
parent 51913542f4
commit c802f91f4e
1 changed files with 5 additions and 10 deletions

View File

@ -178,10 +178,9 @@ void color_update(void)
if (strcmp(syntaxstr, "none") == 0)
return;
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next) {
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next)
if (strcmp(sntx->name, syntaxstr) == 0)
break;
}
if (sntx == NULL && !inhelp)
statusline(ALERT, _("Unknown syntax name: %s"), syntaxstr);
@ -195,21 +194,19 @@ void color_update(void)
if (fullname == NULL)
fullname = mallocstrcpy(fullname, openfile->filename);
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next) {
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next)
if (found_in_list(sntx->extensions, fullname))
break;
}
free(fullname);
}
/* If the filename didn't match anything, try the first line. */
if (sntx == NULL && !inhelp) {
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next) {
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next)
if (found_in_list(sntx->headers, openfile->filetop->data))
break;
}
}
#ifdef HAVE_LIBMAGIC
/* If we still don't have an answer, try using magic. */
@ -237,11 +234,10 @@ void color_update(void)
/* Now try and find a syntax that matches the magic string. */
if (magicstring != NULL) {
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next) {
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next)
if (found_in_list(sntx->magics, magicstring))
break;
}
}
if (stat(openfile->filename, &fileinfo) == 0)
magic_close(cookie);
@ -250,11 +246,10 @@ void color_update(void)
/* If nothing at all matched, see if there is a default syntax. */
if (sntx == NULL && !inhelp) {
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next) {
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next)
if (strcmp(sntx->name, "default") == 0)
break;
}
}
/* When the syntax isn't loaded yet, parse it and initialize its colors. */
if (sntx != NULL && sntx->filename != NULL) {