svn commit: r227414 - head/lib/libc/regex

Andrey Chernov ache at FreeBSD.ORG
Thu Nov 10 03:25:25 UTC 2011


On Thu, Nov 10, 2011 at 01:44:06AM +0000, Kevin Lo wrote:
> - == static void p_ere(struct parse *p, int stop);
> + == static void p_ere(struct parse *p, wint_t stop);
>   */
>  static void
>  p_ere(struct parse *p,
> -	int stop)		/* character this ERE should end at */
> +	wint_t stop)		/* character this ERE should end at */
>  {
>  	char c;
>  	sopno prevback;

IMHO mechanical converting char to int (first prototypes "fixing" round), 
then int to wint_t (your next round) will leads to broken things like 
direct comparison of raw char and encoded wint_t:

	while (MORE() && (c = PEEK()) != '|' && c != stop)

while the true prototype for p_ere() is:

static void p_ere(struct parse *p, char stop);

This is the first thing I notice, so the whole patch should be carefully 
inspected and fixed.

-- 
http://ache.vniz.net/


More information about the svn-src-head mailing list