Skip to content

Commit

Permalink
Changed initialization position of local variable idx
Browse files Browse the repository at this point in the history
  • Loading branch information
jinroq committed Jan 12, 2024
1 parent 396e946 commit 502a536
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -9487,8 +9487,8 @@ parser_set_encode(struct parser_params *p, const char *name)
case 'f': case 'F': wrong = "filesystem"; break;
case 'l': case 'L': wrong = "locale"; break;
}
if (wrong && STRCASECMP(name, wrong) == 0) goto unknown;
int idx = rb_enc_find_index(name);
if (wrong && STRCASECMP(name, wrong) == 0) goto unknown;
if (idx < 0) {
unknown:
excargs[1] = rb_sprintf("unknown encoding name: %s", name);
Expand Down

0 comments on commit 502a536

Please sign in to comment.