File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -289,11 +289,19 @@ static int32_t open_file(
289
289
const char * includer = "" ;
290
290
if (file != & parser -> first )
291
291
includer = parser -> file -> path ;
292
- if ((code = resolve_path (includer , file -> name , & file -> path )))
292
+ if (strcmp (file -> name , "-" ) == 0 ) {
293
+ if (!(file -> path = strdup (file -> name )))
294
+ return ZONE_OUT_OF_MEMORY ;
295
+ } else if ((code = resolve_path (includer , file -> name , & file -> path )))
293
296
return (void )close_file (parser , file ), code ;
294
297
295
- if ((file -> handle = fopen (file -> path , "rb" )))
298
+ if (strcmp (file -> path , "-" ) == 0 ) {
299
+ file -> handle = stdin ;
296
300
return 0 ;
301
+ } else {
302
+ if ((file -> handle = fopen (file -> path , "rb" )))
303
+ return 0 ;
304
+ }
297
305
298
306
switch (errno ) {
299
307
case ENOMEM :
You can’t perform that action at this time.
0 commit comments