From a052b8d20f25e69c82104135c9925c17dcaa3eb3 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 5 Sep 2019 22:08:13 +0200 Subject: [PATCH 1/1] strip trailing carriage returns Support CRLF line termination regardless of system record separator, preventing mangled output due to column returns before appended graphs. Besides Windows files, \r is also added by unbuffer -p for some reason. --- graph | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graph b/graph index eaafb76..e76ec64 100755 --- a/graph +++ b/graph @@ -39,7 +39,7 @@ $SIG{INT} = 'IGNORE'; # continue after assumed eof my (@lines, @values); while (readline) { - chomp; + s/\r?\n\z//; s/^\h*// unless $opt{unmodified}; push @values, s/^ ( \h* -? [0-9]* \.? [0-9]+ |)//x && $1; if (defined $opt{trim}) { -- 2.30.0