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>
This commit is contained in:
Kevin Puetz 2019-09-24 18:35:03 +02:00 committed by Alexandre Julliard
parent 4e896e3ee1
commit d5e175e32b
1 changed files with 2 additions and 2 deletions

View File

@ -795,7 +795,7 @@ no_compat_defines:
/* last, but not least, the files */ /* last, but not least, the files */
for ( j = 0; j < opts->files->size; j++ ) 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]); strarray_add(comp_args, opts->files->base[j]);
} }
@ -1472,7 +1472,7 @@ int main(int argc, char **argv)
/* parse options */ /* parse options */
for ( i = 1 ; i < argc ; i++ ) 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 */ /* determine if this switch is followed by a separate argument */
next_is_arg = 0; next_is_arg = 0;