main: clean up variable printer now that we have pkg_tuple_parse

pull/15/head
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 static void
print_variable(pkg_t *pkg, void *unused) print_variable(pkg_t *pkg, void *unused)
{ {
const char *variable_tmpl; const char *var;
(void) unused; (void) unused;
variable_tmpl = pkg_tuple_find(pkg->vars, want_variable); var = pkg_tuple_find(pkg->vars, want_variable);
if (variable_tmpl != NULL) if (var != NULL)
{ {
char *var = pkg_tuple_parse(pkg->vars, variable_tmpl);
printf("%s", var); printf("%s", var);
free(var);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
} }