mirror of
https://gitlab.com/klmp200/fish.git
synced 2024-11-22 00:33:20 +00:00
Merge branch 'sli' into 'master'
Vrai opérateur ET et implémentation du reverse ET See merge request !6
This commit is contained in:
commit
24d7e29fdd
@ -55,7 +55,7 @@ int fishHelp(WordArray *args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int fishExit(WordArray *args) {
|
int fishExit(WordArray *args) {
|
||||||
freeWordArray(args);
|
args->size = args->size;
|
||||||
return EXIT_SIGNAL;
|
return EXIT_SIGNAL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -171,6 +171,12 @@ int fishExecute(WordList *list) {
|
|||||||
if (splited != NULL) freeWordList(splited);
|
if (splited != NULL) freeWordList(splited);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case REVERSE_AND:
|
||||||
|
if (signal) signal = fishExecute(splited);
|
||||||
|
else {
|
||||||
|
if (splited != NULL) freeWordList(splited);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case OR:
|
case OR:
|
||||||
signal = fishExecute(splited);
|
signal = fishExecute(splited);
|
||||||
break;
|
break;
|
||||||
@ -194,11 +200,13 @@ int loadRightCommand(WordArray *array){
|
|||||||
|
|
||||||
WordList * parseWordList(WordList *list, shell_operator *an_operator) {
|
WordList * parseWordList(WordList *list, shell_operator *an_operator) {
|
||||||
char *op_str[] = {
|
char *op_str[] = {
|
||||||
|
(char*) ";",
|
||||||
(char*) "||",
|
(char*) "||",
|
||||||
(char*) "&&"
|
(char*) "&&"
|
||||||
};
|
};
|
||||||
shell_operator op[] = {
|
shell_operator op[] = {
|
||||||
OR,
|
OR,
|
||||||
|
REVERSE_AND,
|
||||||
AND
|
AND
|
||||||
};
|
};
|
||||||
WordList *newList = NULL;
|
WordList *newList = NULL;
|
||||||
|
@ -14,7 +14,8 @@ typedef enum {
|
|||||||
PIPE,
|
PIPE,
|
||||||
BACKGROUND_PROCESS,
|
BACKGROUND_PROCESS,
|
||||||
AND,
|
AND,
|
||||||
OR
|
OR,
|
||||||
|
REVERSE_AND
|
||||||
} shell_operator ;
|
} shell_operator ;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user