From f94ace6d2ee0a8bc7ca8d18f12884eed99669984 Mon Sep 17 00:00:00 2001 From: Hurrison Date: Thu, 25 Apr 2024 17:48:14 +0800 Subject: [PATCH] fix: move `Gui.cmd.get_command_parts()` outside the loop `Gui.cmd.get_command_parts()` is inside a loop but calls a method that likely returns the same result in each iteration --- arsenal/modules/gui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arsenal/modules/gui.py b/arsenal/modules/gui.py index 535b538..0176fd9 100644 --- a/arsenal/modules/gui.py +++ b/arsenal/modules/gui.py @@ -407,12 +407,12 @@ def get_nb_preview_new_lines(self): nblines = 0 multiline = '\n' in Gui.cmd.cmdline firstline = True + parts = Gui.cmd.get_command_parts() + nb_args_todo = len(parts) - 1 # in case of multiline cmd process each line separately # for each line we have to count each char and deduce the # number of lines needed to print it for line in Gui.cmd.cmdline.split('\n'): - parts = Gui.cmd.get_command_parts() - nb_args_todo = len(parts) - 1 nbchar = 0 # for all lines except the first one we have ' >' in addition