summaryrefslogtreecommitdiff
path: root/src/fe-common/core/fe-exec.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-02-06 18:03:58 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-02-06 18:03:58 +0000
commit3a2b45559f25bb7390ec1260dba9085b6856382f (patch)
treea10c11658be67ed13f09531ca32feed96644a033 /src/fe-common/core/fe-exec.c
parentf2c78cf482860030104722b390568cf15dfb38c8 (diff)
downloadirssi-3a2b45559f25bb7390ec1260dba9085b6856382f.zip
/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
Diffstat (limited to 'src/fe-common/core/fe-exec.c')
-rw-r--r--src/fe-common/core/fe-exec.c7
1 files changed, 6 insertions, 1 deletions
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);