aboutsummaryrefslogtreecommitdiffstats
path: root/src/lush.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lush.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lush.c b/src/lush.c
index 78e7fb7..31a75d7 100644
--- a/src/lush.c
+++ b/src/lush.c
@@ -934,8 +934,6 @@ char **lush_split_commands(char *line) {
while (isspace((unsigned char)*start))
start++;
- // Check if entering or leaving a quoted string
-
// Check for operators
int op_len = operator_length(start);
if (op_len > 0) {
@@ -1111,6 +1109,15 @@ int lush_execute_chain(lua_State *L, char ***commands, int num_commands) {
commands++;
}
+ if (last_result == 0 && i > 0) {
+ commands--;
+ if (is_operator(commands[0][0]) == OP_OR) {
+ commands += 3;
+ continue;
+ }
+ commands++;
+ }
+
// Handle other operations
if (commands[1] != NULL) {
int op_type = is_operator(commands[1][0]);