The following:
if is regular for xxx
print found.
else
print did not find.
Fails when "xxx" does not exist.
It should not fail but should instead trigger the "else" condition.
In this case, if the file does not exist and "fail exit" is setup, the program exists as failure.
This is bad behavior.
I then tried to work around the problem with the following:
if exists xxx
and is regular for xxx
print found.
else
print did not find.
This did not work as expected because the "and" condition is executing when it should not be.
This commit focuses resolving this second case.
The problem is that there is an incorrect test for "and" and "or" types at the start of the process function.
I also noticed that the "is" check has the wrong words in the error message (should be "get type of" rather than "get mode of").
The primary problem requires more in-depth changes that I will not get to tonight and is not intended to be solved within this commit.
if (state_process->block) {
if (state_process->block == fake_state_process_block_if_e) {
- if (!(state_process->operation == fake_make_operation_type_and_e || state_process->operation == fake_make_operation_type_or_e)) {
- if (state_process->block_result == fake_condition_result_false_e) {
- return 0;
- }
+ if (state_process->block_result == fake_condition_result_false_e) {
+ return 0;
}
}
else if (state_process->block == fake_state_process_block_if_skip_e) {
if (F_status_is_error(status)) {
state_process->condition_result = fake_condition_result_error_e;
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_read", F_true, arguments.array[i].string, "get mode of", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_read", F_true, arguments.array[i].string, "get type of", fll_error_file_type_file_e);
break;
}