Now doesn't crash if the closing bracket ')' couldn't be found
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1218 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
f0909b5ef7
commit
6f439d3c7b
1 changed files with 12 additions and 6 deletions
|
@ -399,10 +399,13 @@ int CEXEBuild::add_string_main(const char *string, int process) // returns offse
|
|||
if (!process) return build_strlist.add(string,2);
|
||||
|
||||
if (*string == '$' && *(string+1) == '(') {
|
||||
int idx = -1;
|
||||
char *cp = strdup(string+2);
|
||||
strchr(cp, ')')[0] = 0;
|
||||
int idx;
|
||||
if (build_userlangstrings->find(cp, 0, &idx) < 0) idx = -1;
|
||||
char *p = strchr(cp, ')');
|
||||
if (*p) {
|
||||
*p = 0;
|
||||
if (build_userlangstrings->find(cp, 0, &idx) < 0) idx = -1;
|
||||
}
|
||||
free(cp);
|
||||
if (idx >= 0) return -(idx+1);
|
||||
}
|
||||
|
@ -418,10 +421,13 @@ int CEXEBuild::add_string_uninst(const char *string, int process) // returns off
|
|||
if (!process) return ubuild_strlist.add(string,2);
|
||||
|
||||
if (*string == '$' && *(string+1) == '(') {
|
||||
int idx = -1;
|
||||
char *cp = strdup(string+2);
|
||||
strchr(cp, ')')[0] = 0;
|
||||
int idx;
|
||||
if (ubuild_userlangstrings->find(cp, 0, &idx) < 0) idx = -1;
|
||||
char *p = strchr(cp, ')');
|
||||
if (*p) {
|
||||
*p = 0;
|
||||
if (ubuild_userlangstrings->find(cp, 0, &idx) < 0) idx = -1;
|
||||
}
|
||||
free(cp);
|
||||
if (idx >= 0) return -(idx+1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue