fix syntax error
[nedit-bw.git] / dictionary-fix-string-alloc.patch
blob94476c80e11840fc51eb72bc52039a97e39c188c
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 @@ -6185,11 +6185,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 @@ -6278,25 +6277,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;