Commit ec6c63f
DIR: don't display invalid data with devices
When doing `DIR NUL` findfirst will actually return success
with an attribute indicating a device exists with that name.
MS-DOS shows 'File not found' in this case, but FreeCOM
(and also Comcom64) can display invalid data, so let's
correct that. Since the required constant FA_DEVICE isn't
always present in `dos.h`, let's define it when necessary.
[#181]
Before (C: is MFS, D: is FAT16):
~~~
C:\>dir nul
Volume in drive C is IR DXXXXS C
Directory of C:\
NUL 0 10-30-25 6:55p
1 file(s) 0 bytes
0 dir(s) 49,839 Mega bytes free
C:\>d:
D:\>dir nul
Volume in drive D has no label
Volume Serial Number is 4A09-DBB4
Directory of D:\
NUL 0 10-30-25 6:55p
1 file(s) 0 bytes
0 dir(s) 42,698,752 bytes free
~~~
With patch (C: is MFS, D: is FAT16):
~~~
C:\>dir nul
Volume in drive C is IR DXXXXS C
Directory of C:\
File not found.
C:\>d:
D:\>dir nul
Volume in drive D has no label
Volume Serial Number is 4A09-DBB4
Directory of D:\
File not found.
~~~1 parent 29b197f commit ec6c63f
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| |||
1106 | 1109 | | |
1107 | 1110 | | |
1108 | 1111 | | |
1109 | | - | |
| 1112 | + | |
1110 | 1113 | | |
1111 | 1114 | | |
1112 | 1115 | | |
| |||
0 commit comments