diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2012-03-13 13:42:34 +0100 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2012-03-13 13:42:34 +0100 |
commit | 2039a62b897e0d884b91989311f2681f4dd1ef06 (patch) | |
tree | 719b82ad5bff513a3a8bf347df953b0c94b4d500 /sonar-server/src/main/webapp/WEB-INF | |
parent | 85508f6331a917a3ea34b638023adf4fbcf5ebe2 (diff) | |
download | sonarqube-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.rb | 4 |
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) |