File tree 3 files changed +21
-3
lines changed
3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -512,12 +512,12 @@ static REBREQ *Req_SIO;
512
512
513
513
/***********************************************************************
514
514
**
515
- */ REBFLG Echo_File (REBCHR * file )
515
+ */ REBINT Echo_File (REBCHR * file )
516
516
/*
517
517
***********************************************************************/
518
518
{
519
519
Req_SIO -> file .path = file ;
520
- return ( DR_ERROR != OS_DO_DEVICE (Req_SIO , RDC_CREATE ) );
520
+ return OS_DO_DEVICE (Req_SIO , RDC_CREATE );
521
521
}
522
522
523
523
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ static REBSER *Read_All_File(char *fname)
82
82
{
83
83
REBVAL * val = D_ARG (1 );
84
84
REBSER * ser = 0 ;
85
+ REBINT err ;
85
86
86
87
Echo_File (0 );
87
88
@@ -91,7 +92,11 @@ static REBSER *Read_All_File(char *fname)
91
92
ser = To_Local_Path ("output.txt" , 10 , FALSE, TRUE);
92
93
93
94
if (ser ) {
94
- if (!Echo_File ((REBCHR * )(ser -> data ))) Trap1 (RE_CANNOT_OPEN , val );
95
+ err = Echo_File ((REBCHR * )(ser -> data ));
96
+ if (err != DR_DONE ) {
97
+ SET_INTEGER (D_RET , - err );
98
+ Trap2 (RE_CANNOT_OPEN , val , D_RET );
99
+ }
95
100
}
96
101
97
102
return R_RET ;
Original file line number Diff line number Diff line change @@ -130,4 +130,17 @@ secure [%/ allow]
130
130
131
131
===end-group===
132
132
133
+
134
+ ===start-group=== "ECHO"
135
+ --test-- "echo test"
136
+ echo %echo-result print 1 echo none
137
+ --assert "1^/ " = read /string %echo-result
138
+
139
+ --test-- "echo failed"
140
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/834
141
+ --assert all [error? e: try [echo %not-existing-dir/foo ] e/id = 'cannot-open]
142
+ ===end-group===
143
+
144
+ echo %/r/sss/xxxx
145
+
133
146
~~~end-file~~~
You can’t perform that action at this time.
0 commit comments