From: Nick Clifton Date: Fri, 27 Nov 2020 14:18:20 +0000 (+0000) Subject: Allow spaces in the name of the external preprocessor used by windres. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=21c33bcbe36377abf01614fb1b9be439a3b6de20;p=binutils-gdb.git Allow spaces in the name of the external preprocessor used by windres. PR 26865 * windres.c (main): If the preprocessor name includes spaces, ensure that it is quoted. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 212fd643762..fbd14f19e15 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2020-11-27 Nick Clifton + + PR 26865 + * windres.c (main): If the preprocessor name includes spaces, + ensure that it is quoted. + 2020-11-27 Jozef Lawrynowicz * testsuite/lib/binutils-common.exp (supports_noinit_section): New. diff --git a/binutils/windres.c b/binutils/windres.c index 5c83dab8fc0..df3e01fd941 100644 --- a/binutils/windres.c +++ b/binutils/windres.c @@ -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: