Source-Changes-D archive

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

Re: CVS commit: src/external/mit/xorg



On Sun, Aug 09, 2015 at 01:06:30AM +0200, Aymeric Vincent wrote:
 > David Holland <dholland-sourcechanges%netbsd.org@localhost> writes:
 > 
 > >  > Fix bracket expressions by moving '-' to the end of them. GNU awk choked.
 > >
 > > Front is safer. fwiw.
 > 
 > OK, I moved them to the front, together with '_' because it felt awkward
 > to separate the separators. Out of curiosity, is it "safer" just because
 > it is more robust to future additions to the expression or is it
 > actually "safer" even if the expression is left as is?

It's safer in the sense that a broken regexp parser is unlikely to
accidentally treat the first character of a character set as the
middle - in a range; but if the last character is - it might interpret
the second-last character, the -, and closing ] as a range, with
unfortunate results. It is not very likely; but stranger things have
happened, and it doesn't help that regexp tools have a long-standing
culture of not complaining about invalid regexp syntax.

anyway it's a very minor point.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index