summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_config_writer.erl
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2009-08-17 02:35:39 +0000
committerPaul Joseph Davis <davisp@apache.org>2009-08-17 02:35:39 +0000
commit7831f34f62acd867111831b01792bb8bbdee7c55 (patch)
tree1d8647c11dd54a3ed0d287417542f6602313a76a /src/couchdb/couch_config_writer.erl
parentfa8c448e2b1843d1f3a3c405c6d4540a04ec5318 (diff)
Fixed a re:run/3 call in couch_config_writer.erl
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@804828 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_config_writer.erl')
-rw-r--r--src/couchdb/couch_config_writer.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/couchdb/couch_config_writer.erl b/src/couchdb/couch_config_writer.erl
index cb855ea8..08d4a5f5 100644
--- a/src/couchdb/couch_config_writer.erl
+++ b/src/couchdb/couch_config_writer.erl
@@ -136,11 +136,11 @@ append_var_to_section({{Section, Option}, Value}, Line, OldCurrentSection, DoneO
%% @doc Tries to match a line against a pattern specifying a ini module or
%% section ("[Section]"). Returns OldSection if no match is found.
parse_module(Line, OldSection) ->
- case re:run(Line, "^\\[([a-zA-Z0-9\_-]*)\\]$", [{capture, global}]) of
+ case re:run(Line, "^\\[([a-zA-Z0-9\_-]*)\\]$", [{capture, first}]) of
nomatch ->
OldSection;
- {match, [_, {Start, Length}]} ->
- string:substr(Line, Start, Length)
+ {match, [{Start, Length}]} ->
+ string:substr(Line, Start+1, Length-1)
end.
%% @spec parse_variable(Line::string(), Option::string(), Value::string()) ->