Prevent infinite recursion with undecided coding system

Michael Sperber sperber at informatik.uni-tuebingen.de
Tue Jul 31 11:48:22 EDT 2007


This has been haunting me forever.  I'll apply Thursday if nobody
objects.

2007-07-31  Mike Sperber  <mike at xemacs.org>

	* file-coding.c (undecided_convert): Kludge to prevent infinite
	recursion.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
-------------- next part --------------
Index: src/file-coding.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/file-coding.c,v
retrieving revision 1.57
diff -u -r1.57 file-coding.c
--- src/file-coding.c	22 Jul 2007 22:04:13 -0000	1.57
+++ src/file-coding.c	31 Jul 2007 15:46:41 -0000
@@ -3869,6 +3869,9 @@
 		     random result when doing subprocess detection. */
 		  detect_coding_type (data->st, src, n);
 		  data->actual = detected_coding_system (data->st);
+		  /* kludge to prevent infinite recursion */
+		  if (XCODING_SYSTEM(data->actual)->methods->enumtype == undecided_coding_system)
+		    data->actual = Fget_coding_system (Qraw_text);
 		}
 	    }
 	  /* We need to set the detected coding system if we actually have


More information about the XEmacs-Patches mailing list