From 9c39baecebec23ec8285f5b80c277388d0154a2c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 14 Dec 2013 19:13:28 +0000 Subject: 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 --- src/modules/database/dbini.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src') 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': -- cgit v1.2.3