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: <392BEE34.67F53431@physik.uni-augsburg.de> Date: Wed, 24 May 2000 16:59:00 +0200 From: "Sergey R. Grigoriev" Reply-To: Serguei DOT Grigoriev AT Physik DOT Uni-Augsburg DOT DE Organization: Uni-Augsburg X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: de,en MIME-Version: 1.0 To: cygwin AT sourceware DOT cygnus DOT com Subject: DOS-EOL bug in "fgets" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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