1 Subject: remove double allocation in dictionary patch
5 source/macro.c | 5 -----
6 1 file changed, 5 deletions(-)
8 diff --quilt old/source/macro.c new/source/macro.c
10 +++ new/source/macro.c
11 @@ -6183,7 +6183,6 @@ static int dictsaveMS(WindowInfo *window
14 result->tag = STRING_TAG;
15 - AllocNString(&result->val.str, strlen(dictionary_filename)+1);
16 AllocNStringCpy(&result->val.str, dictionary_filename);
19 @@ -6276,21 +6275,17 @@ static int dictcompleteMS(WindowInfo *wi
20 items_left = complete_dict(string, s2, minchars, maxmatches); /* so invoke a new search */
22 if (items_left <= 0) {
23 - AllocNString(&result->val.str, 1);
24 AllocNStringCpy(&result->val.str, "");
28 - AllocNString(&result->val.str, strlen(s2[items_left])+1);
29 AllocNStringCpy(&result->val.str, s2[items_left]);
31 } else { /* An empty key string was given, but maybe there are still some matches left from last call */
34 - AllocNString(&result->val.str, strlen(s2[items_left])+1);
35 AllocNStringCpy(&result->val.str, s2[items_left]);
37 - AllocNString(&result->val.str, 1);
38 AllocNStringCpy(&result->val.str, "");