Skip to content

Commit

Permalink
CHANGE: don't throw an error when used wait with a negative timeout…
Browse files Browse the repository at this point in the history
… value

resolves: Oldes/Rebol-issues#2597
  • Loading branch information
Oldes committed Apr 29, 2024
1 parent ea437a6 commit 25d4e85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/n-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static REBSER *Read_All_File(char *fname)
case REB_TIME:
timeout = (REBINT) (VAL_TIME(val) / (SEC_SEC / 1000));
chk_neg:
if (timeout < 0) Trap_Range(val);
if (timeout < 0) timeout = 0; //Trap_Range(val);
break;

case REB_PORT:
Expand Down
7 changes: 3 additions & 4 deletions src/tests/units/evaluation-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -1097,10 +1097,9 @@ Rebol [
===start-group=== "WAIT"
--test-- "wait -1"
;@@ https://github.com/Oldes/Rebol-issues/issues/342
--assert all [
error? err: try [wait -1]
err/id = 'out-of-range
]
;@@ https://github.com/Oldes/Rebol-issues/issues/2597
--assert none? try [wait -1]
--assert none? try [wait -1:0:0]

===end-group===

Expand Down

0 comments on commit 25d4e85

Please sign in to comment.