Allow spaces in the name of the external preprocessor used by windres.
authorNick Clifton <nickc@redhat.com>
Fri, 27 Nov 2020 14:18:20 +0000 (14:18 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 27 Nov 2020 14:19:56 +0000 (14:19 +0000)
PR 26865
* windres.c (main): If the preprocessor name includes spaces,
ensure that it is quoted.

binutils/ChangeLog
binutils/windres.c

index 212fd6437621f2ee939a2aa9e2def2bc24dc3320..fbd14f19e1594e722a3ffd9965a1ac6cb9358058 100644 (file)
@@ -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.
index 5c83dab8fc0dd5ba3a085b87aa9f5139a8a54a4b..df3e01fd941fae20d67586c914cb32681b919aef 100644 (file)
@@ -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: