Skip to content

Commit 25d4e85

Browse files
committed
CHANGE: don't throw an error when used wait with a negative timeout value
resolves: Oldes/Rebol-issues#2597
1 parent ea437a6 commit 25d4e85

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/core/n-io.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static REBSER *Read_All_File(char *fname)
372372
case REB_TIME:
373373
timeout = (REBINT) (VAL_TIME(val) / (SEC_SEC / 1000));
374374
chk_neg:
375-
if (timeout < 0) Trap_Range(val);
375+
if (timeout < 0) timeout = 0; //Trap_Range(val);
376376
break;
377377

378378
case REB_PORT:

src/tests/units/evaluation-test.r3

+3-4
Original file line numberDiff line numberDiff line change
@@ -1097,10 +1097,9 @@ Rebol [
10971097
===start-group=== "WAIT"
10981098
--test-- "wait -1"
10991099
;@@ https://github.com/Oldes/Rebol-issues/issues/342
1100-
--assert all [
1101-
error? err: try [wait -1]
1102-
err/id = 'out-of-range
1103-
]
1100+
;@@ https://github.com/Oldes/Rebol-issues/issues/2597
1101+
--assert none? try [wait -1]
1102+
--assert none? try [wait -1:0:0]
11041103

11051104
===end-group===
11061105

0 commit comments

Comments
 (0)