summaryrefslogtreecommitdiffhomepage
path: root/main.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-02 17:37:19 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-02 19:19:30 +0200
commit96aafdf30e6557e5fdf3e80c7dee4e1dab73e898 (patch)
tree167e1b4c2cea9eceb1f383412fea65594874f729 /main.c
parent74a73e2c41ed9661e32a26fe1460a1b8a68961e7 (diff)
main: track current template filename during execution
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
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;