From 7831f34f62acd867111831b01792bb8bbdee7c55 Mon Sep 17 00:00:00 2001 From: Paul Joseph Davis Date: Mon, 17 Aug 2009 02:35:39 +0000 Subject: 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 --- src/couchdb/couch_config_writer.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/couchdb/couch_config_writer.erl') 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()) -> -- cgit v1.2.3