From c4890d157abcc4e03a2be02a3f65baa6e1c09631 Mon Sep 17 00:00:00 2001 From: deepend Date: Wed, 25 Feb 2026 01:38:06 -0700 Subject: [PATCH] =?UTF-8?q?Cleaned=20up=20redundant=20inline=20comments=20?= =?UTF-8?q?in=20the=20exec=20plugin=E2=80=99s=20command=20execution=20path?= =?UTF-8?q?=20(pipe=20creation,=20buffer=20termination,=20per-line=20annou?= =?UTF-8?q?nce=20handling,=20sleep=20loop,=20and=20trailing=20newline=20ou?= =?UTF-8?q?tput)=20without=20changing=20behavior.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/exec/exec.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/exec/exec.c b/plugins/exec/exec.c index 205a02fc..47c5c0e4 100644 --- a/plugins/exec/exec.c +++ b/plugins/exec/exec.c @@ -71,7 +71,7 @@ run_command (char *word[], char *word_eol[], void *userdata) strcat (commandLine, word_eol[2]); } - CreatePipe (&readPipe, &writePipe, &secattr, 0); /* might be replaced with MyCreatePipeEx */ + CreatePipe (&readPipe, &writePipe, &secattr, 0); ZeroMemory (&sInfo, sizeof (sInfo)); ZeroMemory (&pInfo, sizeof (pInfo)); @@ -91,12 +91,10 @@ run_command (char *word[], char *word_eol[], void *userdata) { if (ReadFile (readPipe, buffer, sizeof (buffer) - 1, &dwRead, NULL) && dwRead != 0 ) { - /* avoid garbage */ buffer[dwRead] = '\0'; if (announce) { - /* Say each line seperately, TODO: improve... */ token = strtok_s (buffer, "\n", &context); while (token != NULL) { @@ -110,13 +108,11 @@ run_command (char *word[], char *word_eol[], void *userdata) } else { - /* this way we'll more likely get full lines */ SleepEx (100, TRUE); } timeElapsed = difftime (time (0), start); } - /* display a newline to separate things */ if (!announce) zoitechat_printf (ph, "\n");