Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Date: Tue, 16 May 2000 17:39:07 -0400 (EDT) Message-Id: <200005162139.RAA07331@gtei2.bellatlantic.net> From: Mark Schoenberg To: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Problem with CR-LF sensitivity X-mailer: msmail-1.0 by Emmes Technologies Xandy, I too had tremendous problems with the change in the CR/LF paradigm with 1.1.0 as compared to B20.1. I wrote a small program, reproduced below, which strips the CRs from files and solved most of the problems. A problem that remained for me was that emacs, which I was using, would put CRs in files and not tell you. If you are really interested, I can tell you how to solve the emacs problem as well. Having struggled, like you, I think it is worthwhile upgrading to 1.1.0. If you don't wish to, I found it pretty easy (in Windows 98) to go get rid of 1.1.0 by going to "Start"/"Programs"/"Cynus Solutions"/"Uninstall Cygwin 1.1.0". That seemed to work pretty well. Believe me, I did it at least twice before becoming convinced 1.1 was worth it. I only succeeded in installing 1.1.0 when I chose \ as the root directory. I suspect choosing other root directories is possible, but I couldn't figure how to succeed without choosing \. The program below for stripping CRs won't work for you as is, because it uses stuff only I have, like /u/local/include/stdhdr.h and getans, but it should be able to be easily modified. stdhdr.h simply includes the necessary system header (.h) files, and getans(a, b) simply gets the answer to question a and stores it as string b. The only significant aspect to the program is the binary read of an input file (note the setmode instruction), and the binary write of an output file of all characters except CR, '\015'. I am sure there are more sophisticated solutions but this worked for a dummy like me. #include "/u/local/include/stdhdr.h" #include int fileoncom, argn, f1, f2, n, c; FILE *ip,*ip2,*fp,*fopen(); char filnam[80], outfil[80], buf[1]; main(argc,argv) int argc; char **argv; { getans("Input filename?:",filnam); if ((f1=open(filnam, O_RDONLY, 0)) == -1) { perror("!stripcr2: Can't open input file!"); exit (-1); } setmode(f1,O_BINARY); getans("Ouput filename?:",outfil); if ((f2=open(outfil, O_CREAT | O_WRONLY | O_TRUNC, 0644)) == -1) { perror("!stripcr2: Can't open output file!"); exit (-1); } setmode(f2,O_BINARY); while ((n = read(f1 ,buf, 1)) > 0) { /* Binary read, 1 char at a time > buf */ c = *buf; // printf("MSDEBUG c = %d\n",c); if (c != '\015') write(f2,buf,1); } close(f1); close(f2); } -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com