diff options
author | jilles <jilles@FreeBSD.org> | 2016-02-21 18:54:17 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2016-02-21 18:54:17 +0000 |
commit | f523bd6c78181527b21a37f4dc5c51e0517bf523 (patch) | |
tree | 936f396096f5dce259ecd2353927c5b450bf13ad | |
parent | 198806b5c9ad1a3129e9ea00274c7156d87d6722 (diff) | |
download | FreeBSD-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).
-rw-r--r-- | bin/sh/parser.c | 2 |
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) |