Merge branch 'sb/t1020-cleanup'
[gitweb.git] / builtin / merge-file.c
index 131edc245fdc0f5f8cb1e5d3da4120d072858d3f..ea8093f6769e278c4f7871faf405fe1e3f0a7544 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);