summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-12-04 09:31:19 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2012-12-04 09:31:19 -0800
commitc7a2af380fca16db5f44961b221c5b2cfe69a503 (patch)
tree6535e784b2aa29ad66a78b91124f98922855ccc0 /src/parse.y
parent674c55eb7d0a4338d4500516b6a3e9aba56ee61e (diff)
parent2e7953536e94cd140104ffe8ee92727a587515e0 (diff)
downloadmruby-c7a2af380fca16db5f44961b221c5b2cfe69a503.tar.gz
mruby-c7a2af380fca16db5f44961b221c5b2cfe69a503.zip
Merge pull request #587 from iij/pr-string-octal
Fix loss of MSB in conditions of octal formatted string
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parse.y b/src/parse.y
index bfea1f69c..19e6bf23e 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -3307,7 +3307,8 @@ read_escape(parser_state *p)
int buf[3];
int i;
- for (i=0; i<3; i++) {
+ buf[0] = c;
+ for (i=1; i<3; i++) {
buf[i] = nextc(p);
if (buf[i] == -1) goto eof;
if (buf[i] < '0' || '7' < buf[i]) {