comparison 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
comparison
equal deleted inserted replaced
5869:04b854934407 5870:df50aaeddca5
1482 { 1482 {
1483 cctable[valint] = range->ch; 1483 cctable[valint] = range->ch;
1484 } 1484 }
1485 /* Maybe our own case infrastructure is not available yet. Use the C 1485 /* Maybe our own case infrastructure is not available yet. Use the C
1486 library's. */ 1486 library's. */
1487 else if (isupper (range->ch) && !isupper (cctable[valint])) 1487 else if (current_buffer == NULL)
1488 { 1488 {
1489 cctable[valint] = range->ch; 1489 /* The C library can't necessarily handle values outside of
1490 the range EOF to CHAR_MAX, inclusive. */
1491 assert (range->ch == EOF || range->ch <= CHAR_MAX);
1492 if (isupper (range->ch) && !isupper (cctable[valint]))
1493 {
1494 cctable[valint] = range->ch;
1495 }
1490 } 1496 }
1491 /* Otherwise, save it if this character has a numerically lower value 1497 /* Otherwise, save it if this character has a numerically lower value
1492 (preferring ASCII over fullwidth Chinese and so on). */ 1498 (preferring ASCII over fullwidth Chinese and so on). */
1493 else if (range->ch < cctable[valint]) 1499 else if (range->ch < cctable[valint])
1494 { 1500 {