# HG changeset patch # User ben # Date 1100327545 0 # Node ID 6b957313bd8e1d4d8a20d292ab4b23f174768671 # Parent 7139b7bbcaeca52cee4d92ef8b8785084b697e38 [xemacs-hg @ 2004-11-13 06:32:24 by ben] fix for Marcus's crash text.c: Two different occurrences of a string stringized from the exact same parameter may not necessarily be the same string, so check with strcmp. diff -r 7139b7bbcaec -r 6b957313bd8e src/ChangeLog --- a/src/ChangeLog Fri Nov 12 22:52:42 2004 +0000 +++ b/src/ChangeLog Sat Nov 13 06:32:25 2004 +0000 @@ -1,3 +1,10 @@ +2004-11-12 Ben Wing + + * text.c (find_pos_of_existing_active_alloca_convert): + Two different occurrences of a string stringized from the exact + same parameter may not necessarily be the same string, so check + with strcmp. + 2004-11-12 Jerry James * lstream.c (Lstream_really_write): Don't call the flusher if the diff -r 7139b7bbcaec -r 6b957313bd8e src/text.c --- a/src/text.c Fri Nov 12 22:52:42 2004 +0000 +++ b/src/text.c Sat Nov 13 06:32:25 2004 +0000 @@ -4477,7 +4477,12 @@ for (i = 0; i < Dynarr_length (active_alloca_convert); i++) { vals = Dynarr_atp (active_alloca_convert, i); - if (vals->srctext == srctext) + /* On my system, two different occurrences of the same stringized + argument always point to the same string. However, on someone + else's system, that wasn't the case. We check for equality + first, since it seems systems work my way more than the other + way. */ + if (vals->srctext == srctext || !strcmp (vals->srctext, srctext)) return i; }