Permalink
Browse files

fix for leading/trailing space on buffers and quote strings (for INI …

…mode); toolbar button updates for external viewers; eye icon
  • Loading branch information...
1 parent fe2e3f1 commit f39cf4a1b33e45fa478d0061e63039e2d3330acb @alexd committed Feb 21, 2011
Showing with 14 additions and 2 deletions.
  1. BIN eye3.ico
  2. +14 −2 metapad.c
  3. BIN toolbar.bmp
View
BIN eye3.ico
Binary file not shown.
View
@@ -450,6 +450,15 @@ BOOL EncodeWithEscapeSeqs(TCHAR* szText)
szStore[j++] = '\\';
szStore[j++] = 't';
break;
+ case ' ':
+ if (i == 0 || i == lstrlen(szText) - 1) {
+ szStore[j++] = '\\';
+ szStore[j++] = 's';
+ }
+ else {
+ szStore[j++] = ' ';
+ }
+ break;
case '\\':
szStore[j++] = '\\';
szStore[j++] = '\\';
@@ -486,6 +495,9 @@ void ParseForEscapeSeqs(TCHAR* szText)
case 't':
szStore[j] = '\t';
break;
+ case 's':
+ szStore[j] = ' ';
+ break;
default:
szStore[j] = szText[i];
}
@@ -2242,7 +2254,7 @@ void LoadOptions(void)
dwBufferSize = sizeof(options.szArgs2);
LoadOptionString(key, _T("szArgs2"), (LPBYTE)&options.szArgs2, dwBufferSize);
dwBufferSize = sizeof(options.szQuote);
- LoadOptionString(key, _T("szQuote"), (LPBYTE)&options.szQuote, dwBufferSize);
+ LoadOptionBinary(key, _T("szQuote"), (LPBYTE)&options.szQuote, dwBufferSize);
if (key != NULL) {
dwBufferSize = sizeof(options.MacroArray);
@@ -2441,7 +2453,7 @@ void SaveOptions(void)
writeSucceeded &= SaveOption(key, _T("szArgs"), REG_SZ, (LPBYTE)&options.szArgs, sizeof(options.szArgs));
writeSucceeded &= SaveOption(key, _T("szBrowser2"), REG_SZ, (LPBYTE)&options.szBrowser2, sizeof(options.szBrowser2));
writeSucceeded &= SaveOption(key, _T("szArgs2"), REG_SZ, (LPBYTE)&options.szArgs2, sizeof(options.szArgs2));
- writeSucceeded &= SaveOption(key, _T("szQuote"), REG_SZ, (LPBYTE)&options.szQuote, sizeof(options.szQuote));
+ writeSucceeded &= SaveOption(key, _T("szQuote"), REG_BINARY, (LPBYTE)&options.szQuote, sizeof(options.szQuote));
writeSucceeded &= SaveOption(key, _T("szLangPlugin"), REG_SZ, (LPBYTE)&options.szLangPlugin, sizeof(options.szLangPlugin));
writeSucceeded &= SaveOption(key, _T("szFavDir"), REG_SZ, (LPBYTE)&options.szFavDir, sizeof(options.szFavDir));
if (key) {
View
Binary file not shown.

0 comments on commit f39cf4a

Please sign in to comment.