summaryrefslogtreecommitdiff
path: root/builtin/rev-parse.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-27 17:59:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-27 17:59:26 (GMT)
commita026bde1ac84f90f0b82faa18890b2023c5198d5 (patch)
tree8e976b861d4b23904c09bb1fbdd8004f37cb6e6f /builtin/rev-parse.c
parent09fb53568e3e00e30891b118045aa07ede524103 (diff)
parent3b754eedd58636926d07b14a34799a3aa7b8ebc2 (diff)
downloadgit-a026bde1ac84f90f0b82faa18890b2023c5198d5.zip
git-a026bde1ac84f90f0b82faa18890b2023c5198d5.tar.gz
git-a026bde1ac84f90f0b82faa18890b2023c5198d5.tar.bz2
Merge branch 'jk/prefix-filename'
Code clean-up with minor bugfixes. * jk/prefix-filename: bundle: use prefix_filename with bundle path prefix_filename: simplify windows #ifdef prefix_filename: return newly allocated string prefix_filename: drop length parameter prefix_filename: move docstring to header file hash-object: fix buffer reuse with --path in a subdirectory
Diffstat (limited to 'builtin/rev-parse.c')
-rw-r--r--builtin/rev-parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 1e5bdea..9e53a1a 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -228,9 +228,9 @@ static int show_file(const char *arg, int output_prefix)
if ((filter & (DO_NONFLAGS|DO_NOREV)) == (DO_NONFLAGS|DO_NOREV)) {
if (output_prefix) {
const char *prefix = startup_info->prefix;
- show(prefix_filename(prefix,
- prefix ? strlen(prefix) : 0,
- arg));
+ char *fname = prefix_filename(prefix, arg);
+ show(fname);
+ free(fname);
} else
show(arg);
return 1;