diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-06 14:27:49 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-06 14:27:49 -0400 |
| commit | 817235cfbc3162e136d53ec5bffe234d4d87c79b (patch) | |
| tree | 19574d92469dd4e4c5e472c979d095f54965b530 | |
| parent | 7b57090564e6f2fe4e2de686f6c76eb0d5744274 (diff) | |
Check for .tm file extension
| -rw-r--r-- | tomo.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -130,6 +130,8 @@ int main(int argc, char *argv[]) Table_t argument_files = {}; for (int i = after_flags; i < argc; i++) { + if (strlen(argv[i]) < 4 || strncmp(argv[i] + strlen(argv[i]) - 3, ".tm", 3) != 0) + errx(1, "Not a valid .tm file: \x1b[31;1m%s\x1b[m", argv[i]); const char *resolved = resolve_path(argv[i], ".", "."); if (!resolved) errx(1, "Couldn't resolve path: %s", argv[i]); Table$str_set(&argument_files, resolved, argv[i]); |
