From 85221b542f438dc85faad7a6afcddd67d5984e6e Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Sat, 30 Aug 2008 20:50:03 +0000 Subject: - Remove dependency on test/local.ini - Write out new variables in key = value format - Fix tests git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@690584 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_config_writer.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/couchdb/couch_config_writer.erl b/src/couchdb/couch_config_writer.erl index 561fd6c2..e9438e2c 100644 --- a/src/couchdb/couch_config_writer.erl +++ b/src/couchdb/couch_config_writer.erl @@ -108,7 +108,7 @@ save_loop(_Config, [], _OldModule, NewFileContents, _DoneVariable) -> NewFileContents. append_new_ini_section({{ModuleName, Variable}, Value}, OldFileContents) -> - OldFileContents ++ "\n\n" ++ ModuleName ++ "\n" ++ Variable ++ "=" ++ Value ++ "\n". + OldFileContents ++ "\n\n" ++ ModuleName ++ "\n" ++ Variable ++ " = " ++ Value ++ "\n". %% @spec parse_module(Lins::string(), OldModule::string()) -> string() %% @doc Tries to match a line against a pattern specifying a ini module or @@ -130,14 +130,14 @@ parse_module(Line, OldModule) -> %% Variable is not found. Returns a new line composed of the Variable and %% Value otherwise. parse_variable(Line, Variable, Value) -> - case regexp:match(Line, "^" ++ Variable ++ "=") of + case regexp:match(Line, "^" ++ Variable ++ "\s?=") of nomatch -> nomatch; {error, Error}-> io:format("ini file regex error variable: '~s'~n", [Error]), nomatch; {match, _Start, _Length} -> - Variable ++ "=" ++ Value + Variable ++ " = " ++ Value end. %% @spec save_file(File::filename(), Contents::string()) -> -- cgit v1.2.3