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

forward: fix for problem under cygwin



------- Forwarded Message

From: JohnW@xxxxxxxx
To: coordinator@xxxxxxx
Subject: fix for problem under cygwin
Date: Mon, 10 Dec 2001 13:52:31 -0600
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"

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. Here are
the lines I had to change:

exec.c:3473:
    off_t len, textlen;
exec:c:3493:
		if ((textlen = read(fd, d, len)) >= 0) {
exec.c:3497-8:
		    d[textlen] = '\0';
		    d = metafy(d, textlen, META_REALLOC);
parse.c:2408:
    if ((fd = open(name, O_RDONLY | O_BINARY)) < 0) {
parse.c:2545:
    int dfd, fd, hlen, tlen, flen, ona = noaliases, textlen;
parse.c:2580: (DELETED)
	file[flen] = '\0';
parse.c:2581:
	if ((textlen = read(fd, file, flen)) < 0) {
parse.c:2591:
	file[textlen] = '\0';
	file = metafy(file, textlen, META_REALLOC);
parse.c:3017:
	    if ((fd = open(file, O_RDONLY | O_BINARY)) < 0 ||

------- End of Forwarded Message



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