|
@@ -160,6 +160,12 @@ int main(int argc, char* argv[]) {
|
|
|
addserror("Erreur lors du parse de la ligne");
|
|
|
continue;
|
|
|
}
|
|
|
+ //Si aucune commande on passe
|
|
|
+ printf("%d\n", ct.length);
|
|
|
+ if(ct.length == 0){
|
|
|
+ clean_command(&ct);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
//Parse les commandes
|
|
|
result = parse_all_command(&ct);
|
|
|
if(result == SHELL_FAIL){
|
|
@@ -181,7 +187,7 @@ int main(int argc, char* argv[]) {
|
|
|
|
|
|
int run(CommandTab ct){
|
|
|
pid_t pid;
|
|
|
- int result;
|
|
|
+ int result = 0;
|
|
|
//Si en fond creation d'un fork pour executer les commandes
|
|
|
printf("bck : %d\n", ct.bck);
|
|
|
if(ct.bck && false/*ToDo - Test plus tard*/){
|
|
@@ -225,7 +231,7 @@ int run(CommandTab ct){
|
|
|
if(is_internal_cmd(c->name)){
|
|
|
result = launch_internal_command(c);
|
|
|
} else if(is_executable_file(c->name)){
|
|
|
-
|
|
|
+ result = exec_file(c->name, c->argv);
|
|
|
} else {
|
|
|
result = exec_shell(c->name, c->argv);
|
|
|
}
|
|
@@ -235,5 +241,8 @@ int run(CommandTab ct){
|
|
|
//Agit en fonction de la jointure avec la prochaine commande
|
|
|
/*ToDo*/
|
|
|
}
|
|
|
+ if(result != EXIT_SUCCESS){
|
|
|
+ return SHELL_FAIL;
|
|
|
+ }
|
|
|
return SHELL_OK;
|
|
|
}
|