[S] Prevent infinite recursion with undecided coding system

Michael Sperber sperber at informatik.uni-tuebingen.de
Thu Aug 2 02:46:00 EDT 2007


Following Aidan's suggestion, this one uses Qbinary instead of
Qraw_text.

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

	* file-coding.c (undecided_convert): Kludge to prevent infinite
	recursion.
	* file-coding.c (detected_coding_system): Change default from
	raw-text to binary.

-- 
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	2 Aug 2007 06:44:29 -0000
@@ -3520,7 +3520,7 @@
 	    }
 	}
       if (NILP (retval))
-	retval = Fget_coding_system (Qraw_text);
+	retval = Fget_coding_system (Qbinary);
       return retval;
     }
   else
@@ -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 (Qbinary);
 		}
 	    }
 	  /* We need to set the detected coding system if we actually have


More information about the XEmacs-Patches mailing list