author | Eric Wong <normalperson@yhbt.net> | |
Sat, 10 Jun 2006 06:27:01 +0000 (23:27 -0700) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 16 Jun 2006 10:04:19 +0000 (03:04 -0700) | ||
commit | 4a393f2b53f0997f79d47793d4c774fa0072887c | |
tree | ab843830869fea41829fec96a6e1d1505b229203 | tree | snapshot |
parent | 8a97e368882afbc2bdc030214339bed54ed6545c | commit | diff |
git-svn: eol_cp corner-case fixes
If we read the maximum size of our buffer into $buf, and the
last character is '\015', there's a chance that the character is
'\012', which means our regex won't work correctly. At the
worst case, this could introduce an extra newline into the code.
We'll now read an extra character if we see '\015' is the last
character in $buf.
We also forgot to recalculate the length of $buf after doing the
newline substitution, causing some files to appeare truncated.
We'll do that now and force byte semantics in length() for good
measure.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
If we read the maximum size of our buffer into $buf, and the
last character is '\015', there's a chance that the character is
'\012', which means our regex won't work correctly. At the
worst case, this could introduce an extra newline into the code.
We'll now read an extra character if we see '\015' is the last
character in $buf.
We also forgot to recalculate the length of $buf after doing the
newline substitution, causing some files to appeare truncated.
We'll do that now and force byte semantics in length() for good
measure.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
contrib/git-svn/git-svn.perl | diff | blob | history |