From 4605b90ff1e0de5b12e04647cd5dacd9848a9a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 23 Oct 2020 02:12:30 +0200 Subject: release 1.2.1 --- src/tt.input.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/tt.input.c') diff --git a/src/tt.input.c b/src/tt.input.c index 1f88f7d..b601e68 100644 --- a/src/tt.input.c +++ b/src/tt.input.c @@ -82,10 +82,18 @@ int i; int b; int c; -// On every iteration, tt checks whether the read character is a newline. If -// not, the character is added to the line variable, which is re-allocated if -// necessary. The line_l, keeping track of the line's length, is incremented -// as well: -> main.input +// First of all, tt ignores any carriage returns: -> main.input + + if (c == '\r') continue; + +// On Windows, where carriage returns are used, they will automatically be +// removed anyway. On systems that don't use carriage returns, they might not +// be stripped from the input, which is why tt ignores them. + +// Otherwise, on every iteration, tt checks whether the read character is a +// newline. If not, the character is added to the line variable, which is +// re-allocated if necessary. The line_l, keeping track of the line's length, +// is incremented as well: -> main.input if (c != '\n') { if (line_l + 1 > line_s) { -- cgit v1.2.3