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