| 379 | } |
| 380 | |
| 381 | int kwsysProcess_SetCommand(kwsysProcess* cp, char const* const* command) |
| 382 | { |
| 383 | int i; |
| 384 | if (!cp) { |
| 385 | return 0; |
| 386 | } |
| 387 | for (i = 0; i < cp->NumberOfCommands; ++i) { |
| 388 | char** c = cp->Commands[i]; |
| 389 | while (*c) { |
| 390 | free(*c++); |
| 391 | } |
| 392 | free(cp->Commands[i]); |
| 393 | } |
| 394 | cp->NumberOfCommands = 0; |
| 395 | if (cp->Commands) { |
| 396 | free(cp->Commands); |
| 397 | cp->Commands = 0; |
| 398 | } |
| 399 | if (command) { |
| 400 | return kwsysProcess_AddCommand(cp, command); |
| 401 | } |
| 402 | return 1; |
| 403 | } |
| 404 | |
| 405 | int kwsysProcess_AddCommand(kwsysProcess* cp, char const* const* command) |
| 406 | { |
searching dependent graphs…