Skip to content

Commit ee9b2a5

Browse files
committed
FIX: using read with a wildcard path without any result was throwing an error on macOS instead of an empty block
1 parent bd8b6f0 commit ee9b2a5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/core/p-dir.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
///OS_FREE(dir.file.path);
206206

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

src/os/host-device.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,9 @@ static int Poll_Default(REBDEV *dev)
349349
else if (result < 0) {
350350
result = req->error;
351351
// make sure that we are consistent and error is always negative...
352-
if (result > 0) result = -result;
352+
if (result > 0) {
353+
req->error = result = -result;
354+
}
353355
}
354356

355357
return result;

0 commit comments

Comments
 (0)