authorgravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-11-18 23:11:06+01:00
committergravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-12-09 21:57:17+01:00
log37b1707370b64c03d00024bffc1aa8f5a14a278b
treec63a2d81f8eecec26cc2ec4960e45549eef89b87
parent45650f7003ba84d7188bace63df7a52265b6561e

DepTokenizer.printUnderstandableChar: consider space printable

This makes the function consider space to be printable as well (because it is) and simplifies that function.

1 files changed, 4 insertions(+), 4 deletions(-)

src/DepTokenizer.zig+4-4
......@@ -866,7 +866,7 @@ test "error target - continuation expecting end-of-line" {
866866 );
867867 try depTokenizer("foo.o: \\ ",
868868 \\target = {foo.o}
869 \\ERROR: illegal char \x20 at position 8: continuation expecting end-of-line
869 \\ERROR: illegal char ' ' at position 8: continuation expecting end-of-line
870870 );
871871 try depTokenizer("foo.o: \\x",
872872 \\target = {foo.o}
......@@ -1053,10 +1053,10 @@ fn printCharValues(out: anytype, bytes: []const u8) !void {
10531053}
10541054
10551055fn printUnderstandableChar(out: anytype, char: u8) !void {
1056 if (!std.ascii.isPrint(char) or char == ' ') {
1057 try out.print("\\x{X:0>2}", .{char});
1056 if (std.ascii.isPrint(char)) {
1057 try out.print("'{c}'", .{char});
10581058 } else {
1059 try out.print("'{c}'", .{printable_char_tab[char]});
1059 try out.print("\\x{X:0>2}", .{char});
10601060 }
10611061}
10621062