summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2016-02-21 18:54:17 +0000
committerjilles <jilles@FreeBSD.org>2016-02-21 18:54:17 +0000
commitf523bd6c78181527b21a37f4dc5c51e0517bf523 (patch)
tree936f396096f5dce259ecd2353927c5b450bf13ad /bin
parent198806b5c9ad1a3129e9ea00274c7156d87d6722 (diff)
downloadFreeBSD-src-f523bd6c78181527b21a37f4dc5c51e0517bf523.zip
FreeBSD-src-f523bd6c78181527b21a37f4dc5c51e0517bf523.tar.gz
sh: Optimize setprompt(0).
Avoid doing work to print an empty prompt (such as when reading scripts).
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/parser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 53d7923..d324d88 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)
OpenPOWER on IntegriCloud