Module: wine Branch: oldstable Commit: 6cc918ac6249fc2902a19173bb041750c67240cb URL: https://source.winehq.org/git/wine.git/?a=commit;h=6cc918ac6249fc2902a19173b...
Author: Kevin Puetz PuetzKevinA@JohnDeere.com Date: Tue Sep 24 18:35:03 2019 +0200
winegcc: Correctly pass the '-' file name (stdin) to the compiler.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=38300 Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit d5e175e32b64cd734c142cfc583f17bccb03ec5b) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
tools/winegcc/winegcc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 71ebf123e3..c8f9111382 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -686,7 +686,7 @@ no_compat_defines: /* last, but not least, the files */ for ( j = 0; j < opts->files->size; j++ ) { - if (opts->files->base[j][0] != '-') + if (opts->files->base[j][0] != '-' || !opts->files->base[j][1]) /* not an option or bare '-' (i.e. stdin) */ strarray_add(comp_args, opts->files->base[j]); }
@@ -1447,7 +1447,7 @@ int main(int argc, char **argv) /* parse options */ for ( i = 1 ; i < argc ; i++ ) { - if (argv[i][0] == '-') /* option */ + if (argv[i][0] == '-' && argv[i][1]) /* option, except '-' alone is stdin, which is a file */ { /* determine if this switch is followed by a separate argument */ next_is_arg = 0;