summaryrefslogtreecommitdiff
path: root/lib/argp.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-01-05 17:00:53 +0100
committerBruno Haible <bruno@clisp.org>2019-01-05 17:00:53 +0100
commitff3fe55c7c95bdb9460a40747912b4b309519838 (patch)
treeb2511c719ba1873e9452008424612d21f9eff982 /lib/argp.h
parentd91fe44f159cfe7614d9e1547624579161bd25c5 (diff)
downloadgnulib-ff3fe55c7c95bdb9460a40747912b4b309519838.tar.gz
argp: Don't pass an invalid argument to dgettext().
Reported by He X <xw897002528@gmail.com>. * lib/argp.h (struct argp): Clarify that the args_doc field may be NULL. * lib/argp-help.c (argp_args_usage): Don't pass a NULL args_doc to dgettext().
Diffstat (limited to 'lib/argp.h')
-rw-r--r--lib/argp.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/argp.h b/lib/argp.h
index 317ac034e0..7aba8877dd 100644
--- a/lib/argp.h
+++ b/lib/argp.h
@@ -69,6 +69,9 @@ typedef int error_t;
extern "C" {
#endif
+/* Glibc documentation:
+ https://www.gnu.org/software/libc/manual/html_node/Argp.html */
+
/* A description of a particular option. A pointer to an array of
these is passed in the OPTIONS field of an argp structure. Each option
entry can correspond to one long option and/or one short option; more
@@ -236,9 +239,9 @@ struct argp
ARGP_KEY_ definitions below. */
argp_parser_t parser;
- /* A string describing what other arguments are wanted by this program. It
- is only used by argp_usage to print the "Usage:" message. If it
- contains newlines, the strings separated by them are considered
+ /* If non-NULL, a string describing what other arguments are wanted by this
+ program. It is only used by argp_usage to print the "Usage:" message.
+ If it contains newlines, the strings separated by them are considered
alternative usage patterns, and printed on separate lines (lines after
the first are prefix by " or: " instead of "Usage:"). */
const char *args_doc;