NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/41764: ksh has suffered serious regressions in the past few years



The following reply was made to PR bin/41764; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/41764: ksh has suffered serious regressions in the past few 
years 
Date: Thu, 23 Jul 2009 22:55:15 +0700

     Date:        Wed, 22 Jul 2009 04:05:00 +0000 (UTC)
     From:        "Greg A. Woods" <woods%planix.com@localhost>
     Message-ID:  <20090722040500.B429063BBD1%www.NetBSD.org@localhost>
 
 I haven't looked at all of this, but I guarantee this isn't
 what you want ...
 
   | +  while (nest > 0 && (c = *s)) {
   | +          if (c == '\\') {
   | +                  s++;
   | +                  s++;
   | +                  continue;
   | +          }
 
 The second s++; should be something like
 
                        if (*s++ == '\0')
                                return NULL;
 
 String pointers that increment twice with no testing are usually
 just a big "BITE ME HERE" sign for bugs...  (this case certainly is.)
 
 And this is just plain ugly ...
        
   | +                          if ((cp = find_match(&s[1], '{')))
   | +                                  s = ++cp;
 
 if find_match(s+1, ...) then s = cp+1 - the forms used are just wacko.
 (no position taken on whether the if should have a != NULL explicit test.)
 
 kre
 


Home | Main Index | Thread Index | Old Index