bug-m4
[Top][All Lists]
Advanced

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

m4-1.4.2 freeze files on cygwin


From: Stepan Kasal
Subject: m4-1.4.2 freeze files on cygwin
Date: Fri, 31 Dec 2004 07:33:01 +0100
User-agent: Mutt/1.4.1i

Hello,
        I'm forwarding your message to the bug-m4 list.
Stepan Kasal

----- message from Bolo <address@hidden> -----
To: address@hidden
Date: Thu, 30 Dec 2004 11:22:22 -0600

I noticed a problem with m4 freeze files that occurs in the cygwin
environment.  I'm using a slightly older version of cygwin;
haven't tested it against the current version.  However, this is
a generic problem that can occur in any "non-unix" environment which
uses something different than newline for line endings.

The problem is that the freeze-file parser assumes that a save-file is
a unix style '\n' delimited  file.  However on win32 systems normal text
files are \r\n delimited .... which causes the freeze file reader
to choke when it finds a \r instead of the expected \n.

A simple solution to this is to change mode of the stdio stream with
writes the save file to binary.  That way the '\n' will be there as
K&R and company intended, 

In freeze.c:56, the fopen embedded in the 'if' statement ...

        fopen (name, "w")

can be changed to a ...

        fopen (name, "wb")

to eliminate the problem.


Bolo -- Josef T. Burger

----- End forwarded message -----




reply via email to

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