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

PATCH: fix for autoloading and compiling under Cygwin



I was actually overlooking writing of zwc files in my first fix. Here's a
new patch that really fixes the problem, with a test case, too. I've done
two things here:

* I added the O_BINARY flag to all calls to 'open' on zwc files.
* For text files, I changed the code to treat the result of 'seek' as an
upper bound on the length of the file. For the actual length, the return
value of 'read' is used. Checks that 'seek' and 'read' return the same thing
have been changed to check that 'seek' and 'read' both return nonnegative
values.

-----Original Message-----
From: Borsenkow Andrej [mailto:Andrej.Borsenkow@xxxxxxxxxxxxxx]
Sent: Monday, December 17, 2001 8:43 AM
To: 'Zsh hackers list'
Cc: JohnW@xxxxxxxx
Subject: RE: forward: fix for problem under cygwin




> 
> I found a Unixism in zsh that prevents autoloading and function
compilation
> from working under cygwin. There are several bits of code that assume
> character offsets are the same as byte offsets in files. I've fixed
this by
> either opening files in binary mode or relaxing the error checking.

No. We must never assume files are DOS text files because it makes them
non-portable not only between Cygwin/Unix but even between two different
Cygwin instances (just think about remounting the same directory in
binary mode after creating file in text mode).

We must ensure that read/write of zwc files always happens in binary
mode. This will make it possible to share files between Cygwin/Unix as
well. Your patch has several O_BINARY for reading but I do not see
O_BINARY for writing.

Of course, after doing it one probably has to recreate zwc files to be
sure.

-andrej

Attachment: zsh-patch.diff
Description: Binary data

Attachment: A06autoload.ztst
Description: Binary data



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