aboutsummaryrefslogtreecommitdiff
path: root/argp
diff options
context:
space:
mode:
Diffstat (limited to 'argp')
-rw-r--r--argp/argp-eexst.c7
-rw-r--r--argp/argp-help.c6
-rw-r--r--argp/argp.h4
3 files changed, 11 insertions, 6 deletions
diff --git a/argp/argp-eexst.c b/argp/argp-eexst.c
index 676d1ec..9040058 100644
--- a/argp/argp-eexst.c
+++ b/argp/argp-eexst.c
@@ -22,8 +22,11 @@
#include <config.h>
#endif
+#include <sysexits.h>
+
#include "argp.h"
/* The exit status that argp will use when exiting due to a parsing error.
- If not defined or set by the user program, this defaults to 1. */
-error_t argp_err_exit_status = 1;
+ If not defined or set by the user program, this defaults to EX_USAGE from
+ <sysexits.h>. */
+error_t argp_err_exit_status = EX_USAGE;
diff --git a/argp/argp-help.c b/argp/argp-help.c
index ed934e0..b17c56d 100644
--- a/argp/argp-help.c
+++ b/argp/argp-help.c
@@ -658,12 +658,12 @@ canon_doc_option (const char **name)
{
int non_opt;
/* Skip initial whitespace. */
- while (isspace (*name))
+ while (isspace (**name))
(*name)++;
/* Decide whether this looks like an option (leading `-') or not. */
non_opt = (**name != '-');
/* Skip until part of name used for sorting. */
- while (**name && !isalnum (*name))
+ while (**name && !isalnum (**name))
(*name)++;
return non_opt;
}
@@ -1612,7 +1612,7 @@ weak_alias (__argp_state_help, argp_state_help)
/* If appropriate, print the printf string FMT and following args, preceded
by the program name and `:', to stderr, and followed by a `Try ... --help'
- message, then exit (ARGP_ERR_EXIT_STATUS). */
+ message, then exit (1). */
void
__argp_error (const struct argp_state *state, const char *fmt, ...)
{
diff --git a/argp/argp.h b/argp/argp.h
index d418253..6f430d4 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -34,6 +34,7 @@
#ifndef __error_t_defined
typedef int error_t;
+#define __error_t_defined
#endif
#ifndef __P
@@ -397,7 +398,8 @@ extern void (*argp_program_version_hook) __P ((FILE *__stream,
__const extern char *argp_program_bug_address;
/* The exit status that argp will use when exiting due to a parsing error.
- If not defined or set by the user program, this defaults to 1. */
+ If not defined or set by the user program, this defaults to EX_USAGE from
+ <sysexits.h>. */
extern error_t argp_err_exit_status;
/* Flags for argp_help. */