This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gawk Has Problem With CRLF in Mixed Binary/Text Files


I am using a gawk script on files that contain both printing 
characters and binary data.  Gawk is used to modify a few of 
the printing characters, and I expected that the binary data 
should be left alone.  For the most part, it is, but upon 
occasion a CRLF will appear inside some of the binary data.  
All my mounts are binary (see cygcheck.srv, which is from my 
laptop), but as can be seen by the attached files, the downloaded 
gawk executable always changes CRLF to LF, while Debian Linux 
5 and a couple of flavors of Knoppix do not.

The version of gawk which first exhibited this behavior is 3.1.5, 
and both it and the cygwin1.dll are very old.  I use a later 
version of 1.5 on my laptop and desktop, but gawk on both machines 
(3.1.6 on both) does the same thing.  I tried it on my wife's 
machine at home (running 1.7 from this past February), and it 
does the same thing.  As a quick test to isolate the problem, 
I downloaded the upstream gawk 3.1.6 and compiled it on my 
laptop, and it, too, changes CRLF to LF.

Unfortunately, the time I can spend on this at work is limited, 
so once I determined that the problem lies outside gawk, I thought 
I would check the archives.  Using Gmane, I haven't come across 
anything similar yet, so I was hoping somebody here might have some 
ideas.  Anybody?

					Thx, Phil Long
 << File:  cygcheck.srv >> 
 << File:  cygwinGawk-handlesCRLF-INcorrectly.txt >> 
 << File:  genericGawkCompiledUnerCygwin-handlesCRLF-INcorrectly.txt >> 
 << File:  linuxGawk-handlesCRLF-correctly.txt >> 

Attachment: cygcheck.srv
Description: Binary data

Attachment: cygwinGawk-handlesCRLF-INcorrectly.txt
Description: Text document

Attachment: genericGawkCompiledUnerCygwin-handlesCRLF-INcorrectly.txt
Description: Text document

Attachment: linuxGawk-handlesCRLF-correctly.txt
Description: Text document

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]