From 96aafdf30e6557e5fdf3e80c7dee4e1dab73e898 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 2 Oct 2020 17:37:19 +0200 Subject: main: track current template filename during execution Signed-off-by: Jo-Philipp Wich --- main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index a23a39d..8cb2232 100644 --- a/main.c +++ b/main.c @@ -280,6 +280,9 @@ main(int argc, char **argv) goto out; } + if (strcmp(optarg, "-")) + state->filename = strdup(optarg); + break; case 'd': @@ -349,6 +352,7 @@ main(int argc, char **argv) if (!srcstr && !srcfile && argv[optind] != NULL) { srcfile = read_file(argv[optind]); state->skip_shebang = 1; + state->filename = strdup(argv[optind]); if (!srcfile) { rv = UT_ERROR_EXCEPTION; -- cgit v1.2.3