Zebediah Figura : vkd3d-compiler: Check whether the source format is binary when checking if the output is a tty, when preprocessing.

Alexandre Julliard julliard at winehq.org
Tue Dec 1 15:40:17 CST 2020


Module: vkd3d
Branch: master
Commit: 10ab0ff12472ab0e9b24d1a2f156db5a0d156f52
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=10ab0ff12472ab0e9b24d1a2f156db5a0d156f52

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Mon Nov 30 11:16:45 2020 -0600

vkd3d-compiler: Check whether the source format is binary when checking if the output is a tty, when preprocessing.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/vkd3d-compiler/main.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c
index b79396e..91c8e04 100644
--- a/programs/vkd3d-compiler/main.c
+++ b/programs/vkd3d-compiler/main.c
@@ -639,12 +639,21 @@ int main(int argc, char **argv)
     if (!(output = open_output(options.output_filename, &close_output)))
         goto done;
 
-    if (!options.output_filename && get_target_type_info(options.target_type)->is_binary
-            && isatty(fileno(output)))
+    if (!options.output_filename && isatty(fileno(output)))
     {
-        fprintf(stderr, "Output is a tty and output format is binary, exiting.\n"
-                "If this is really what you intended, specify the output explicitly.\n");
-        goto done;
+        bool is_binary;
+
+        if (options.preprocess_only)
+            is_binary = get_source_type_info(options.source_type)->is_binary;
+        else
+            is_binary = get_target_type_info(options.target_type)->is_binary;
+
+        if (is_binary)
+        {
+            fprintf(stderr, "Output is a tty and output format is binary, exiting.\n"
+                    "If this is really what you intended, specify the output explicitly.\n");
+            goto done;
+        }
     }
 
     if (!options.explicit_colour && has_colour(output))




More information about the wine-cvs mailing list