mruby-pack/pack.c (read_tmpl): direct return from skipping directives

We used to read counts after spaces, for example `pack("j 4")` read `4`
as counts after a space.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-07-24 07:53:12 +09:00
parent a5a13ad35f
commit 1535e031df
+2 -3
View File
@@ -1440,9 +1440,8 @@ read_tmpl(mrb_state *mrb, struct tmpl *tmpl, enum pack_type *typep, int *sizep,
mrb_value s = mrb_str_new(mrb, &c, 1);
mrb_raisef(mrb, E_ARGUMENT_ERROR, "unknown unpack directive %!v", s);
}
dir = PACK_DIR_SKIP;
type = PACK_TYPE_NONE;
break;
*typep = PACK_TYPE_NONE;
return PACK_DIR_SKIP;
}
/* read suffix [0-9*_!<>] */