diff --git a/b2/boom.c b/b2/boom.c index 2cd6df4..afbd3bf 100644 --- a/b2/boom.c +++ b/b2/boom.c @@ -136,6 +136,7 @@ int main(int argc, char **argv) int i; dollar = unique("$"); + subex_init(); for (i = 1; i != argc; i++) { if (*argv[i] != '-') { process(argv[i]); diff --git a/b2/subex.c b/b2/subex.c index b29ae6c..db886f2 100644 --- a/b2/subex.c +++ b/b2/subex.c @@ -235,18 +235,22 @@ static const struct subst *recurse_sub(const struct subst *sub, int substitute(const struct subst *sub, const struct param *in, struct param **out) { - int i; - char tmp[4]; enum subst_type cause = 0; - if (!fn) { - fn = unique("FN"); - for (i = 0; i != FIELDS; i++) { - sprintf(tmp, "F%d", i); - f[i] = unique(tmp); - } - } *out = NULL; return recurse_sub(sub, in, NULL, NULL, NULL, NULL, out, &cause) != &jump_ignore; } + + +void subex_init(void) +{ + int i; + char tmp[4]; + + fn = unique("FN"); + for (i = 0; i != FIELDS; i++) { + sprintf(tmp, "F%d", i); + f[i] = unique(tmp); + } +} diff --git a/b2/subex.h b/b2/subex.h index a664ae0..4fcfa27 100644 --- a/b2/subex.h +++ b/b2/subex.h @@ -20,4 +20,6 @@ int substitute(const struct subst *sub, const struct param *in, struct param **out); +void subex_init(void); + #endif /* !SUBEX_H */