www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/12/25/13:17:32

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <200112251817.TAA11490@father.ludd.luth.se>
Subject: Re: gcc 3.03 and libc sources
In-Reply-To: <Pine.SUN.3.91.1011225131954.5289B-100000@is> from Eli Zaretskii at "Dec 25, 2001 01:31:51 pm"
To: djgpp-workers AT delorie DOT com
Date: Tue, 25 Dec 2001 19:17:15 +0100 (MET)
X-Mailer: ELM [version 2.4ME+ PL54 (25)]
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

Updated patch (dosexec.c removed for the moment):

Index: djgpp//src/libc/ansi/stdio/doprnt.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/ansi/stdio/doprnt.c,v
retrieving revision 1.9
diff -p -u -r1.9 doprnt.c
--- djgpp//src/libc/ansi/stdio/doprnt.c 2001/06/09 20:33:22     1.9
+++ djgpp//src/libc/ansi/stdio/doprnt.c 2001/12/25 18:12:43
@@ -35,7 +35,7 @@ static char decimal = '.';
                flags&LONGDBL ? va_arg(argp, long long basetype) : \
                flags&LONGINT ? va_arg(argp, long basetype) : \
                flags&SHORTINT ? (short basetype)va_arg(argp, int) : \
-               va_arg(argp, int)
+               (basetype)va_arg(argp, int)

 static int nan_p = 0;

Index: djgpp//src/libc/compat/stdlib/fcvtbuf.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/compat/stdlib/fcvtbuf.c,v
retrieving revision 1.1
diff -p -u -r1.1 fcvtbuf.c
--- djgpp//src/libc/compat/stdlib/fcvtbuf.c     1998/07/25 18:58:44     1.1
+++ djgpp//src/libc/compat/stdlib/fcvtbuf.c     2001/12/25 18:12:44
@@ -2,6 +2,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 #include <float.h>
 #include <locale.h>

@@ -27,8 +28,11 @@ fcvtbuf (double value, int ndigits, int

   /* Where's the decimal point?  */
   dot = strchr (s, decimal);
-  *decpt = dot ? dot - s : strlen (s);
-
+  if( dot )
+    *decpt = dot - s;
+  else
+    *decpt = strlen (s);
+
   /* SunOS docs says if NDIGITS is 8 or more, produce "Infinity"
      instead of "Inf".  */
   if (strncmp (s, "Inf", 3) == 0)
Index: djgpp//src/libc/compat/unistd/_irdlink.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/compat/unistd/_irdlink.c,v
retrieving revision 1.3
diff -p -u -r1.3 _irdlink.c
--- djgpp//src/libc/compat/unistd/_irdlink.c    2001/06/27 17:42:32     1.3
+++ djgpp//src/libc/compat/unistd/_irdlink.c    2001/12/25 18:12:44
@@ -115,7 +115,8 @@ int __internal_readlink(const char * __p

    data_buf = buf + _SYMLINK_PREFIX_LEN;
    bytes_read = strchr(data_buf, '\n') - data_buf;
-   bytes_read = ((unsigned)bytes_read > __max) ? __max : bytes_read;
+   if( (unsigned)bytes_read > __max )
+     bytes_read = __max;
    memcpy(__buf, data_buf, bytes_read);
    return bytes_read;
 }
Index: djgpp//src/libc/posix/sys/stat/lstat.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/sys/stat/lstat.c,v
retrieving revision 1.8
diff -p -u -r1.8 lstat.c
--- djgpp//src/libc/posix/sys/stat/lstat.c      2001/12/01 20:22:37     1.8
+++ djgpp//src/libc/posix/sys/stat/lstat.c      2001/12/25 18:12:46
@@ -325,9 +325,20 @@ get_inode_from_sda(const char *mybasenam
   unsigned short our_mem_base   = _my_ds();
   char  * dot                   = strchr(mybasename, '.');
   size_t  total_len             = strlen(mybasename);
-  int     name_len              = dot ? dot - mybasename : total_len;
-  int     ext_len               = dot ? total_len - name_len - 1 : 0;
+  int     name_len;
+  int     ext_len;
   int     cluster_offset        = offsetof(struct full_dirent, fcluster);
+
+  if( dot )
+    {
+      name_len = dot - mybasename;
+      ext_len = total_len - name_len - 1;
+    }
+  else
+    {
+      name_len = total_len;
+      ext_len = 0;
+    }

   /* Restore failure bits set by last call to init_dirent_table(), so
      they will be reported as if it were called now.  */

- Raw text -


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