Skip to content

Commit e786e1a

Browse files
committed
DepTokenizer.printUnderstandableChar: consider space printable
This makes the function consider space to be printable as well (because it is) and simplifies that function.
1 parent 7f8cce1 commit e786e1a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/DepTokenizer.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

10551055
fn 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

0 commit comments

Comments
 (0)