main: print_variable(): use strdup_parse().

feature/tap-sh
William Pitcock 2012-05-05 21:52:18 +00:00
parent 8ff4ae5b16
commit 542e4e6f89
1 changed files with 10 additions and 4 deletions

14
main.c
View File

@ -164,12 +164,18 @@ 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)
{ {
char *variable; const char *variable_tmpl;
(void) unused; (void) unused;
variable = tuple_find(pkg->vars, want_variable); variable_tmpl = tuple_find(pkg->vars, want_variable);
if (variable != NULL) if (variable_tmpl != NULL)
printf("%s ", variable); {
char *var = strdup_parse(pkg, variable_tmpl);
printf("%s ", var);
free(var);
}
} }
static void static void