You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2022/08/10 12:21:07 UTC

[couchdb-config] branch remove-leading-trailing-ws-in-config-values created (now f4e17c3)

This is an automated email from the ASF dual-hosted git repository.

ronny pushed a change to branch remove-leading-trailing-ws-in-config-values
in repository https://gitbox.apache.org/repos/asf/couchdb-config.git


      at f4e17c3  Remove leading/trailing whitespaces in config values

This branch includes the following new commits:

     new f4e17c3  Remove leading/trailing whitespaces in config values

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb-config] 01/01: Remove leading/trailing whitespaces in config values

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ronny pushed a commit to branch remove-leading-trailing-ws-in-config-values
in repository https://gitbox.apache.org/repos/asf/couchdb-config.git

commit f4e17c3b070382fa2358d9e736d34bed890f66a4
Author: Ronny Berndt <ro...@apache.org>
AuthorDate: Wed Aug 10 14:09:00 2022 +0200

    Remove leading/trailing whitespaces in config values
---
 src/config.erl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/config.erl b/src/config.erl
index b87ff34..be23650 100644
--- a/src/config.erl
+++ b/src/config.erl
@@ -437,8 +437,9 @@ parse_ini_file(IniFile) ->
                         ets:delete(?MODULE, {AccSectionName, ValueName}),
                         {AccSectionName, AccValues};
                     [LineValue | _Rest] ->
+                        LineValueWithoutLeadTrailWS = re:replace(LineValue, "^\\s*|\\s*$", "", [global, {return, list}]),
                         {AccSectionName,
-                            [{{AccSectionName, ValueName}, LineValue} | AccValues]}
+                            [{{AccSectionName, ValueName}, LineValueWithoutLeadTrailWS} | AccValues]}
                     end
                 end
             end