5
5
#include "../strbuf.h"
6
6
#include "../run-command.h"
7
7
#include "../cache.h"
8
- #include "../string-list.h"
9
8
10
9
static const int delay [] = { 0 , 1 , 10 , 20 , 40 };
11
10
unsigned int _CRT_fmode = _O_BINARY ;
@@ -406,60 +405,12 @@ int mingw_fgetc(FILE *stream)
406
405
return ch ;
407
406
}
408
407
409
- static struct string_list_item dos_device_names_items [] = {
410
- { "AUX" , NULL },
411
- { "CLOCK$" , NULL },
412
- { "COM1" , NULL },
413
- { "COM2" , NULL },
414
- { "COM3" , NULL },
415
- { "COM4" , NULL },
416
- { "CON" , NULL },
417
- { "CONERR$" , NULL },
418
- { "CONIN$" , NULL },
419
- { "CONOUT$" , NULL },
420
- { "LPT1" , NULL },
421
- { "LPT2" , NULL },
422
- { "LPT3" , NULL },
423
- { "NUL" , NULL },
424
- { "PRN" , NULL },
425
- { "aux" , NULL },
426
- { "clock$" , NULL },
427
- { "com1" , NULL },
428
- { "com2" , NULL },
429
- { "com3" , NULL },
430
- { "com4" , NULL },
431
- { "con" , NULL },
432
- { "conerr$" , NULL },
433
- { "conin$" , NULL },
434
- { "conout$" , NULL },
435
- { "lpt1" , NULL },
436
- { "lpt2" , NULL },
437
- { "lpt3" , NULL },
438
- { "nul" , NULL },
439
- { "prn" , NULL }
440
- };
441
-
442
- static struct string_list dos_device_names = {
443
- & dos_device_names_items [0 ], ARRAY_SIZE (dos_device_names_items ),
444
- 0 , 0 , NULL
445
- };
446
-
447
- static int is_dos_device_name (const char * filename )
448
- {
449
- return filename && !strchr (filename , '/' ) &&
450
- string_list_has_string (& dos_device_names , filename );
451
- }
452
-
453
408
#undef fopen
454
409
FILE * mingw_fopen (const char * filename , const char * otype )
455
410
{
456
411
int hide = 0 ;
457
412
FILE * file ;
458
413
wchar_t wfilename [MAX_PATH ], wotype [4 ];
459
-
460
- if (is_dos_device_name (filename ))
461
- return fopen (filename , otype );
462
-
463
414
if (hide_dotfiles == HIDE_DOTFILES_TRUE &&
464
415
basename ((char * )filename )[0 ] == '.' )
465
416
hide = access (filename , F_OK );
@@ -474,16 +425,11 @@ FILE *mingw_fopen (const char *filename, const char *otype)
474
425
return file ;
475
426
}
476
427
477
- #undef freopen
478
428
FILE * mingw_freopen (const char * filename , const char * otype , FILE * stream )
479
429
{
480
430
int hide = 0 ;
481
431
FILE * file ;
482
432
wchar_t wfilename [MAX_PATH ], wotype [4 ];
483
-
484
- if (is_dos_device_name (filename ))
485
- return freopen (filename , otype , stream );
486
-
487
433
if (hide_dotfiles == HIDE_DOTFILES_TRUE &&
488
434
basename ((char * )filename )[0 ] == '.' )
489
435
hide = access (filename , F_OK );
0 commit comments