Support for line-end comments

This commit is contained in:
HanzZ 2011-10-26 23:56:50 +02:00
parent 624662e428
commit af39c58f68
3 changed files with 11 additions and 3 deletions

View file

@ -76,6 +76,13 @@ static std::string KEYFILE_STRING(const std::string &cat, const std::string &key
}
std::string ret(str);
free(str);
if (ret.find("#") != std::string::npos) {
ret = ret.substr(0, ret.find("#"));
while(*(ret.end() - 1) == ' ') {
ret.erase(ret.end() - 1);
}
}
return ret;
}

View file

@ -4,7 +4,8 @@ password = secret
server = 127.0.0.1
port = 5222
server_mode = 1
backend_host=localhost # < this option doesn't work yet
backend_host=localhost
# < this option doesn't work yet
backend_port=10001
admin_username=admin
admin_password=test
@ -25,7 +26,7 @@ protocol=any
[logging]
#config=logging.cfg # log4cxx/log4j logging configuration file
#backend_config=backend_logging.cfg # log4cxx/log4j logging configuration file for backends
#backend_config=/home/hanzz/code/libtransport/spectrum/src/backend-logging.cfg # log4cxx/log4j logging configuration file for backends
[database]
type = none # or "none" without database backend

View file

@ -65,7 +65,7 @@ type=xmpp
config = /etc/spectrum2/logging.cfg
# log4cxx/log4j logging configuration file in ini format used for backends.
backend_config = /etc/spectrum2/backend_logging.cfg # log4cxx/log4j logging configuration file for backends
backend_config = /etc/spectrum2/backend-logging.cfg # log4cxx/log4j logging configuration file for backends
[database]
# Database backend type