From 6e666fcdbbafedb583a13186fefac3fdd2c1a791 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 21 Oct 2011 17:35:35 -0400 Subject: [PATCH] Fixed minor bug in flatten strings --- src/com/gitblit/utils/StringUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java index f4e9256f..8adf1e42 100644 --- a/src/com/gitblit/utils/StringUtils.java +++ b/src/com/gitblit/utils/StringUtils.java @@ -142,6 +142,10 @@ public class StringUtils { for (String value : values) { sb.append(value).append(separator); } + if (sb.length() > 0) { + // truncate trailing separator + sb.setLength(sb.length() - separator.length()); + } return sb.toString().trim(); } -- 2.39.5