Buna ziua,<br><br>Am reusit sa trec peste problemele mentionate anterior, totusi acum imi da eroare testul 9, desi codul care se ocupa de eroare este urmatorul :<br>Ce pot sa fac ca sa trec cu bine si testul 9 ?<br><br>Va multumesc,<br>
Alexandru.<br><br><pre> if (pid == 0)<br> {<br> if (scmd == NULL || scmd->verb == NULL)<br> exit(0);<br> <br> if (scmd->params == NULL)<br> {<br> int tmp = execlp((scmd->verb)->string, (scmd->verb)->string, (char *) NULL);<br>
if (tmp < 0)<br> printf("Execution failed for '%s'\n", (scmd->verb)->string); <br> exit(tmp);<br> }        <br> else<br> {<br>
char *argv[32];<br> int i;<br> for (i = 0; i < 32; i++)<br> argv[i] = malloc(sizeof(char));<br> argv[0] = (scmd->verb)->string;<br> i = 1;<br>
word_t *p = scmd->params;<br> while (p != NULL)<br> {<br> if (p->expand == true)<br> p->string = getenv(p->string);<br> argv[i] = p->string;<br>
i++;<br> p = p->next_word;<br> }<br> argv[i] = (char *) NULL;<br> <br> /* execlp((scmd->verb)->string, (scmd->verb)->string, (scmd->params)->string, (char *) NULL); */<br>
int tmp = execvp((scmd->verb)->string, argv);<br> if (tmp < 0)<br> printf("Execution failed for '%s'\n", (scmd->verb)->string);<br> exit(tmp);<br>
}<br> }<br></pre><br>