diff options
Diffstat (limited to 'src/lexgrog_test.c')
-rw-r--r-- | src/lexgrog_test.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/lexgrog_test.c b/src/lexgrog_test.c index 08c69c84..f5278f3b 100644 --- a/src/lexgrog_test.c +++ b/src/lexgrog_test.c @@ -76,13 +76,15 @@ static const char args_doc[] = N_("FILE..."); static const char doc[] = "\v" N_("The defaults are --man and --whatis."); static struct argp_option options[] = { - { "debug", 'd', 0, 0, N_("emit debugging messages") }, - { "man", 'm', 0, 0, N_("parse as man page"), 1 }, - { "cat", 'c', 0, 0, N_("parse as cat page") }, - { "whatis", 'w', 0, 0, N_("show whatis information"), 2 }, - { "filters", 'f', 0, 0, N_("show guessed series of preprocessing filters") }, - { "encoding", 'E', N_("ENCODING"), 0, N_("use selected output encoding"), 3 }, - { 0, 'h', 0, OPTION_HIDDEN, 0 }, /* compatibility for --help */ + OPT ("debug", 'd', 0, N_("emit debugging messages")), + OPT ("man", 'm', 0, N_("parse as man page"), 1), + OPT ("cat", 'c', 0, N_("parse as cat page")), + OPT ("whatis", 'w', 0, N_("show whatis information"), 2), + OPT ("filters", 'f', 0, + N_("show guessed series of preprocessing filters")), + OPT ("encoding", 'E', N_("ENCODING"), + N_("use selected output encoding"), 3), + OPT_HELP_COMPAT, { 0 } }; @@ -181,7 +183,7 @@ int main (int argc, char **argv) for (i = 0; i < num_files; ++i) { lexgrog lg; - const char *file; + const char *file = NULL; bool found = false; lg.type = type; @@ -191,6 +193,7 @@ int main (int argc, char **argv) else { char *path, *pathend; struct stat statbuf; + const struct ult_value *ult; path = xstrdup (files[i]); pathend = strrchr (path, '/'); @@ -208,8 +211,10 @@ int main (int argc, char **argv) path = NULL; } - file = ult_src (files[i], path ? path : ".", - &statbuf, SO_LINK, NULL); + ult = ult_src (files[i], path ? path : ".", + &statbuf, SO_LINK); + if (ult) + file = ult->path; free (path); } |