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