From 2a1b0e51ddcde1534a51ccc185769a2253c0ce7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Thu, 17 Sep 2020 12:49:12 +0100 Subject: [PATCH] scripts: fix logic error in argv wrapping code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first piece of the command we process must be added to the list straight away regardless of whether it starts with a '-' or not. Reviewed-by: Michal Privoznik Signed-off-by: Daniel P. Berrangé --- scripts/test-wrap-argv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test-wrap-argv.py b/scripts/test-wrap-argv.py index 4193e6b68d..6b0d3511f3 100755 --- a/scripts/test-wrap-argv.py +++ b/scripts/test-wrap-argv.py @@ -59,7 +59,7 @@ def rewrap_line(line): # If there's a leading '-' then this is a new # parameter, otherwise its a value for the prev # parameter. - if bit.startswith("-"): + if bit.startswith("-") or len(args) == 0: args.append(bit) else: args[-1] = args[-1] + " " + bit