-
Notifications
You must be signed in to change notification settings - Fork 784
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,12 +182,19 @@ main(void) | |
last_code_line[char_index] = '\0'; | ||
|
||
if ((strcmp(last_code_line, "quit") == 0) || (strcmp(last_code_line, "exit") == 0)) { | ||
/*:quit the program */ | ||
break; | ||
if (!code_block_open || !parser->sterm){ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
joequery
Author
Contributor
|
||
break; | ||
} | ||
else{ | ||
/* count the quit/exit commands as strings if in a quote block */ | ||
strcat(ruby_code, "\n"); | ||
strcat(ruby_code, last_code_line); | ||
} | ||
} | ||
|
||
else { | ||
if (code_block_open) { | ||
strcat(ruby_code, "\n"); | ||
strcat(ruby_code, "\n"); | ||
strcat(ruby_code, last_code_line); | ||
} | ||
else { | ||
|
parser is used without initialization. It may cause runtime crash.