X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Flexer%2Fvariable-parser.c;h=5c19b81e2f5bd8c477f80742464416b8a58f8fb2;hb=4ace3e978177b9f189ac8ebf8e852d5001dabcf5;hp=c1e1c28cdf404441cd701edd1ef62fdbaee2d6a8;hpb=48ec61d954cc032c773daf96851cf3b78f27b112;p=pspp diff --git a/src/language/lexer/variable-parser.c b/src/language/lexer/variable-parser.c index c1e1c28cdf..5c19b81e2f 100644 --- a/src/language/lexer/variable-parser.c +++ b/src/language/lexer/variable-parser.c @@ -893,8 +893,8 @@ lex_match_variable (struct lexer *lexer, const struct dictionary *dict, const st } /* An interaction is a variable followed by {*, BY} followed by an interaction */ -bool -parse_design_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iact) +static bool +parse_internal_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iact, struct interaction **it) { const struct variable *v = NULL; assert (iact); @@ -915,7 +915,8 @@ parse_design_interaction (struct lexer *lexer, const struct dictionary *dict, st if (! lex_match_variable (lexer, dict, &v)) { - interaction_destroy (*iact); + if (it) + interaction_destroy (*it); *iact = NULL; return false; } @@ -929,9 +930,15 @@ parse_design_interaction (struct lexer *lexer, const struct dictionary *dict, st if ( lex_match (lexer, T_ASTERISK) || lex_match (lexer, T_BY)) { - return parse_design_interaction (lexer, dict, iact); + return parse_internal_interaction (lexer, dict, iact, iact); } return true; } +bool +parse_design_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iact) +{ + return parse_internal_interaction (lexer, dict, iact, NULL); +} +