bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib/lib/lstat.c on DJGPP v2.04


From: Paul Eggert
Subject: Re: gnulib/lib/lstat.c on DJGPP v2.04
Date: Fri, 25 Feb 2011 15:12:18 -0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]