diff options
Diffstat (limited to 'a8cat.c')
-rw-r--r-- | a8cat.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -94,6 +94,8 @@ int a8revcat(const char *file) { while( (c = fgetwc(input)) != WEOF ) { if(c == 0x1b) { inv = handle_escape_seq(inv, input, file, line); + } else if(c == '\r') { + continue; /* swallow carriage returns */ } else if(c == '\n') { putchar(0x9b); line++; @@ -254,6 +256,9 @@ int main(int argc, char **argv) { } if(reverse) { + if(isatty(fileno(stdout))) + die("Refusing to write ATASCII to a terminal."); + if(underline || textmode || stripinv || magazine) { die("-t, -u, -m, -s options don't make sense with -r.\n"); } |