summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/cmp-textfiles
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-04-12 17:53:35 +0000
committerKarl Berry <karl@freefriends.org>2010-04-12 17:53:35 +0000
commit3c9a16ff3118ad66e11960603bbc9aa169e224cf (patch)
tree8ed2c1e70082f0330a25a9edf68f9dc2f7c06943 /Master/tlpkg/bin/cmp-textfiles
parent9bba61abada38fe60f2b94985b8774db5dffd012 (diff)
ignore trailing newlines in comparison
git-svn-id: svn://tug.org/texlive/trunk@17824 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/cmp-textfiles')
-rwxr-xr-xMaster/tlpkg/bin/cmp-textfiles6
1 files changed, 6 insertions, 0 deletions
diff --git a/Master/tlpkg/bin/cmp-textfiles b/Master/tlpkg/bin/cmp-textfiles
index 439fa1c0f28..bfa347a7138 100755
--- a/Master/tlpkg/bin/cmp-textfiles
+++ b/Master/tlpkg/bin/cmp-textfiles
@@ -19,6 +19,8 @@ END_USAGE
my $file1 = &read_file ($ARGV[0]);
my $file2 = &read_file ($ARGV[1]);
+ warn "($ARGV[0])\n$file1!!!\n";
+ warn "($ARGV[1])\n$file2===\n";
return $file1 eq $file2 ? 0 : 1;
}
@@ -41,5 +43,9 @@ sub read_file
}
close (FILE) || warn "close($fname) failed: $!";
+ # if the file did not have a trailing newline, add one for purposes of
+ # comparison, since it can slip in if we edit it, etc.
+ $ret .= "\n" if substr ($ret, -1) ne "\n";
+
return $ret;
}