From 785b7d2b44fcbebabcb759cf06a7c29c592479da Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Wed, 17 Mar 2021 18:23:32 -0400 Subject: [PATCH] Abiword: Reset stdout buffer when starting abiword --- src/node/utils/Abiword.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node/utils/Abiword.js b/src/node/utils/Abiword.js index 79e495415..c7e45e86d 100644 --- a/src/node/utils/Abiword.js +++ b/src/node/utils/Abiword.js @@ -29,10 +29,9 @@ let doConvertTask; // on windows we have to spawn a process for each convertion, // cause the plugin abicommand doesn't exist on this platform if (os.type().indexOf('Windows') > -1) { - let stdoutBuffer = ''; - doConvertTask = (task, callback) => { const abiword = spawn(settings.abiword, [`--to=${task.destFile}`, task.srcFile]); + let stdoutBuffer = ''; abiword.stdout.on('data', (data) => { stdoutBuffer += data.toString(); }); abiword.stderr.on('data', (data) => { stdoutBuffer += data.toString(); }); abiword.on('exit', (code) => {