comparison src/text.c @ 2385:6b957313bd8e

[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.
author ben
date Sat, 13 Nov 2004 06:32:25 +0000
parents ecf1ebac70d8
children ab71ad6ff3dd
comparison
equal deleted inserted replaced
2384:7139b7bbcaec 2385:6b957313bd8e
4475 active_alloca_convert = Dynarr_new (alloca_convert_vals); 4475 active_alloca_convert = Dynarr_new (alloca_convert_vals);
4476 4476
4477 for (i = 0; i < Dynarr_length (active_alloca_convert); i++) 4477 for (i = 0; i < Dynarr_length (active_alloca_convert); i++)
4478 { 4478 {
4479 vals = Dynarr_atp (active_alloca_convert, i); 4479 vals = Dynarr_atp (active_alloca_convert, i);
4480 if (vals->srctext == srctext) 4480 /* On my system, two different occurrences of the same stringized
4481 argument always point to the same string. However, on someone
4482 else's system, that wasn't the case. We check for equality
4483 first, since it seems systems work my way more than the other
4484 way. */
4485 if (vals->srctext == srctext || !strcmp (vals->srctext, srctext))
4481 return i; 4486 return i;
4482 } 4487 }
4483 4488
4484 return -1; 4489 return -1;
4485 } 4490 }