From da5e2f948a0e2642cd00d1c950a68474a9d3486a Mon Sep 17 00:00:00 2001 From: Fumitoshi Ukai Date: Thu, 30 May 2024 01:58:49 +0000 Subject: [PATCH] autoninja: fix for no args need to split input_args[1] even if it doesn't contains " ", e.g. when input_args[1] == "" Bug: b/343172216 Change-Id: I32d9346063534ea2b4f891fd596c7ec02ab10dbf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5583415 Auto-Submit: Fumitoshi Ukai Commit-Queue: Richard Wang Reviewed-by: Richard Wang --- autoninja.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/autoninja.py b/autoninja.py index 0d7a5260e..1880931a8 100755 --- a/autoninja.py +++ b/autoninja.py @@ -221,8 +221,7 @@ def main(args): # separated by spaces. When this case is detected we need to do argument # splitting ourselves. This means that arguments containing actual spaces # are not supported by autoninja, but that is not a real limitation. - if (sys.platform.startswith("win") and len(args) == 2 - and input_args[1].count(" ") > 0): + if sys.platform.startswith("win") and len(args) == 2: input_args = args[:1] + args[1].split() # Ninja uses getopt_long, which allow to intermix non-option arguments.