summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Borowitz <dborowitz@google.com>2012-03-23 14:38:06 -0700
committerDave Borowitz <dborowitz@google.com>2012-03-23 14:38:06 -0700
commite0531ace35b9c8eca9ded0a7b1540de3c49dbde6 (patch)
treeb90682221940dbe7c8317af378925aba70898138
parent9dd6e6cd297ae9c0d912ecfa07a148a29e6f4eee (diff)
downloadjgit-e0531ace35b9c8eca9ded0a7b1540de3c49dbde6.tar.gz
jgit-e0531ace35b9c8eca9ded0a7b1540de3c49dbde6.zip
Properly parse first line in ReceivePack with no '\0'
Change-Id: Ic98e17aff4e4b3c3fa0359082bab689e4522e3d7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
index 81c44ae322..126d74fc37 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
@@ -115,8 +115,9 @@ public class ReceivePack {
if (nul >= 0) {
for (String c : line.substring(nul + 1).split(" "))
caps.add(c);
- }
- this.line = line.substring(0, nul);
+ this.line = line.substring(0, nul);
+ } else
+ this.line = line;
this.capabilities = Collections.unmodifiableSet(caps);
}