X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diff-no-index.c;h=ce9e783407437bb1e0efc6d5bc2392af26da5a41;hb=98f5e24b9020578e4526eb1cc9588871350e5c01;hp=4cd9dacbe8e98d1420ebe1a217b0f927d24d125a;hpb=bd01c6de67715586f7527115bb4f74e7929b3b66;p=git.git diff --git a/diff-no-index.c b/diff-no-index.c index 4cd9dacbe..ce9e78340 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -26,7 +26,7 @@ static int read_directory(const char *path, struct string_list *list) while ((e = readdir(dir))) if (strcmp(".", e->d_name) && strcmp("..", e->d_name)) - string_list_insert(e->d_name, list); + string_list_insert(list, e->d_name); closedir(dir); return 0; @@ -64,7 +64,8 @@ static int queue_diff(struct diff_options *o, if (S_ISDIR(mode1) || S_ISDIR(mode2)) { char buffer1[PATH_MAX], buffer2[PATH_MAX]; - struct string_list p1 = {NULL, 0, 0, 1}, p2 = {NULL, 0, 0, 1}; + struct string_list p1 = STRING_LIST_INIT_DUP; + struct string_list p2 = STRING_LIST_INIT_DUP; int len1 = 0, len2 = 0, i1, i2, ret = 0; if (name1 && read_directory(name1, &p1))