diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-24 08:25:17 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-24 08:25:17 +0000 |
commit | 06888467f39971b9534bc2969afb14f3d38231f1 (patch) | |
tree | 81ecfb5e4cac4e883401ccda241d3c0397b39b8e /src | |
parent | bdb90bbd656fb1621485ed7f3218df1fe3e4e76d (diff) |
fix for broken includes
git-svn-id: http://svn.miranda-ng.org/main/trunk@8727 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_core/langpack.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp index 009185407a..cb1d7a01e0 100644 --- a/src/mir_core/langpack.cpp +++ b/src/mir_core/langpack.cpp @@ -214,27 +214,30 @@ static void LoadLangPackFile(FILE *fp, char *line, UINT fileCp) if (!memcmp(line + 1, "include", 7)) {
TCHAR tszFileName[MAX_PATH];
- TCHAR* fileName = mir_a2t(ltrim(line + 9));
- mir_sntprintf(tszFileName, SIZEOF(tszFileName), _T("%s%s"), langPack.tszFullPath, fileName);
- mir_free(fileName);
-
- FILE *p = _tfopen(tszFileName, _T("r"));
- if (p) {
+ TCHAR *p = _tcsrchr(langPack.tszFullPath, '\\');
+ if (p)
+ p[1] = 0;
+ mir_sntprintf(tszFileName, SIZEOF(tszFileName), _T("%s\\%S"), langPack.tszFullPath, ltrim(line + 9));
+ if (p)
+ p[1] = '\\';
+
+ FILE *fp = _tfopen(tszFileName, _T("r"));
+ if (fp) {
line[0] = 0;
- fgets(line, LANGPACK_BUF_SIZE, p);
+ fgets(line, LANGPACK_BUF_SIZE, fp);
UINT fileCp = CP_ACP;
if (strlen(line) >= 3 && line[0] == '\xef' && line[1] == '\xbb' && line[2] == '\xbf') {
fileCp = CP_UTF8;
- fseek(p, 3, SEEK_SET);
+ fseek(fp, 3, SEEK_SET);
}
else {
fileCp = langPack.codepage;
- fseek(p, 0, SEEK_SET);
+ fseek(fp, 0, SEEK_SET);
}
- LoadLangPackFile(p, line, fileCp);
- fclose(p);
+ LoadLangPackFile(fp, line, fileCp);
+ fclose(fp);
}
}
else if (!memcmp(line + 1, "muuid", 5)) {
|