bundle: use prefix_filename with bundle path
[gitweb.git] / builtin / rev-parse.c
index 2549643267440c5742690e3b808943de6fad19af..7cd01c28190560ed3a3e81aa025b5f9f35417858 100644 (file)
@@ -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;