]> source.dussan.org Git - gitblit.git/commitdiff
Fixed minor bug in flatten strings
authorJames Moger <james.moger@gitblit.com>
Fri, 21 Oct 2011 21:35:35 +0000 (17:35 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 21 Oct 2011 21:35:35 +0000 (17:35 -0400)
src/com/gitblit/utils/StringUtils.java

index f4e9256f6c8a5f4117a7e724c7853d3c0a09a428..8adf1e4287b9745410a8e9c925204303e34b99a7 100644 (file)
@@ -142,6 +142,10 @@ public class StringUtils {
                for (String value : values) {\r
                        sb.append(value).append(separator);\r
                }\r
+               if (sb.length() > 0) {\r
+                       // truncate trailing separator\r
+                       sb.setLength(sb.length() - separator.length());\r
+               }\r
                return sb.toString().trim();\r
        }\r
 \r