From 21c33bcbe36377abf01614fb1b9be439a3b6de20 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 27 Nov 2020 14:18:20 +0000 Subject: [PATCH] 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. --- binutils/ChangeLog | 6 ++++++ binutils/windres.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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: -- 2.30.2