Skip to content

Commit

Permalink
cvsexportcommit: chomp only removes trailing whitespace
Browse files Browse the repository at this point in the history
In commit fef3a7c(cvsexportcommit: be graceful when "cvs status"
reorders the arguments), caution was taken to get the status even
for files with leading or trailing whitespace.

However, the author of that commit missed that chomp() removes only
trailing newlines.  With help of the mailing list, the author realized
his mistake and provided this patch.

The idea is that we do not want to rely on a certain layout of the
output of "cvs status".  Therefore we only call it with files that are
unambiguous after stripping leading and trailing whitespace.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed May 15, 2008
1 parent 4b172de commit 57e0e3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-cvsexportcommit.perl
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@
my $basename = basename($name);

$basename = "no file " . $basename if (exists($added{$basename}));
chomp($basename);
$basename =~ s/^\s+//;
$basename =~ s/\s+$//;

if (!exists($fullname{$basename})) {
$fullname{$basename} = $name;
Expand Down

0 comments on commit 57e0e3e

Please sign in to comment.