From 220038f62aabe0e0dcaa3e0454971233f2961c3d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 25 Mar 2014 11:50:11 +0000 Subject: langpack's description fix: the Authors field could be specified multiple times git-svn-id: http://svn.miranda-ng.org/main/trunk@8736 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/langpack.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp index de8b22aa19..507eb06dc7 100644 --- a/src/mir_core/langpack.cpp +++ b/src/mir_core/langpack.cpp @@ -301,6 +301,7 @@ static void LoadLangPackFile(FILE *fp, char *line, UINT fileCp) static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &startOfLine, UINT &fileCp) { char szLanguage[64]; szLanguage[0] = 0; + CMStringA szAuthors; fgets(line, LANGPACK_BUF_SIZE, fp); size_t lineLen = strlen(line); @@ -333,7 +334,11 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start *pszColon++ = 0; if (!lstrcmpA(line, "Language")) { mir_snprintf(szLanguage, sizeof(szLanguage), "%s", pszColon); lrtrim(szLanguage); } else if (!lstrcmpA(line, "Last-Modified-Using")) { mir_snprintf(lpinfo.szLastModifiedUsing, sizeof(lpinfo.szLastModifiedUsing), "%s", pszColon); lrtrim(lpinfo.szLastModifiedUsing); } - else if (!lstrcmpA(line, "Authors")) { mir_snprintf(lpinfo.szAuthors, sizeof(lpinfo.szAuthors), "%s", pszColon); lrtrim(lpinfo.szAuthors); } + else if (!lstrcmpA(line, "Authors")) { + if (!szAuthors.IsEmpty()) + szAuthors.AppendChar(' '); + szAuthors.Append(lrtrim(pszColon)); + } else if (!lstrcmpA(line, "Author-email")) { mir_snprintf(lpinfo.szAuthorEmail, sizeof(lpinfo.szAuthorEmail), "%s", pszColon); lrtrim(lpinfo.szAuthorEmail); } else if (!lstrcmpA(line, "Locale")) { char szBuf[20], *stopped; @@ -349,6 +354,8 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start } } + strncpy_s(lpinfo.szAuthors, SIZEOF(lpinfo.szAuthors), szAuthors, _TRUNCATE); + MultiByteToWideChar(lpinfo.codepage, 0, szLanguage, -1, lpinfo.tszLanguage, SIZEOF(lpinfo.tszLanguage)); if (!lpinfo.tszLanguage[0] && (lpinfo.Locale == 0) || !GetLocaleInfo(lpinfo.Locale, LOCALE_SENGLANGUAGE, lpinfo.tszLanguage, sizeof(lpinfo.tszLanguage))) { -- cgit v1.2.3