Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
last modification of the tesh2 files (variable extend and some corrections)
[simgrid.git] / tools / tesh2 / src / context.c
index 22a44fc..877ffc2 100644 (file)
@@ -34,6 +34,10 @@ context_new(void)
        context->signal = INDEFINITE_SIGNAL;\r
        context->output_handling = oh_check;\r
        context->async = 0;\r
+\r
+       #ifdef WIN32\r
+       context->t_command_line = NULL;\r
+       #endif\r
        \r
        return context;\r
 }\r
@@ -56,6 +60,11 @@ context_free(context_t* ptr)
        if((*ptr)->signal)\r
                free((*ptr)->signal);\r
 \r
+       #ifdef WIN32\r
+       if((*ptr)->t_command_line)\r
+               free((*ptr)->t_command_line);\r
+       #endif\r
+\r
        *ptr = NULL;\r
        \r
        return 0;\r
@@ -73,6 +82,14 @@ context_reset(context_t context)
                context->command_line = NULL;\r
        }\r
 \r
+       #ifdef WIN32\r
+       if(context->t_command_line)\r
+       {\r
+               free(context->t_command_line);\r
+               context->t_command_line = NULL;\r
+       }\r
+       #endif\r
+\r
        if(context->pos)\r
        {\r
                free(context->pos);\r
@@ -111,6 +128,12 @@ context_dup(context_t context)
        dup->line = context->line;\r
        dup->pos = strdup(context->pos);\r
        dup->command_line = strdup(context->command_line);\r
+\r
+       \r
+       #ifdef WIN32\r
+       dup->t_command_line = strdup(context->t_command_line);\r
+       #endif\r
+\r
        dup->exit_code = context->exit_code;\r
        dup->timeout = context->timeout;\r
        dup->output = NULL;\r
@@ -158,6 +181,14 @@ context_clear(context_t context)
                context->command_line = NULL;\r
        }\r
 \r
+       #ifdef WIN32\r
+       if(context->t_command_line)\r
+       {\r
+               free(context->t_command_line);\r
+               context->t_command_line = NULL;\r
+       }\r
+       #endif\r
+\r
        if(context->pos)\r
        {\r
                free(context->pos);\r