File tree 4 files changed +13
-11
lines changed
4 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 106
106
{
107
107
switch (mode ) {
108
108
case SYM_SIZE :
109
- SET_INTEGER (ret , file -> file .size );
109
+ if (file -> file .size == MIN_I64 ) {
110
+ SET_NONE (ret );
111
+ } else {
112
+ SET_INTEGER (ret , file -> file .size );
113
+ }
110
114
break ;
111
115
case SYM_TYPE :
112
116
Init_Word (ret , GET_FLAG (file -> modes , RFM_DIR ) ? SYM_DIR : SYM_FILE );
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ static int Get_File_Info(REBREQ *file)
132
132
133
133
if (S_ISDIR (info .st_mode )) {
134
134
SET_FLAG (file -> modes , RFM_DIR );
135
- file -> file .size = 0 ; // in order to be consistent on all systems
135
+ file -> file .size = MIN_I64 ; // using MIN_I64 to notify, that size should be reported as NONE
136
136
}
137
137
else {
138
138
CLR_FLAG (file -> modes , RFM_DIR );
Original file line number Diff line number Diff line change @@ -408,7 +408,7 @@ static BOOL Seek_File_64(REBREQ *file)
408
408
409
409
if (info .dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) {
410
410
SET_FLAG (file -> modes , RFM_DIR );
411
- file -> file .size = 0 ;
411
+ file -> file .size = MIN_I64 ; // using MIN_I64 to notify, that size should be reported as NONE
412
412
}
413
413
else {
414
414
CLR_FLAG (file -> modes , RFM_DIR );
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ Rebol [
43
43
--assert 'dir = query /mode %. 'type
44
44
--assert date? query /mode %. 'date
45
45
--assert what-dir = query /mode %. 'name
46
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/2305
47
+ --assert none? query /mode %. 'size
46
48
===end-group===
47
49
48
50
===start-group=== "file port"
@@ -84,6 +86,10 @@ Rebol [
84
86
--assert string? try [read http://google.com ]
85
87
--test-- "read HTTPS"
86
88
--assert string? try [read https://www.google.com ]
89
+ --test-- "exists? url"
90
+ ;@@ https://github.com/Oldes/Rebol3/issues/14
91
+ --assert exists? http://httpbin.org/
92
+ --assert not exists? http://httpbin.org/not-exists
87
93
===end-group===
88
94
89
95
@@ -116,14 +122,6 @@ if "true" <> get-env "CONTINUOUS_INTEGRATION" [
116
122
--assert block? v: query /mode system/ports/input m
117
123
--assert 4 = length? v
118
124
===end-group===
119
-
120
- ===start-group=== "HTTP"
121
- --test-- "exists? url"
122
- ;@@ https://github.com/Oldes/Rebol3/issues/14
123
- --assert exists? http://httpbin.org/
124
- --assert not exists? http://httpbin.org/not-exists
125
-
126
- ===end-group===
127
125
]
128
126
129
127
~~~end-file~~~
You can’t perform that action at this time.
0 commit comments