diff options
author | Simon McVittie <smcv@collabora.com> | 2021-04-13 12:28:59 +0100 |
---|---|---|
committer | Alexander Larsson <alexander.larsson@gmail.com> | 2021-04-13 14:14:10 +0200 |
commit | db7d9cfeb551f80dbb562f35e4dd04b61b339453 (patch) | |
tree | 03ca94a3664d568b5e9f7d91fbe95f3f8ce3b716 | |
parent | e9c217adc1de2102c6d4412225827affb429e084 (diff) | |
download | flatpak-db7d9cfeb551f80dbb562f35e4dd04b61b339453.tar.gz |
utils: Quote empty strings when debug-logging argv
If an argument takes a value, and the value is empty, then it's
misleading to quote `{"--foo", "--empty", "", "--bar"}` as
`--foo --empty --bar`. It's better to get `--foo --empty '' --bar`.
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r-- | common/flatpak-utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/common/flatpak-utils.c b/common/flatpak-utils.c index 3b8ab521..1aba8a74 100644 --- a/common/flatpak-utils.c +++ b/common/flatpak-utils.c @@ -1415,6 +1415,9 @@ flatpak_switch_symlink_and_remove (const char *symlink_path, gboolean flatpak_argument_needs_quoting (const char *arg) { + if (*arg == '\0') + return TRUE; + while (*arg != 0) { char c = *arg; |