From 7a0ecb12c29148c2d13d060ca59b21423573adb6 Mon Sep 17 00:00:00 2001 From: Svend Sorensen Date: Tue, 7 Sep 2004 11:04:53 +0000 Subject: [PATCH] If only a disc or track tempate is specified then only disc or track info is printed, respectively. --- tools/cueprint.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/cueprint.c b/tools/cueprint.c index 5d7e301..cd15af2 100644 --- a/tools/cueprint.c +++ b/tools/cueprint.c @@ -17,8 +17,8 @@ #define T_TEMPLATE "%n: %p \"%t\"\n" char *progname; -char *d_template = D_TEMPLATE; /* disc template */ -char *t_template = T_TEMPLATE; /* track template */ +char *d_template = NULL; /* disc template */ +char *t_template = NULL; /* track template */ void usage (int status) { @@ -362,6 +362,18 @@ int main (int argc, char **argv) } } + /* if no disc or track template is set, use the defaults for both */ + if (NULL == d_template && NULL == t_template) { + d_template = D_TEMPLATE; + t_template = T_TEMPLATE; + } else { + if (NULL == d_template) + d_template = ""; + + if (NULL == t_template) + t_template = ""; + } + if (optind == argc) { info("-", format); } else {