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");