summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-12-07 15:26:15 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-12-07 15:26:15 +0200
commit3e00ff05bbf4370f6a17dbc9f58fc588301005a6 (patch)
treed8c44adc42def8a269715afab6661d92d9d2ba03
parent90472c8c7475837545b827dc7f6c9d273633621e (diff)
MimeHooks: Check if the hook program was started
IssueID #89
-rw-r--r--src/mimehooks.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mimehooks.c b/src/mimehooks.c
index fd535643..8f1eb9db 100644
--- a/src/mimehooks.c
+++ b/src/mimehooks.c
@@ -46,13 +46,15 @@ iBlock *run_FilterHook_(const iFilterHook *d, const iString *mime, const iBlock
46 } 46 }
47 setArguments_Process(proc, args); 47 setArguments_Process(proc, args);
48 iRelease(args); 48 iRelease(args);
49 start_Process(proc); 49 iBlock *output = NULL;
50 writeInput_Process(proc, body); 50 if (start_Process(proc)) {
51 iBlock *output = readOutputUntilClosed_Process(proc); 51 writeInput_Process(proc, body);
52 if (!startsWith_Rangecc(range_Block(output), "20")) { 52 output = readOutputUntilClosed_Process(proc);
53 /* Didn't produce valid output. */ 53 if (!startsWith_Rangecc(range_Block(output), "20")) {
54 delete_Block(output); 54 /* Didn't produce valid output. */
55 output = NULL; 55 delete_Block(output);
56 output = NULL;
57 }
56 } 58 }
57 iRelease(proc); 59 iRelease(proc);
58 return output; 60 return output;