bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DJGPP specific: NULL pointer and strlwr


From: Juan Manuel Guerrero
Subject: DJGPP specific: NULL pointer and strlwr
Date: Wed, 20 Feb 2002 22:33:18 +0100

DJGPP's libc imposes to the programmer to check that no NULL pointer
is passed to a string function, strlwr() in this particular case,
except in those cases where the function is explicitly documented
to be able to accept NULL pointers.
This small patch will fix this issue.

Regards,
Guerrero, Juan Manuel


Index: bison/ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.173.2.281
diff -u -r1.173.2.281 ChangeLog
--- bison/ChangeLog     14 Feb 2002 20:17:53 -0000      1.173.2.281
+++ bison/ChangeLog     20 Feb 2002 21:26:55 -0000
@@ -1,3 +1,8 @@
+2002-02-20  Guerrero, Juan Manuel  <address@hidden>
+
+       * src/getargs.c [AS_FILE_NAME] [__DJGPP__]: New macro STRLWR.
+       Check that no NULL pointer is passed to strlwr.
+
 2002-02-14  Paul Eggert  <address@hidden>
 
        Remove the support for C++ namespace cleanliness; it was
Index: bison/src/getargs.c
===================================================================
RCS file: /cvsroot/bison/bison/src/getargs.c,v
retrieving revision 1.24.2.8
diff -u -r1.24.2.8 getargs.c
--- bison/src/getargs.c 13 Feb 2002 16:13:31 -0000      1.24.2.8
+++ bison/src/getargs.c 20 Feb 2002 21:26:57 -0000
@@ -165,7 +165,8 @@
 #ifdef MSDOS
 # if defined (__DJGPP__)
 /* Windows 9X and successors are case sensitive. */
-#  define AS_FILE_NAME(File) ((pathconf ((File), _PC_NAME_MAX) > 12) ? (File) 
: (strlwr (File), (File)))
+#  define STRLWR(String)     ((String) ? (strlwr (String), (String)) : 
(String))
+#  define AS_FILE_NAME(File) ((pathconf ((File), _PC_NAME_MAX) > 12) ? (File) 
: STRLWR (File))
 # else
 #  define AS_FILE_NAME(File) (strlwr (File), (File))
 # endif



reply via email to

[Prev in Thread] Current Thread [Next in Thread]