diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-08-06 13:50:42 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-06 13:50:48 -0700 |
commit | f44bc33c7283c19a86797ffdaafd22a19bbdfbd6 (patch) | |
tree | 9e33941160873fda6e65de8c94fa3a4178631c0f /parse-options.c | |
parent | d96ca27e1089a190139591ac365873f26bffcf5c (diff) | |
parent | 781c1834f5419bdf81bb7f3750170ccd6b809174 (diff) | |
download | git-f44bc33c7283c19a86797ffdaafd22a19bbdfbd6.tar.gz git-f44bc33c7283c19a86797ffdaafd22a19bbdfbd6.tar.xz |
Sync with 1.5.6.5
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 71a7acf4e..fd08bb425 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); +} + |