From 3a2b45559f25bb7390ec1260dba9085b6856382f Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 6 Feb 2002 18:03:58 +0000 Subject: /EXEC's last output line wasn't printed if it didn't contain newline at end of line. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2395 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/fe-exec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/fe-common/core/fe-exec.c') diff --git a/src/fe-common/core/fe-exec.c b/src/fe-common/core/fe-exec.c index 5d78894a..80972634 100644 --- a/src/fe-common/core/fe-exec.c +++ b/src/fe-common/core/fe-exec.c @@ -530,12 +530,17 @@ static void cmd_exec(const char *data, SERVER_REC *server, WI_ITEM_REC *item) static void sig_pidwait(void *pid, void *statusp) { PROCESS_REC *rec; + char *str; int status = GPOINTER_TO_INT(statusp); rec = process_find_pid(GPOINTER_TO_INT(pid)); if (rec == NULL) return; - /* process exited */ + /* process exited - print the last line if + there wasn't a newline at end. */ + if (line_split("\n", 1, &str, &rec->databuf) > 0 && *str != '\0') + signal_emit_id(signal_exec_input, 2, rec, str); + if (!rec->silent) { if (WIFSIGNALED(status)) { status = WTERMSIG(status); -- cgit v1.2.3