1
0
mirror of https://gitlab.com/klmp200/fish.git synced 2024-11-25 02:24:21 +00:00

Vrai opérateur ET et implémentation du reverse ET

This commit is contained in:
Antoine Bartuccio 2017-05-18 02:09:44 +02:00
parent 2ea166e43d
commit 7eada756e5
3 changed files with 11 additions and 2 deletions

View File

@ -55,7 +55,7 @@ int fishHelp(WordArray *args) {
}
int fishExit(WordArray *args) {
freeWordArray(args);
args->size = args->size;
return EXIT_SIGNAL;
}

View File

@ -171,6 +171,12 @@ int fishExecute(WordList *list) {
if (splited != NULL) freeWordList(splited);
}
break;
case REVERSE_AND:
if (signal) signal = fishExecute(splited);
else {
if (splited != NULL) freeWordList(splited);
}
break;
case OR:
signal = fishExecute(splited);
break;
@ -194,11 +200,13 @@ int loadRightCommand(WordArray *array){
WordList * parseWordList(WordList *list, shell_operator *an_operator) {
char *op_str[] = {
(char*) ";",
(char*) "||",
(char*) "&&"
};
shell_operator op[] = {
OR,
REVERSE_AND,
AND
};
WordList *newList = NULL;

View File

@ -14,7 +14,8 @@ typedef enum {
PIPE,
BACKGROUND_PROCESS,
AND,
OR
OR,
REVERSE_AND
} shell_operator ;
typedef struct {