diff 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
line wrap: on
line diff
--- 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;
     }