diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-25 11:50:11 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-25 11:50:11 +0000 |
commit | 220038f62aabe0e0dcaa3e0454971233f2961c3d (patch) | |
tree | 54cfc87b09a1eea81715dbe14f6f3869c6e473d6 /src/mir_core | |
parent | babe6ed8614a597d6d248a9f20587018d7579936 (diff) |
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
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/langpack.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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))) {
|