]> git.draconx.ca Git - dxcommon.git/blobdiff - src/help.c
help_print_desc: Ensure newline is printed for empty description.
[dxcommon.git] / src / help.c
index 43bb266d4df4dc8c5dc17ed7519abd49d1bdb088..f96025f1298fdcad10c29953d64cd92aef0da7bb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2021-2022 Nick Bowler
+ * Copyright © 2021-2023 Nick Bowler
  *
  * Helper functions for formatting --help program output.
  *
@@ -188,6 +188,9 @@ void help_print_desc(const struct option *opt, const char *s, int i, int w)
        if (opt)
                s = pgettext_expr(opt->name, s);
 
+       if (i && s[0] == '\0')
+               putchar('\n');
+
        for (; *s; w = 0) {
                const char *nl = strchr(s, '\n');
                int n = (nl ? nl-s : -1);