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

Re: PATCH: 3.1.6-pws-3: bslashquote() is slightly messed up.



On Sep 13,  4:00am, Tanaka Akira wrote:
} Subject: Re: PATCH: 3.1.6-pws-3: bslashquote() is slightly messed up.
}
} In article <990912165419.ZM23254@xxxxxxxxxxxxxxxxxxxxxxx>,
}   "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> writes:
} 
} > +    DPUTS(!e || sf, "BUG: Wild pointer *e in bslashquote()");
} 
} Hm. Is this really a bug? I think e == NULL is allowed.

Hm.  It's really tricky to write the conditions for DPUTS(), partly because
I keep thinking in terms of assert(), of which DPUTS() is the reverse.

Index: utils.c
===================================================================
@@ -2999,7 +2999,7 @@
 
     if (e && *e == u)
 	*e = v, sf = 1;
-    DPUTS(!e || sf, "BUG: Wild pointer *e in bslashquote()");
+    DPUTS(e && !sf, "BUG: Wild pointer *e in bslashquote()");
 
     return buf;
 }

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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