Author: iratqq
Date: Wed Jun 25 05:33:54 2008
New Revision: 5504
Modified:
trunk/emacs/uim-el-helper-agent.c
Log:
* emacs/uim-el-helper-agent.c (read_command):
Fix serious bug. read() is running on loop.
enbuged in r5139, r5140.
Modified: trunk/emacs/uim-el-helper-agent.c
==============================================================================
--- trunk/emacs/uim-el-helper-agent.c (original)
+++ trunk/emacs/uim-el-helper-agent.c Wed Jun 25 05:33:54 2008
@@ -206,13 +206,10 @@
debug_printf(DEBUG_NOTE, "read command\n");
do {
- if ((len = read(STDIN_FILENO, rbuf, sizeof(rbuf) - 1)) == -1 || len
== 0) {
- rbuf[0] = '\n';
- rbuf[1] = '\0';
- len = 1;
+ if ((len = read(STDIN_FILENO, rbuf, sizeof(rbuf) - 1)) == -1)
debug_printf(DEBUG_NOTE, "stdin has corrupted\n");
- } else
- rbuf[len] = '\0';
+
+ rbuf[len] = '\0';
if (strlen(cmdbuf) + len + 1 > cmdbuf_len) {
cmdbuf_len += DEFAULT_MESSAGE_SIZE;