main: clean up variable printer now that we have pkg_tuple_parse

feature/tap-sh
William Pitcock 2012-05-06 20:13:54 -05:00
parent 30fe1fae39
commit ded3ce7aff
1 changed files with 3 additions and 8 deletions

11
main.c
View File

@ -166,18 +166,13 @@ print_modversion(pkg_t *pkg, void *unused)
static void
print_variable(pkg_t *pkg, void *unused)
{
const char *variable_tmpl;
const char *var;
(void) unused;
variable_tmpl = pkg_tuple_find(pkg->vars, want_variable);
if (variable_tmpl != NULL)
var = pkg_tuple_find(pkg->vars, want_variable);
if (var != NULL)
{
char *var = pkg_tuple_parse(pkg->vars, variable_tmpl);
printf("%s", var);
free(var);
exit(EXIT_SUCCESS);
}
}