|
@@ -216,12 +216,22 @@ int run(CommandTab ct){
|
|
|
int tube[ct.length][2];
|
|
|
int tubepos = 0;
|
|
|
int infd = -1, outfd = -1, errfd = -1;
|
|
|
- boolean bpipe = false;
|
|
|
+ boolean bpipe = false, nextpipe = false;
|
|
|
//Parcours les commandes
|
|
|
for(int i = 0; i < ct.length; i++){
|
|
|
c = ct.cmd[i];
|
|
|
printf("Cmd : %s\n", c->name);
|
|
|
+ //Si pipe avant
|
|
|
+ if(nextpipe){
|
|
|
+ //Si fin chaine pipe
|
|
|
+ if(c->next != SHELL_PIPE){
|
|
|
+ nextpipe = false;
|
|
|
+ }
|
|
|
+ //Passe la commande
|
|
|
+ continue;
|
|
|
+ }
|
|
|
//Si pipe creation d'un fichier commun
|
|
|
+ nextpipe = c->next == SHELL_PIPE ;
|
|
|
if(c->next == SHELL_PIPE && c->output == STDOUT){
|
|
|
bpipe = true;
|
|
|
//Creation tube
|