Commit a31c3502 authored by unknown's avatar unknown

bug fixed parsing with comments on same line

parent c9513074
...@@ -9,13 +9,13 @@ DataDir= CHOOSE_FILESYSTEM ...@@ -9,13 +9,13 @@ DataDir= CHOOSE_FILESYSTEM
MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
[ndbd] [ndbd]
HostName= CHOOSE_HOSTNAME_1 HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
[ndbd] [ndbd]
HostName= CHOOSE_HOSTNAME_2 HostName= CHOOSE_HOSTNAME_2 # hostname is a valid network adress
[ndb_mgmd] [ndb_mgmd]
DataDir= CHOOSE_FILESYSTEM DataDir= CHOOSE_FILESYSTEM #
PortNumber= CHOOSE_PORT_MGM PortNumber= CHOOSE_PORT_MGM
[mysqld] [mysqld]
......
...@@ -228,13 +228,21 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) ...@@ -228,13 +228,21 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line)
Vector<BaseString> tmp_string_split; Vector<BaseString> tmp_string_split;
if (BaseString(line).split(tmp_string_split, if (BaseString(line).split(tmp_string_split,
BaseString("=:"), "=:", 2) != 2)
2) != 2)
{ {
ctx.reportError("Parse error"); ctx.reportError("Parse error");
return false; return false;
} }
// *************************************
// Remove all after #
// *************************************
Vector<BaseString> tmp_string_split2;
tmp_string_split[1].split(tmp_string_split2,
"#", 2);
tmp_string_split[1]=tmp_string_split2[0];
// ************************************* // *************************************
// Remove leading and trailing chars // Remove leading and trailing chars
// ************************************* // *************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment