core-typeof-syntax: push up
[nedit-bw.git] / dictionary-fix-string-alloc.patch
blobec3fb9a1f2e19eae6eeb870d19794d13253b2623
1 ---
3 source/macro.c | 5 -----
4 1 files changed, 5 deletions(-)
6 diff --quilt old/source/macro.c new/source/macro.c
7 --- old/source/macro.c
8 +++ new/source/macro.c
9 @@ -6202,11 +6202,10 @@ static int dictsaveMS(WindowInfo *window
10 dictionary_filename = strdup(string);
11 dictionary_modified = 1; /* force savedict() to write the actual dictionary */
14 result->tag = STRING_TAG;
15 - AllocNString(&result->val.str, strlen(dictionary_filename)+1);
16 AllocNStringCpy(&result->val.str, dictionary_filename);
18 return True;
19 } else if (nArgs == 2) {
20 if (!readStringArg(argList[0], &string, stringStorage, errMsg)) {
21 @@ -6295,25 +6294,21 @@ static int dictcompleteMS(WindowInfo *wi
23 if (strlen(string) > 0) { /* A string to complete is given */
24 items_left = complete_dict(string, s2, minchars, maxmatches); /* so invoke a new search */
26 if (items_left <= 0) {
27 - AllocNString(&result->val.str, 1);
28 AllocNStringCpy(&result->val.str, "");
29 items_left = 0;
30 } else {
31 items_left--;
32 - AllocNString(&result->val.str, strlen(s2[items_left])+1);
33 AllocNStringCpy(&result->val.str, s2[items_left]);
35 } else { /* An empty key string was given, but maybe there are still some matches left from last call */
36 if (items_left > 0) {
37 items_left--;
38 - AllocNString(&result->val.str, strlen(s2[items_left])+1);
39 AllocNStringCpy(&result->val.str, s2[items_left]);
40 } else {
41 - AllocNString(&result->val.str, 1);
42 AllocNStringCpy(&result->val.str, "");
43 items_left = 0;