On 02/25/2011 02:33 PM, Eli Zaretskii wrote:
My suggestion is simply to use ISSLASH everywhere.
This would make the code everywhere harder to read. As a general rule, Gnulib code uses ISSLASH only when needed. Not only does this make the typical case simpler, it makes it clearer to the reader when it's important to check for '\\' and when it's not important.
There's no real savings in comparing against a literal slash.
There is only tiny runtime savings here, yes. But in this particular case the code is arguably clearer without using ISSLASH, because the bug occurs only with '/'; it never occurs with '\\'.
That might be so now, but a month or a year from now, someone will decide that gnulib's `lstat' needs to fix some other anomaly, which will cause DJGPP builds of some package out there to use this code.
Anyone who decides that should of course revisit this issue, and it'll be their responsibility to make sure the anomaly is handled correctly. This may use ISSLASH and may not; it's hard to anticipate and any guesses we make about this now are likely to be wrong.