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)
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to