APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1407093220 -3600
#      Sun Aug 03 20:13:40 2014 +0100
# Node ID 75435be92103f23d1905b4a3a60295164a9dd2b4
# Parent  b79e1e02bf012f32241a818847a2e9eedd5e3e96
Avoid make_uninit_string() for the command builder's echo_buf.
src/ChangeLog addition:
2014-08-03  Aidan Kehoe  <kehoea(a)parhasard.net>
	* event-stream.c (allocate_command_builder):
	* event-stream.c (Fnext_event):
	Use #'make-string rather than make_uninit_string() when allocating
	the command builder's echo_buf, avoiding having octets in the
	string that do not correspond to valid internal-format text.
diff -r b79e1e02bf01 -r 75435be92103 src/ChangeLog
--- a/src/ChangeLog	Mon Jul 14 13:42:42 2014 +0100
+++ b/src/ChangeLog	Sun Aug 03 20:13:40 2014 +0100
@@ -1,3 +1,11 @@
+2014-08-03  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* event-stream.c (allocate_command_builder):
+	* event-stream.c (Fnext_event):
+	Use #'make-string rather than make_uninit_string() when allocating
+	the command builder's echo_buf, avoiding having octets in the
+	string that do not correspond to valid internal-format text.
+
 2014-07-14  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* event-stream.c:
diff -r b79e1e02bf01 -r 75435be92103 src/event-stream.c
--- a/src/event-stream.c	Mon Jul 14 13:42:42 2014 +0100
+++ b/src/event-stream.c	Sun Aug 03 20:13:40 2014 +0100
@@ -380,7 +380,8 @@
   reset_command_builder_event_chain (builder);
   if (with_echo_buf)
     {
-      builder->echo_buf = make_uninit_string (300 * MAX_ICHAR_LEN);
+      builder->echo_buf = Fmake_string (make_fixnum (300 * MAX_ICHAR_LEN),
+                                        make_char (0));
     }
   else
     {
@@ -2176,7 +2177,8 @@
       if (XSTRING_LENGTH (command_builder->echo_buf) < len)
         {
           command_builder->echo_buf
-            = make_uninit_string (len + 200 * MAX_ICHAR_LEN);
+            = Fmake_string (make_fixnum (len + 300 * MAX_ICHAR_LEN),
+                            make_char (0));
         }
 
       args[0] = command_builder->echo_buf;
-- 
‘Liston operated so fast that he once accidentally amputated an assistant’s 
fingers along with a patient’s leg, […] The patient and the assistant both 
died of sepsis, and a spectator reportedly died of shock, resulting in the 
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches