summaryrefslogtreecommitdiff
path: root/parse-options.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-06 13:50:42 -0700
committerJunio C Hamano <gitster@pobox.com>2008-08-06 13:50:48 -0700
commitf44bc33c7283c19a86797ffdaafd22a19bbdfbd6 (patch)
tree9e33941160873fda6e65de8c94fa3a4178631c0f /parse-options.c
parentd96ca27e1089a190139591ac365873f26bffcf5c (diff)
parent781c1834f5419bdf81bb7f3750170ccd6b809174 (diff)
downloadgit-f44bc33c7283c19a86797ffdaafd22a19bbdfbd6.tar.gz
Sync with 1.5.6.5
Diffstat (limited to 'parse-options.c')
-rw-r--r--parse-options.c12
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);
+}
+