Cut the ending \n from all lines in included (exec)files

This commit is contained in:
attilamolnar 2012-06-08 01:14:22 +02:00
parent 3af9c3f895
commit 56a238f49b

View File

@ -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));
}
}
}