www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/11/08/02:53:32

Date: Wed, 8 Nov 2000 09:43:15 +0200 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
cc: djgpp-workers AT delorie DOT com, taupin AT lps DOT u-psud DOT fr
Subject: Re: Patch for dtou.c and utod.c
In-Reply-To: <7263-Tue07Nov2000222440+0200-eliz@is.elta.co.il>
Message-ID: <Pine.A41.4.05.10011080927500.30308-100000@ieva06.lanet.lv>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com


On Tue, 7 Nov 2000, Eli Zaretskii wrote:

> > From: pavenis AT lanet DOT lv
> > Date: Tue, 7 Nov 2000 20:01:22 +0200
> > 
> > I did only some minimal testing yet.
> 
> The patches look fine to me.  I committed them.
> 

Unfortunatelly they are not ok when built with paranoid options used in 
djlsrXXX.zip as we still have warnings treated as errors (rebuilt
all from CVS sources under Linux this morning). So one additional small
patch is needed.

One additional suggestion: There are small DOS utility in Simtelnet
(simtelnet/msdos/fileutils/nocrlf10.zip) which permits to repair
binary files which are errorously transfered as text (it was DOS only so
no LFN support, of course). Now only change we need for that in dtou is to
skip Ctrl-Z processing. My suggestion is to do that if executable name is
nocrlf only. So one can do:
	ln -s dtou.exe nocrlf.exe

Andris


--- src/utils/dtou.c~1	Wed Nov  8 07:01:54 2000
+++ src/utils/dtou.c	Wed Nov  8 09:26:00 2000
@@ -17,7 +17,7 @@
 static int
 dtou(char *fname)
 {
-  int i, k, k2, sf, df, l, l2, err=0, isCR=0;
+  int i, k, k2, sf, df, l, l2=0, err=0, isCR=0;
   char buf[16384];
   char tfname[FILENAME_MAX], *bn, *w;
   struct stat st;
@@ -60,7 +60,7 @@
          	     else    buf[k++] = buf[i];
          isCR = 0;
       }
-    if (k>0) l2=write(df, buf, k);
+    l2=(k>0 ? write(df, buf, k) : 0);
     if (l2<0 || CtrlZ) break;
     if (l2!=k) { err=1; break; }
   }
--- src/utils/utod.c~1	Wed Nov  8 07:01:54 2000
+++ src/utils/utod.c	Wed Nov  8 09:27:02 2000
@@ -19,7 +19,7 @@
 static int
 utod(char *fname)
 {
-  int i, k, k2, sf, df, l, l2, err=0, iscr=0;
+  int i, k, sf, df, l, l2=0, err=0, iscr=0;
   char buf[16384], buf2[32768];
   char tfname[FILENAME_MAX], *bn, *w;
   struct stat st;


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019