diff --git a/tools/nxstyle.c b/tools/nxstyle.c index 9592382616..b2bb33fe5a 100644 --- a/tools/nxstyle.c +++ b/tools/nxstyle.c @@ -2269,12 +2269,22 @@ int main(int argc, char **argv, char **envp) } else if (line[indent] == '{') { + /* Check for left brace in first column, but preceded by a + * blank line. Should never happen (but could happen with + * internal compound statements). + */ + + if (indent == 0 && lineno == blank_lineno + 1) + { + ERROR("Blank line before opening left brace", lineno, indent); + } + /* REVISIT: Possible false alarms in compound statements * without a preceding conditional. That usage often violates * the coding standard. */ - if (!bfunctions && (indent & 1) != 0) + else if (!bfunctions && (indent & 1) != 0) { ERROR("Bad left brace alignment", lineno, indent); }