Mercurial > hg > xemacs-beta
comparison src/event-stream.c @ 5804:75435be92103
Avoid make_uninit_string() for the command builder's echo_buf.
src/ChangeLog addition:
2014-08-03 Aidan Kehoe <kehoea@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.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 03 Aug 2014 20:13:40 +0100 |
parents | b79e1e02bf01 |
children | a216b3c2b09e |
comparison
equal
deleted
inserted
replaced
5803:b79e1e02bf01 | 5804:75435be92103 |
---|---|
378 | 378 |
379 builder->console = console; | 379 builder->console = console; |
380 reset_command_builder_event_chain (builder); | 380 reset_command_builder_event_chain (builder); |
381 if (with_echo_buf) | 381 if (with_echo_buf) |
382 { | 382 { |
383 builder->echo_buf = make_uninit_string (300 * MAX_ICHAR_LEN); | 383 builder->echo_buf = Fmake_string (make_fixnum (300 * MAX_ICHAR_LEN), |
384 make_char (0)); | |
384 } | 385 } |
385 else | 386 else |
386 { | 387 { |
387 builder->echo_buf = Qnil; | 388 builder->echo_buf = Qnil; |
388 } | 389 } |
2174 | 2175 |
2175 detach_all_extents (command_builder->echo_buf); | 2176 detach_all_extents (command_builder->echo_buf); |
2176 if (XSTRING_LENGTH (command_builder->echo_buf) < len) | 2177 if (XSTRING_LENGTH (command_builder->echo_buf) < len) |
2177 { | 2178 { |
2178 command_builder->echo_buf | 2179 command_builder->echo_buf |
2179 = make_uninit_string (len + 200 * MAX_ICHAR_LEN); | 2180 = Fmake_string (make_fixnum (len + 300 * MAX_ICHAR_LEN), |
2181 make_char (0)); | |
2180 } | 2182 } |
2181 | 2183 |
2182 args[0] = command_builder->echo_buf; | 2184 args[0] = command_builder->echo_buf; |
2183 Freplace (countof (args), args); | 2185 Freplace (countof (args), args); |
2184 copy_string_extents (command_builder->echo_buf, prompt, 0, 0, | 2186 copy_string_extents (command_builder->echo_buf, prompt, 0, 0, |