summaryrefslogtreecommitdiff
path: root/src/configparser.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-06-08 01:14:22 +0200
committerattilamolnar <attilamolnar@hush.com>2012-06-08 01:14:22 +0200
commit56a238f49b2c40fe0a6c6325f86ddecd7ec7123b (patch)
treed4d15568d290daec336b76a710428e2dfaab52e5 /src/configparser.cpp
parent3af9c3f8950f864bcf9cdd56127cd4014827dece (diff)
Cut the ending \n from all lines in included (exec)files
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r--src/configparser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp
index 51d67b4f5..a8e36f6e0 100644
--- a/src/configparser.cpp
+++ b/src/configparser.cpp
@@ -317,9 +317,13 @@ void ParseStack::DoReadFile(const std::string& key, const std::string& name, int
char linebuf[MAXBUF*10];
while (fgets(linebuf, sizeof(linebuf), file))
{
- int len = strlen(linebuf);
+ size_t len = strlen(linebuf);
if (len)
+ {
+ if (linebuf[len-1] == '\n')
+ len--;
cache.push_back(std::string(linebuf, len));
+ }
}
}