[git commit] hush: small speedup in handle_changed_special_names()

Denys Vlasenko vda.linux at googlemail.com
Thu May 16 09:32:26 UTC 2019


commit: https://git.busybox.net/busybox/commit/?id=0ee0b658b3b651d952965dd85a7b1dd0ac5312dc
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/hush.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/shell/hush.c b/shell/hush.c
index a103e8169..ce341632a 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2253,10 +2253,10 @@ static const char* FAST_FUNC get_local_var_value(const char *name)
 static void handle_changed_special_names(const char *name, unsigned name_len)
 {
 	if (ENABLE_HUSH_INTERACTIVE && ENABLE_FEATURE_EDITING_FANCY_PROMPT
-	 && G_interactive_fd
 	 && name_len == 3 && name[0] == 'P' && name[1] == 'S'
 	) {
-		cmdedit_update_prompt();
+		if (G_interactive_fd)
+			cmdedit_update_prompt();
 		return;
 	}
 


More information about the busybox-cvs mailing list