From 72c641debd5b1799b5be8547e3f30dc23ef69f4e Mon Sep 17 00:00:00 2001 From: George Hazan <george.hazan@gmail.com> Date: Sun, 7 Jul 2013 15:30:01 +0000 Subject: manual rtrim not to touch trailing spaces git-svn-id: http://svn.miranda-ng.org/main/trunk@5260 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/langpack.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp index efaf46a146..9f70065fb1 100644 --- a/src/mir_core/langpack.cpp +++ b/src/mir_core/langpack.cpp @@ -208,8 +208,11 @@ static void LoadLangPackFile(FILE *fp, char *line, UINT fileCp) if (IsEmpty(line) || line[0] == ';' || line[0] == 0) continue; + size_t cbLen = strlen(line)-1; + if (line[cbLen] == '\n') + line[cbLen--] = 0; + if (line[0] == '#') { - rtrim(line); strlwr(line); if ( !memcmp(line+1, "include", 7)) { @@ -253,7 +256,7 @@ static void LoadLangPackFile(FILE *fp, char *line, UINT fileCp) ConvertBackslashes(line, fileCp); - if (line[0] == '[' && line[ lstrlenA(line)-1 ] == ']') { + if (line[0] == '[' && line[cbLen] == ']') { if (langPack.entryCount && langPack.entry[ langPack.entryCount-1].wszLocal == NULL) langPack.entryCount--; -- cgit v1.2.3