GNU make 3.80 assumes that every string in the environment has at least
MAKELEVEL_LENGTH bytes in it, and it executes a subscript error otherwise.
Normally this is harmless, but....

Here is a patch.

2003-10-05  Paul Eggert  <[EMAIL PROTECTED]>

        * main.c (main):
        Avoid potential subscript error if environ has short strings.

===================================================================
RCS file: RCS/main.c,v
retrieving revision 3.80
retrieving revision 3.80.0.1
diff -pu -r3.80 -r3.80.0.1
--- main.c      2002/08/10 01:27:17     3.80
+++ main.c      2003/10/06 05:46:41     3.80.0.1
@@ -1845,8 +1845,8 @@ int main (int argc, char ** argv)
 
 #ifndef _AMIGA
          for (p = environ; *p != 0; ++p)
-           if ((*p)[MAKELEVEL_LENGTH] == '='
-               && strneq (*p, MAKELEVEL_NAME, MAKELEVEL_LENGTH))
+           if (strneq (*p, MAKELEVEL_NAME, MAKELEVEL_LENGTH)
+               && (*p)[MAKELEVEL_LENGTH] == '=')
              {
                /* The SGI compiler apparently can't understand
                   the concept of storing the result of a function


_______________________________________________
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make

Reply via email to