summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-03-22 07:49:30 -0400
committerJames Moger <james.moger@gitblit.com>2012-03-22 07:49:30 -0400
commitc2833a3fd84e8a7f1361cb3c5c03652dead5b337 (patch)
tree3f4e7d884fbaf954177d636fb5fdd60f3cd77d63
parent4be52863f9ec6bfbfec12fdc1aa3cefa867a1945 (diff)
downloadgitblit-c2833a3fd84e8a7f1361cb3c5c03652dead5b337.tar.gz
gitblit-c2833a3fd84e8a7f1361cb3c5c03652dead5b337.zip
Ensure that the line counts start at 1
-rw-r--r--src/com/gitblit/LuceneExecutor.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/gitblit/LuceneExecutor.java b/src/com/gitblit/LuceneExecutor.java
index b6df254a..7b6a879f 100644
--- a/src/com/gitblit/LuceneExecutor.java
+++ b/src/com/gitblit/LuceneExecutor.java
@@ -1172,7 +1172,7 @@ public class LuceneExecutor implements Runnable {
if (SearchObjectType.blob == result.type) {
// count lines as offset into the content for this fragment
- int line = StringUtils.countLines(content.substring(0, pos));
+ int line = Math.max(1, StringUtils.countLines(content.substring(0, pos)));
// create fragment tag with line number and language
String lang = "";