Merge branch 'oh/fix-config-default-user-name-section' into maint-2.3
[gitweb.git] / builtin / merge-file.c
index 844f84f40bf0f8b9d95f4e9f0496c010386a9fb8..232b76857cf4f6dbd9bec12fa12266e1afc90a5c 100644 (file)
@@ -90,7 +90,8 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
 
        if (ret >= 0) {
                const char *filename = argv[0];
-               FILE *f = to_stdout ? stdout : fopen(filename, "wb");
+               const char *fpath = prefix_filename(prefix, prefixlen, argv[0]);
+               FILE *f = to_stdout ? stdout : fopen(fpath, "wb");
 
                if (!f)
                        ret = error("Could not open %s for writing", filename);