From ce7a393172adf13ad1e990e970c1acac896dea7f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 13 Aug 2013 19:47:55 +0000 Subject: - rtrim returned back into langpack reader; - trailing spaces must be set using \s git-svn-id: http://svn.miranda-ng.org/main/trunk@5674 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/langpack.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp index ca69a9d811..c3644f8a28 100644 --- a/src/mir_core/langpack.cpp +++ b/src/mir_core/langpack.cpp @@ -79,6 +79,7 @@ static int ConvertBackslashes(char *str, UINT fileCp) case 'n': *pstr = '\n'; break; case 't': *pstr = '\t'; break; case 'r': *pstr = '\r'; break; + case 's': *pstr = ' '; break; default: *pstr = pstr[1]; break; } memmove(pstr+1, pstr+2, strlen(pstr+2) + 1); @@ -213,9 +214,7 @@ 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; + rtrim(line); if (line[0] == '#') { strlwr(line); @@ -259,8 +258,9 @@ static void LoadLangPackFile(FILE *fp, char *line, UINT fileCp) continue; } - cbLen -= ConvertBackslashes(line, fileCp); + ConvertBackslashes(line, fileCp); + size_t cbLen = strlen(line)-1; if (line[0] == '[' && line[cbLen] == ']') { if (langPack.entryCount && langPack.entry[ langPack.entryCount-1].wszLocal == NULL) langPack.entryCount--; -- cgit v1.2.3