Skip to content

Commit

Permalink
FIX: using read with a wildcard path without any result was throwin…
Browse files Browse the repository at this point in the history
…g an error on macOS instead of an empty block
  • Loading branch information
Oldes committed Jan 31, 2023
1 parent bd8b6f0 commit ee9b2a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/p-dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
///OS_FREE(dir.file.path);

// don't throw an error if the original path contains wildcard chars * or ?
if (result < 0 && !(dir.error == (REBCNT)-RFE_OPEN_FAIL && WILD_PATH(path)) ) {
if (result < 0 && !(result == (REBCNT)-RFE_OPEN_FAIL && WILD_PATH(path)) ) {
Trap_Port(RE_CANNOT_OPEN, port, dir.error);
}

Expand Down
4 changes: 3 additions & 1 deletion src/os/host-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,9 @@ static int Poll_Default(REBDEV *dev)
else if (result < 0) {
result = req->error;
// make sure that we are consistent and error is always negative...
if (result > 0) result = -result;
if (result > 0) {
req->error = result = -result;
}
}

return result;
Expand Down

0 comments on commit ee9b2a5

Please sign in to comment.