commit a7954e8cabafb78027381f1e256337d3a650225d
Author: Hiltjo Posthuma <hil...@codemadness.org>
Date:   Tue Apr 1 15:13:30 2014 +0200

    cmp: fix line numbers
    
    test case:
        printf 'a

a' > t1
        printf 'a
a' > t2
        cmp t1 t2
    
    Signed-off-by: Hiltjo Posthuma <hil...@codemadness.org>

diff --git a/cmp.c b/cmp.c
index d1cd0ff..fa88cc9 100644
--- a/cmp.c
+++ b/cmp.c
@@ -52,6 +52,7 @@ main(int argc, char *argv[])
                b[1] = getc(fp[1]);
                if(b[0] == EOF && b[1] == EOF)
                        break;
+               if(b[0] == '
' && b[1] == '
')
                        line++;
                if(b[0] == b[1])
                        continue;


Reply via email to