Skip to content

Commit 0db61ec

Browse files
authored
Add support for Windows < 2000 registry (.reg) files (#766)
1 parent 7d2ddcf commit 0db61ec

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

core.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,15 @@ export class FileTypeParser {
12981298
}
12991299
}
13001300

1301+
// -- 10-byte signatures --
1302+
1303+
if (this.checkString('REGEDIT4\r\n')) {
1304+
return {
1305+
ext: 'reg',
1306+
mime: 'application/x-ms-regedit',
1307+
};
1308+
}
1309+
13011310
// -- 12-byte signatures --
13021311

13031312
// RIFF file format which might be AVI, WAV, QCP, etc

fixture/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
fixture-win2000.reg binary
2+
fixture-win95.reg text eol=crlf

fixture/fixture-win95.reg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
REGEDIT4
2+
3+
[HKEY_CURRENT_USER\Software\Test]
4+
"TestVal"="Succeeded"

test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ const names = {
285285
],
286286
reg: [
287287
'fixture-win2000',
288+
'fixture-win95',
288289
],
289290
};
290291

0 commit comments

Comments
 (0)