diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-09-11 03:00:30 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-09-11 03:00:30 -0700 |
| commit | 5c047efcb7f92de36df102dd164345d988f64567 (patch) | |
| tree | 7ca48edbb6125421e6d37c0d5c7f204feec259a2 /bpeg.c | |
| parent | d0538fa25ffa60fc3ef17048aa2c46423a1bf036 (diff) | |
Tidying up
Diffstat (limited to 'bpeg.c')
| -rw-r--r-- | bpeg.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -138,13 +138,15 @@ int main(int argc, char *argv[]) input = readfile(STDIN_FILENO); goto run_match; } - for ( ; i < argc; i++) { + for (int nfiles = 0; i < argc; nfiles++, i++) { if (argv[i] == NULL || streq(argv[i], "-")) { input = readfile(STDIN_FILENO); } else { int fd = open(argv[i], O_RDONLY); - check(fd >= 0, "Couldn't open file: %s", argv[2]); + check(fd >= 0, "Couldn't open file: %s", argv[i]); input = readfile(fd); + if (nfiles > 0) printf("\n"); + printf("\033[1;4;33m%s\033[0m\n", argv[i]); } run_match:; |
