aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2012-03-13 13:42:34 +0100
committerFabrice Bellingard <bellingard@gmail.com>2012-03-13 13:42:34 +0100
commit2039a62b897e0d884b91989311f2681f4dd1ef06 (patch)
tree719b82ad5bff513a3a8bf347df953b0c94b4d500 /sonar-server/src/main/webapp/WEB-INF
parent85508f6331a917a3ea34b638023adf4fbcf5ebe2 (diff)
downloadsonarqube-2039a62b897e0d884b91989311f2681f4dd1ef06.tar.gz
sonarqube-2039a62b897e0d884b91989311f2681f4dd1ef06.zip
SONAR-3003 Remove only the last empty line, not all
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb
index 2a39920d0ca..5be6419a9d2 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb
@@ -50,7 +50,9 @@ class Api::Utils
# - http://jira.codehaus.org/browse/SONAR-2282 first modified the behaviour to keep the trailing lines
# - then http://jira.codehaus.org/browse/SONAR-3003 reverted this modification to remove potential last empty line
def self.split_newlines(input)
- input.split(/\r?\n|\r/)
+ input.split(/\r?\n|\r/, -1)
+ input.pop if input.last==''
+ input
end
def self.convert_string_to_unix_newlines(input)