Skip to content

Commit 1e16aa4

Browse files
killerswanerickt
authored andcommitted
---
yaml --- r: 32279 b: refs/heads/dist-snap c: 4fb675b h: refs/heads/master i: 32277: ec2edb3 32275: 8ab9b3c 32271: 2a8cc86 v: v3
1 parent e1a2eab commit 1e16aa4

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 272c5ab0e9573e6e85a1d576a3c95b5213cf5c61
10+
refs/heads/dist-snap: 4fb675be2f42a828fb5a6570b9aad2c65f4598b9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/libstd/json.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,17 +428,25 @@ impl Parser {
428428
while i < 4u {
429429
match self.next_char() {
430430
'0' to '9' => {
431-
n = n * 10u +
432-
(self.ch as uint) - ('0' as uint);
433-
}
434-
_ => return self.error(~"invalid \\u escape")
431+
n = n * 16u + (self.ch as uint)
432+
- ('0' as uint);
433+
},
434+
'a' | 'A' => n = n * 16u + 10u,
435+
'b' | 'B' => n = n * 16u + 11u,
436+
'c' | 'C' => n = n * 16u + 12u,
437+
'd' | 'D' => n = n * 16u + 13u,
438+
'e' | 'E' => n = n * 16u + 14u,
439+
'f' | 'F' => n = n * 16u + 15u,
440+
_ => return self.error(
441+
~"invalid \\u escape (unrecognized hex)")
435442
}
436443
i += 1u;
437444
}
438445

439446
// Error out if we didn't parse 4 digits.
440447
if i != 4u {
441-
return self.error(~"invalid \\u escape");
448+
return self.error(
449+
~"invalid \\u escape (not four digits)");
442450
}
443451

444452
str::push_char(res, n as char);

0 commit comments

Comments
 (0)