Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: PATCH: avoid hashing command names twice on Cygwin



>
> Under Cygwin every foo.exe was hashed twice - as foo and foo.exe.
>
> Actually, the code was funny. It contained one block that was executed
> unconditionally and exactly the same later under condition.
>

Hmm ... I believe, this was intentional. But, under Cygwin, foo.exe *is* foo -
stat(foo) returns the same as stat(foo.exe) if foo does not exist. Also, IIRC
_WIN32 was removed from current development version of Cygwin, so the above
would be resolved in favour of foo.exe instead of foo.

We could be more intellegent and test if stat(foo) != stat(foo.exe) to decide
if we should add both. Is it worth troubles?

OTOH it is just command table; for all purposes hashing foo is the same as
hashing foo.exe except very rare cases when both exist.

Comments?

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author