diff options
Diffstat (limited to 'parse-options.c')
-rw-r--r-- | parse-options.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/parse-options.c b/parse-options.c index 71a7acf4e2..fd08bb425c 100644 --- a/parse-options.c +++ b/parse-options.c @@ -483,3 +483,15 @@ int parse_opt_approxidate_cb(const struct option *opt, const char *arg, *(unsigned long *)(opt->value) = approxidate(arg); return 0; } + +/* + * This should really be OPTION_FILENAME type as a part of + * parse_options that take prefix to do this while parsing. + */ +extern const char *parse_options_fix_filename(const char *prefix, const char *file) +{ + if (!file || !prefix || is_absolute_path(file) || !strcmp("-", file)) + return file; + return prefix_filename(prefix, strlen(prefix), file); +} + |