mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Ignore empty lines in HEX files
They are free-form enough that empty lines should probably be supported.
This commit is contained in:
@@ -401,6 +401,10 @@ static void parseHEXFile(std::filebuf &file) {
|
|||||||
if (!readLine(file, line)) {
|
if (!readLine(file, line)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// Ignore empty lines.
|
||||||
|
if (line.length() == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (line.length() != 6
|
if (line.length() != 6
|
||||||
|| line.find_first_not_of("0123456789ABCDEFabcdef"sv) != std::string::npos) {
|
|| line.find_first_not_of("0123456789ABCDEFabcdef"sv) != std::string::npos) {
|
||||||
|
|||||||
1
test/gfx/empty_lines.flags
Normal file
1
test/gfx/empty_lines.flags
Normal file
@@ -0,0 +1 @@
|
|||||||
|
-c hex:empty_lines.hex
|
||||||
7
test/gfx/empty_lines.hex
Normal file
7
test/gfx/empty_lines.hex
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
5721d9
|
||||||
|
|
||||||
|
a9d4fe
|
||||||
|
|
||||||
|
|
||||||
|
ffffff
|
||||||
BIN
test/gfx/empty_lines.png
Normal file
BIN
test/gfx/empty_lines.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 712 B |
Reference in New Issue
Block a user