diff src/data.c @ 5870:df50aaeddca5

Don't tickle an unreasonable but standard C lib limitation, thank you Vin! src/ChangeLog addition: 2015-03-17 Aidan Kehoe <kehoea@parhasard.net> * data.c (fill_ichar_array): Be a bit more careful never to supply the C library's isupper() with a value outside of that range specified by the C standard. Thank you Vin Shelton for reporting the Linux segmentation violation this provokes, and happy St. Patrick's Day to everyone reading the XEmacs lists!
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 17 Mar 2015 00:29:39 +0000
parents e0f1dfaa821e
children 58e72e27fb81
line wrap: on
line diff
--- a/src/data.c	Mon Mar 16 09:03:22 2015 +0000
+++ b/src/data.c	Tue Mar 17 00:29:39 2015 +0000
@@ -1484,9 +1484,15 @@
 	}
       /* Maybe our own case infrastructure is not available yet. Use the C
          library's. */
-      else if (isupper (range->ch) && !isupper (cctable[valint]))
+      else if (current_buffer == NULL)
         {
-	  cctable[valint] = range->ch;          
+	  /* The C library can't necessarily handle values outside of
+	     the range EOF to CHAR_MAX, inclusive. */
+	  assert (range->ch == EOF || range->ch <= CHAR_MAX);
+	  if (isupper (range->ch) && !isupper (cctable[valint]))
+	    {
+	      cctable[valint] = range->ch;
+	    }
         }
       /* Otherwise, save it if this character has a numerically lower value
          (preferring ASCII over fullwidth Chinese and so on). */