From: Daniel P. Berrangé Date: Thu, 17 Sep 2020 11:49:12 +0000 (+0100) Subject: scripts: fix logic error in argv wrapping code X-Git-Tag: v6.8.0-rc1~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a1b0e51ddcde1534a51ccc185769a2253c0ce7a;p=thirdparty%2Flibvirt.git scripts: fix logic error in argv wrapping code 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é --- 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