svn commit: r295866 - head/bin/sh

Jilles Tjoelker jilles at FreeBSD.org
Sun Feb 21 18:54:19 UTC 2016


Author: jilles
Date: Sun Feb 21 18:54:17 2016
New Revision: 295866
URL: https://svnweb.freebsd.org/changeset/base/295866

Log:
  sh: Optimize setprompt(0).
  
  Avoid doing work to print an empty prompt (such as when reading scripts).

Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Sun Feb 21 18:51:48 2016	(r295865)
+++ head/bin/sh/parser.c	Sun Feb 21 18:54:17 2016	(r295866)
@@ -1930,6 +1930,8 @@ static void
 setprompt(int which)
 {
 	whichprompt = which;
+	if (which == 0)
+		return;
 
 #ifndef NO_HISTORY
 	if (!el)


More information about the svn-src-head mailing list