From c39f3bac71af80db95b52a86bb4b16f9cb95deb6 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 21 Feb 2016 18:54:17 +0000 Subject: [PATCH] sh: Optimize setprompt(0). Avoid doing work to print an empty prompt (such as when reading scripts). --- bin/sh/parser.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/sh/parser.c b/bin/sh/parser.c index 53d7923f8755..d324d88a8f18 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -1930,6 +1930,8 @@ static void setprompt(int which) { whichprompt = which; + if (which == 0) + return; #ifndef NO_HISTORY if (!el)