about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Modules/zpty.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ba6e762f2..4299bcf33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-11-08  Sven Wischnowsky  <wischnow@zsh.org>
 
+	* ?????: Src/Modules/zpty.c: use possible read character from
+	read_poll() in loop in ptyread()
+	
 	* 13128: Completion/Builtins/_zstyle, Completion/Core/_match,
  	Completion/Core/_path_files, Doc/Zsh/compsys.yo: aloow value
  	`pattern' for insert-unambiguous style to preserve patterns in the
diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
index 2408be797..d25c3a865 100644
--- a/Src/Modules/zpty.c
+++ b/Src/Modules/zpty.c
@@ -483,7 +483,12 @@ ptyread(char *nam, Ptycmd cmd, char **args)
 	    if (cmd->fin)
 		break;
 	}
-	if ((ret = read(cmd->fd, buf + used, 1)) == 1) {
+	if (cmd->read != -1 || (ret = read(cmd->fd, buf + used, 1)) == 1) {
+	    if (cmd->read != -1) {
+		ret = 1;
+		buf[used] = (char) cmd->read;
+		cmd->read = -1;
+	    }
 	    seen = 1;
 	    if (++used == blen) {
 		if (!*args) {