Skip to content

Commit

Permalink
Allow spaces in the name of the external preprocessor used by windres.
Browse files Browse the repository at this point in the history
	PR 26865
	* windres.c (main): If the preprocessor name includes spaces,
	ensure that it is quoted.
  • Loading branch information
nickclifton committed Nov 27, 2020
1 parent 2c6f3e5 commit 21c33bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions binutils/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2020-11-27 Nick Clifton <nickc@redhat.com>

PR 26865
* windres.c (main): If the preprocessor name includes spaces,
ensure that it is quoted.

2020-11-27 Jozef Lawrynowicz <jozef.l@mittosystems.com>

* testsuite/lib/binutils-common.exp (supports_noinit_section): New.
Expand Down
8 changes: 7 additions & 1 deletion binutils/windres.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,13 @@ main (int argc, char **argv)
break;

case OPTION_PREPROCESSOR:
preprocessor = optarg;
if (strchr (optarg, ' '))
{
if (asprintf (& preprocessor, "\"%s\"", optarg) == -1)
preprocessor = optarg;
}
else
preprocessor = optarg;
break;

case OPTION_PREPROCESSOR_ARG:
Expand Down

2 comments on commit 21c33bc

@mintty
Copy link

@mintty mintty commented on 21c33bc Mar 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change apparently breaks some build processes, see msys2/MSYS2-packages#2379

@mati865
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repository is only a mirror of https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git

Please sign in to comment.