Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Feb 2016 18:54:17 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r295866 - head/bin/sh
Message-ID:  <201602211854.u1LIsHKm041704@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602211854.u1LIsHKm041704>