diff options
-rw-r--r-- | src/mimehooks.c | 16 |
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; |