mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-02 01:18:08 +01:00
Merge pull request #387 from Googulator/swap-support
Support swap files in qemu or bare-metal mode
This commit is contained in:
commit
e44748cce1
4 changed files with 45 additions and 4 deletions
|
|
@ -214,11 +214,12 @@ Token *logic(Token *tok, char **val) {
|
|||
/* logic = "("
|
||||
* (name |
|
||||
* (name "==" value) |
|
||||
* (name "!=" value) |
|
||||
* (logic "||" logic) |
|
||||
* (logic "&&" logic))
|
||||
* ")"
|
||||
*/
|
||||
|
||||
|
||||
char *lhs = tok->val;
|
||||
char *rhs;
|
||||
tok = tok->next;
|
||||
|
|
@ -235,8 +236,17 @@ Token *logic(Token *tok, char **val) {
|
|||
} else {
|
||||
lhs = "False";
|
||||
}
|
||||
} else {
|
||||
fputs("Expected == after ", stderr);
|
||||
} else if (strcmp(tok->val, "!=") == 0) {
|
||||
/* Case for inequality. */
|
||||
rhs = tok->next->val;
|
||||
tok = tok->next->next;
|
||||
if (strcmp(get_var(lhs), rhs) == 0) {
|
||||
lhs = "False";
|
||||
} else {
|
||||
lhs = "True";
|
||||
}
|
||||
} else {
|
||||
fputs("Expected == or != after ", stderr);
|
||||
fputs(lhs, stderr);
|
||||
fputs(" in logic\n", stderr);
|
||||
exit(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue