summaryrefslogtreecommitdiff
path: root/src/man.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2022-02-06 12:37:01 +0000
committerColin Watson <cjwatson@debian.org>2022-02-06 12:37:02 +0000
commitf4f94402834f20b9da730aeca5daa465be38efdf (patch)
treecea31f1f33748b63af5b23d538437b42744ef1e3 /src/man.c
parent6d09e509dc281aa8a4ec2bc16a05dba622c65fc5 (diff)
Revert "Reduce indentation depth using C99"
This reverts commit c4d20840f3487588c4a0da4397b1acb6dc83a1e5. Even in C99, a declaration isn't valid immediately after a label; this didn't become valid until C2x, although gcc allows it as an extension. Fixes https://gitlab.com/cjwatson/man-db/-/issues/2. * src/man.c (parse_opt): Restore enclosing block for OPT_WARNINGS. * NEWS: Document this.
Diffstat (limited to 'src/man.c')
-rw-r--r--src/man.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/man.c b/src/man.c
index c91abf15..5d5caaf1 100644
--- a/src/man.c
+++ b/src/man.c
@@ -383,15 +383,18 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state)
case OPT_WARNINGS:
#ifdef NROFF_WARNINGS
- char *s = xstrdup (arg ? arg : default_roff_warnings);
- const char *warning;
+ {
+ char *s = xstrdup
+ (arg ? arg : default_roff_warnings);
+ const char *warning;
- for (warning = strtok (s, ","); warning;
- warning = strtok (NULL, ","))
- gl_list_add_last (roff_warnings,
- xstrdup (warning));
+ for (warning = strtok (s, ","); warning;
+ warning = strtok (NULL, ","))
+ gl_list_add_last (roff_warnings,
+ xstrdup (warning));
- free (s);
+ free (s);
+ }
#endif /* NROFF_WARNINGS */
return 0;