aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/argv.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index c2bab93..17903ea 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2020-01-23 Alexandre Oliva <oliva@adacore.com>
+
+ * argv.c (writeargv): Output empty args as "".
+
2020-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
diff --git a/libiberty/argv.c b/libiberty/argv.c
index 8c9794d..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;