diff options
author | George Hazan <george.hazan@gmail.com> | 2013-12-14 19:13:28 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-12-14 19:13:28 +0000 |
commit | 9c39baecebec23ec8285f5b80c277388d0154a2c (patch) | |
tree | 581f7b5ad185c0391c4d576f2ea403aa4e29d5ca | |
parent | 1fbf4db0f46d0b7d7651f6fc8a19274558384c01 (diff) |
m/M - memo values in utf8 were added to ini files
memo lasts until the first char in line is space/tab/crlf or empty
note: this first char gets eaten, it's not added to a memo
git-svn-id: http://svn.miranda-ng.org/main/trunk@7217 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | src/modules/database/dbini.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp index a99b88a1a5..d10e98131d 100644 --- a/src/modules/database/dbini.cpp +++ b/src/modules/database/dbini.cpp @@ -228,7 +228,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf char szLine[2048];
if (fgets(szLine, sizeof(szLine), fp) == NULL)
break;
-
+LBL_NewLine:
int lineLength = lstrlenA(szLine);
while (lineLength && (BYTE)(szLine[lineLength-1]) <= ' ')
szLine[--lineLength] = '\0';
@@ -357,6 +357,26 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf case 'U':
db_set_utf(NULL, szSection, szName, szValue+1);
break;
+ case 'm':
+ case 'M':
+ {
+ CMStringA memo(szValue+1);
+ memo.Append("\r\n");
+ while (fgets(szLine, sizeof(szLine), fp) != NULL) {
+ switch (szLine[0]) {
+ case 0: case '\r': case '\n': case ' ': case '\t':
+ break;
+ default:
+ db_set_utf(NULL, szSection, szName, memo);
+ goto LBL_NewLine;
+ }
+
+ memo.Append(rtrim(szLine+1));
+ memo.Append("\r\n");
+ }
+ db_set_utf(NULL, szSection, szName, memo);
+ }
+ break;
case 'n':
case 'h':
case 'N':
|