diff options
author | Michael Valenta | 2004-04-07 14:47:26 +0000 |
---|---|---|
committer | Michael Valenta | 2004-04-07 14:47:26 +0000 |
commit | 219497b403d9b5ed5dfe3e9f6c062a0a45890d41 (patch) | |
tree | f6dda0e2dcfc0d7552b0d465d14f07add870ffb8 | |
parent | 4bdcf7bdb476a121a4c91eae20564eff89557f83 (diff) | |
download | eclipse.platform.team-219497b403d9b5ed5dfe3e9f6c062a0a45890d41.tar.gz eclipse.platform.team-219497b403d9b5ed5dfe3e9f6c062a0a45890d41.tar.xz eclipse.platform.team-219497b403d9b5ed5dfe3e9f6c062a0a45890d41.zip |
46326: CRLF in CVS commit message
-rw-r--r-- | bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java index 7fd4dfa8d..0c76fdc1c 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java @@ -498,11 +498,21 @@ public class Session { for (;;) { int pos = arg.indexOf('\n', oldPos); if (pos == -1) break; - connection.writeLine(arg.substring(oldPos, pos)); + connection.writeLine(stripTrainingCR(arg.substring(oldPos, pos))); connection.write("Argumentx "); //$NON-NLS-1$ oldPos = pos + 1; } - connection.writeLine(arg.substring(oldPos)); + connection.writeLine(stripTrainingCR(arg.substring(oldPos))); + } + + /* + * Remove any trailing CR from the string + */ + private String stripTrainingCR(String string) { + if (string.endsWith("\r")) { //$NON-NLS-1$ + return string.substring(0, string.length() - 1); + } + return string; } /** |