aboutsummaryrefslogtreecommitdiff
path: root/a8cat.c
diff options
context:
space:
mode:
Diffstat (limited to 'a8cat.c')
-rw-r--r--a8cat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/a8cat.c b/a8cat.c
index e4a88bb..76ec67a 100644
--- a/a8cat.c
+++ b/a8cat.c
@@ -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");
}