Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

suggested patch for error flagged in static analysis



I see this flagged as a "logical vs. bitwise operation" in my static analysis tool.

!CMF_FILE is always 0.  Should be ~CMF_FILE.

--- zsh-5.0.5/Src/Zle/compctl.c.orig    2014-08-04 12:20:54.327001219 -0700
+++ zsh-5.0.5/Src/Zle/compctl.c    2014-08-04 12:21:41.079945543 -0700
@@ -3389,11 +3389,11 @@ makecomplistflags(Compctl cc, char *s, i
         if (nonempty(l)) {
             /* And add the resulting words. */
             mflags |= CMF_FILE;
             for (n = firstnode(l); n; incnode(n))
             addmatch(getdata(n), NULL);
-            mflags &= !CMF_FILE;
+            mflags &= ~CMF_FILE;
         }
         opts[NULLGLOB] = ng;
         } else {
         char **dirs = 0, *ta[2];




Messages sorted by: Reverse Date, Date, Thread, Author