From 56a238f49b2c40fe0a6c6325f86ddecd7ec7123b Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Fri, 8 Jun 2012 01:14:22 +0200 Subject: Cut the ending \n from all lines in included (exec)files --- src/configparser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/configparser.cpp') 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)); + } } } -- cgit v1.2.3