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 Message-ID: <20000524151301.9227.qmail@web121.yahoomail.com> Date: Wed, 24 May 2000 08:13:01 -0700 (PDT) From: Earnie Boyd Reply-To: earnie_boyd AT yahoo DOT com Subject: Re: DOS-EOL bug in "fgets" To: Serguei DOT Grigoriev AT Physik DOT Uni-Augsburg DOT DE, cygwin AT sourceware DOT cygnus DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii From MSDOS with no cygwin process running. mkdir c:\cygupdate c: cd \cygupdate [download] ftp://ftp.sunsite.utk.edu/pub/cygwin/latest/setup.exe NOTE: put it in c:\cygupdate setup -u Cheers, Earnie --- "Sergey R. Grigoriev" wrote: > Hallo! > > I've found, that for DOS-EOL (\n\r) > fgets returns the string terminated by \r > (for UNIX-EOL (\n) is all OK). > By this way I can't use any makefile generated > by "bash ./configure" under W32 without converting it into > unix-EOL. > > It was some DOS-EOL problem with sed.exe and I recompiled it with > CYGNUS on W32 > > To configure "sed" without right working "sed" I used sed-replacement > script: > > #! bash > ! d2u_s $1 $2 $3 $4 > ! sed_org "$@" > > and wrote small d2u_s.c (MUST be compiled with CYGNUS!) to convert "-f > filename" file from DOS-EOL to UNIX-EOL. > > If you interesting I can sent you sed-binaries :-) > > Serge > > > > *********d2u_s.c********* > #include > > void d2u(char * arg) > { > FILE* in; > FILE* tmp; > FILE* out; > int c; > > in=fopen(arg,"rb"); > tmp=fopen("d2u_tmp_","wb"); > while((c=fgetc(in)) != EOF) > { > fprintf(tmp,"%c",(char)c); > } > fclose(tmp); > fclose(in); > > tmp=fopen("d2u_tmp_","rb"); > out=fopen(arg,"wb"); > while((c=fgetc(tmp)) != EOF) > { > if(c!=0x0D) fprintf(out,"%c",(char)c); > } > fclose(out); > fclose(tmp); > } > > > int main(int argc, char ** argv) > { > > int i; > > for(i=1;i { > if(argv[i][0]=='-') > if(argv[i][1]=='f') > if(argv[i][2]==0x00) > if((i+1) } > return 0; > } > > -- > Want to unsubscribe from this list? > Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com > __________________________________________________ Do You Yahoo!? Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/ -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com