On Jan 22, 2020, Richard Biener <rguent...@suse.de> wrote:

>> I suppose I might go ahead and install the libiberty follow-up patch
>> approved by Joseph, and squash the lto-wrapper portion into the larger
>> patch.  Please let me know in case you think the libiberty change to
>> preserve empty arguments should also be deferred to 11.

> I think it's fine to make that change now.

Here's the split-out patch I'm installing now.  The other fragment is
being combined with the patch pending for GCC 11 stage 1.


[libiberty] output empty args as a pair of quotes

From: Alexandre Oliva <ol...@adacore.com>

writeargv writes out empty arguments in a way that expandargv skips
them instead of preserving them.  Fixed by writing out a pair of
quotes for them.


for  libiberty/ChangeLog

        * argv.c (writeargv): Output empty args as "".
---
 libiberty/argv.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libiberty/argv.c b/libiberty/argv.c
index 8c9794db..6a72208 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -327,6 +327,14 @@ writeargv (char * const *argv, FILE *f)
           arg++;
         }
 
+      /* Write out a pair of quotes for an empty argument.  */
+      if (arg == *argv)
+       if (EOF == fputs ("\"\"", f))
+         {
+           status = 1;
+           goto done;
+         }
+
       if (EOF == fputc ('\n', f))
         {
           status = 1;


-- 
Alexandre Oliva, freedom fighter   he/him   https://FSFLA.org/blogs/lxo
Free Software Evangelist           Stallman was right, but he's left :(
GNU Toolchain Engineer    FSMatrix: It was he who freed the first of us
FSF & FSFLA board member                The Savior shall return (true);

Reply via email to