summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
authorCremno <[email protected]>2013-02-18 11:40:53 +0100
committerCremno <[email protected]>2013-02-18 11:40:53 +0100
commit2942ad8eeb10291caaa83852d1b426a06ed84d20 (patch)
tree4a4957efad2af283e81fc513dceceeafab38524c /src/parse.y
parente4bebad82d0e4b5c98d767d3606d7f2f3edce0ab (diff)
downloadmruby-2942ad8eeb10291caaa83852d1b426a06ed84d20.tar.gz
mruby-2942ad8eeb10291caaa83852d1b426a06ed84d20.zip
vars must be declared at the start of a block
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parse.y b/src/parse.y
index 9af8682c1..4355c2222 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -3447,8 +3447,9 @@ parse_string(parser_state *p, int term)
if (p->regexp) {
int f = 0;
int c;
- char* s;
- s = strndup(tok(p), toklen(p));
+ char *s = strndup(tok(p), toklen(p));
+ char flag[4] = { '\0' };
+
newtok(p);
while (c = nextc(p), ISALPHA(c)) {
switch (c) {
@@ -3467,7 +3468,6 @@ parse_string(parser_state *p, int term)
toklen(p) > 1 ? "s" : "", tok(p));
yyerror(p, msg);
}
- char flag[4] = {0};
if (f & 1) strcat(flag, "i");
if (f & 2) strcat(flag, "x");
if (f & 4) strcat(flag, "m");