|
@@ -135,8 +135,6 @@ int get_command(Command* c, char* line){
|
|
|
c->input = STDIN;
|
|
|
c->output = STDOUT;
|
|
|
c->error = STDERR;
|
|
|
- c->erase[0] = false;
|
|
|
- c->erase[1] = false;
|
|
|
//Retour
|
|
|
return length + separator;
|
|
|
}
|
|
@@ -149,6 +147,7 @@ int get_command(Command* c, char* line){
|
|
|
* @return int SHELL_OK si réussite, SHELL_ERR sinon
|
|
|
*/
|
|
|
int set_io(Command* c, char* filename, int redir){
|
|
|
+ printf("Redir : %d\n", redir);
|
|
|
//Declaration variable
|
|
|
int file;
|
|
|
//Si fichier existe et on supprime
|
|
@@ -195,9 +194,6 @@ int set_io(Command* c, char* filename, int redir){
|
|
|
}
|
|
|
}
|
|
|
c->output = file;
|
|
|
- if(redir == SHELLRE_OUT){
|
|
|
- c->erase[STDOUT - 1] = true;
|
|
|
- }
|
|
|
break;
|
|
|
case SHELLR_ERR:
|
|
|
case SHELLRE_ERR:
|
|
@@ -209,9 +205,6 @@ int set_io(Command* c, char* filename, int redir){
|
|
|
}
|
|
|
}
|
|
|
c->error = file;
|
|
|
- if(redir == SHELLRE_ERR){
|
|
|
- c->erase[STDERR - 1] = true;
|
|
|
- }
|
|
|
break;
|
|
|
case SHELLR_ALL:
|
|
|
case SHELLRE_ALL:
|
|
@@ -230,10 +223,6 @@ int set_io(Command* c, char* filename, int redir){
|
|
|
}
|
|
|
c->output = file;
|
|
|
c->error = file;
|
|
|
- if(redir == SHELLRE_ALL){
|
|
|
- c->erase[STDOUT - 1] = true;
|
|
|
- c->erase[STDERR - 1] = true;
|
|
|
- }
|
|
|
break;
|
|
|
default :
|
|
|
serrno = SEREDIRTYPE;
|
|
@@ -291,7 +280,7 @@ int set_redirection(Command* c){
|
|
|
return SHELL_ERR;
|
|
|
}
|
|
|
buffer++;
|
|
|
- redir = SHELLRE_ALL;
|
|
|
+ redir = SHELLR_ALL;
|
|
|
}
|
|
|
//Sinon toujours >>
|
|
|
else {
|