diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-10-02 17:37:19 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-10-02 19:19:30 +0200 |
commit | 96aafdf30e6557e5fdf3e80c7dee4e1dab73e898 (patch) | |
tree | 167e1b4c2cea9eceb1f383412fea65594874f729 /main.c | |
parent | 74a73e2c41ed9661e32a26fe1460a1b8a68961e7 (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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |