zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: "whence" and patterns, yet again
@ 2015-04-06 16:33 Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2015-04-06 16:33 UTC (permalink / raw)
  To: zsh-workers

Using logical-or caused premature short-circuit of some searches.  Thinko.

diff --git a/Src/builtin.c b/Src/builtin.c
index 614b17d..de01014 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3236,21 +3236,23 @@ bin_whence(char *nam, char **argv, Options ops, int func)
 		/* -p option is for path search only.    *
 		 * We're not using it, so search for ... */
 
-		informed = /* logical OR of what follows */
-
 		/* aliases ... */
+		informed +=
 		scanmatchtable(aliastab, pprog, 1, 0, DISABLED,
-			       aliastab->printnode, printflags) ||
+			       aliastab->printnode, printflags);
 
 		/* and reserved words ... */
+		informed +=
 		scanmatchtable(reswdtab, pprog, 1, 0, DISABLED,
-			       reswdtab->printnode, printflags) ||
+			       reswdtab->printnode, printflags);
 
 		/* and shell functions... */
+		informed +=
 		scanmatchtable(shfunctab, pprog, 1, 0, DISABLED,
-			       shfunctab->printnode, printflags) ||
+			       shfunctab->printnode, printflags);
 
 		/* and builtins. */
+		informed +=
 		scanmatchtable(builtintab, pprog, 1, 0, DISABLED,
 			       builtintab->printnode, printflags);
 	    }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-06 16:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-06 16:33 PATCH: "whence" and patterns, yet again Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).