Fix /exec -o on Windows
This commit is contained in:
parent
d52cc1a1bd
commit
616c669d3b
@ -41,6 +41,10 @@ run_command (char *word[], char *word_eol[], void *userdata)
|
|||||||
time_t start;
|
time_t start;
|
||||||
double timeElapsed;
|
double timeElapsed;
|
||||||
|
|
||||||
|
char *token;
|
||||||
|
char *context = NULL;
|
||||||
|
int announce = 0;
|
||||||
|
|
||||||
HANDLE readPipe;
|
HANDLE readPipe;
|
||||||
HANDLE writePipe;
|
HANDLE writePipe;
|
||||||
STARTUPINFO sInfo;
|
STARTUPINFO sInfo;
|
||||||
@ -59,9 +63,8 @@ run_command (char *word[], char *word_eol[], void *userdata)
|
|||||||
|
|
||||||
if (!stricmp("-O", word[2]))
|
if (!stricmp("-O", word[2]))
|
||||||
{
|
{
|
||||||
/*strcat (commandLine, word_eol[3]);*/
|
strcat (commandLine, word_eol[3]);
|
||||||
hexchat_printf (ph, "Printing Exec output to others is not supported yet.\n");
|
announce = 1;
|
||||||
return HEXCHAT_EAT_HEXCHAT;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -90,7 +93,19 @@ run_command (char *word[], char *word_eol[], void *userdata)
|
|||||||
{
|
{
|
||||||
/* avoid garbage */
|
/* avoid garbage */
|
||||||
buffer[dwRead] = '\0';
|
buffer[dwRead] = '\0';
|
||||||
hexchat_printf (ph, "%s", buffer);
|
|
||||||
|
if (announce)
|
||||||
|
{
|
||||||
|
/* Say each line seperately, TODO: improve... */
|
||||||
|
token = strtok_s (buffer, "\n", &context);
|
||||||
|
while (token != NULL)
|
||||||
|
{
|
||||||
|
hexchat_commandf (ph, "SAY %s", token);
|
||||||
|
token = strtok_s (NULL, "\n", &context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
hexchat_printf (ph, "%s", buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -103,7 +118,8 @@ run_command (char *word[], char *word_eol[], void *userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* display a newline to separate things */
|
/* display a newline to separate things */
|
||||||
hexchat_printf (ph, "\n");
|
if (!announce)
|
||||||
|
hexchat_printf (ph, "\n");
|
||||||
|
|
||||||
if (timeElapsed >= 10)
|
if (timeElapsed >= 10)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user