// read out all controls, and if value is altered, remember it and send it to the engine\r
{\r
HANDLE hwndCombo;\r
- int i, k, new=0, changed=0;\r
- char **choices, newText[MSG_SIZ], buf[MSG_SIZ];\r
+ int i, k, new=0, changed=0, len;\r
+ char **choices, newText[MSG_SIZ], buf[MSG_SIZ], *text;\r
BOOL success;\r
\r
for(i=0; i<layout; i++) {\r
case TextBox:\r
case FileName:\r
case PathName:\r
- success = GetDlgItemText( hDlg, 2001+2*i, newText, MSG_SIZ - strlen(optionList[j].name) - 9 );\r
+ if(cps) len = MSG_SIZ - strlen(optionList[j].name) - 9, text = newText;\r
+ else len = GetWindowTextLength(GetDlgItem(hDlg, 2001+2*i)) + 1, text = (char*) malloc(len);\r
+ success = GetDlgItemText( hDlg, 2001+2*i, text, len );\r
if(!success) break;\r
if(!cps) {\r
+ char *p;\r
if(*(char**)optionList[j].target) free(*(char**)optionList[j].target);\r
- *(char**)optionList[j].target = strdup(newText);\r
+ *(char**)optionList[j].target = p = text;\r
+ while(*p++ = *text++) if(p[-1] == '\r') p--; // crush CR\r
break;\r
}\r
changed = strcmp(optionList[j].textValue, newText) != 0;\r