hush: small speedup in handle_changed_special_names()
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 16 May 2019 09:32:26 +0000 (11:32 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 16 May 2019 09:32:26 +0000 (11:32 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/hush.c

index a103e81690789f496d9f63098427e37d55916cdc..ce341632a2bd80d7edbf8e8c82b7b38a66a9bcca 100644 (file)
@@ -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;
        }