diff options
author | Justus Winter <justus@gnupg.org> | 2016-10-05 10:24:59 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2016-10-05 10:24:59 +0200 |
commit | 3a3c1759297d3621663571dc85d2fb5d1d53b3b1 (patch) | |
tree | 3880da46eb102bede70cdfc023f58ecd3444ebe4 /trans/remap.c | |
parent | e6bffe8d286d49311c0d34acab4b9da867e0dfe8 (diff) |
Avoid fatal error handling in option parsers.
* trans/crash.c (parse_opt): Avoid 'error' in favor of the appropriate
argp error reporting mechanism.
* trans/remap.c (parse_opt): Likewise.
* utils/msgids.c (parse_opt): Likewise.
Diffstat (limited to 'trans/remap.c')
-rw-r--r-- | trans/remap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/trans/remap.c b/trans/remap.c index 63434f0f..5afbaa02 100644 --- a/trans/remap.c +++ b/trans/remap.c @@ -98,7 +98,11 @@ parse_opt (int key, char *arg, struct argp_state *state) { case ARGP_KEY_ARG: if (arg[0] != '/') - error (1, 0, "remap only works with absolute paths\n"); + { + argp_error (state, "remap only works with absolute paths: %s", + arg); + return EINVAL; + } /* Skip heading slashes */ while (arg[0] == '/') |