From c455c87c5cd42bbbe586b31cea1143132f3a39e4 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 21 Jul 2008 19:03:49 +0100 Subject: Rename path_list to string_list The name path_list was correct for the first usage of that data structure, but it really is a general-purpose string list. $ perl -i -pe 's/path-list/string-list/g' $(git grep -l path-list) $ perl -i -pe 's/path_list/string_list/g' $(git grep -l path_list) $ git mv path-list.h string-list.h $ git mv path-list.c string-list.c $ perl -i -pe 's/has_path/has_string/g' $(git grep -l has_path) $ perl -i -pe 's/path/string/g' string-list.[ch] $ git mv Documentation/technical/api-path-list.txt \ Documentation/technical/api-string-list.txt $ perl -i -pe 's/strdup_paths/strdup_strings/g' $(git grep -l strdup_paths) ... and then fix all users of string-list to access the member "string" instead of "path". Documentation/technical/api-string-list.txt needed some rewrapping, too. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff-no-index.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'diff-no-index.c') diff --git a/diff-no-index.c b/diff-no-index.c index f6994cf5f..7d68b7f1b 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -14,9 +14,9 @@ #include "revision.h" #include "log-tree.h" #include "builtin.h" -#include "path-list.h" +#include "string-list.h" -static int read_directory(const char *path, struct path_list *list) +static int read_directory(const char *path, struct string_list *list) { DIR *dir; struct dirent *e; @@ -26,7 +26,7 @@ static int read_directory(const char *path, struct path_list *list) while ((e = readdir(dir))) if (strcmp(".", e->d_name) && strcmp("..", e->d_name)) - path_list_insert(e->d_name, list); + string_list_insert(e->d_name, list); closedir(dir); return 0; @@ -60,13 +60,13 @@ static int queue_diff(struct diff_options *o, if (S_ISDIR(mode1) || S_ISDIR(mode2)) { char buffer1[PATH_MAX], buffer2[PATH_MAX]; - struct path_list p1 = {NULL, 0, 0, 1}, p2 = {NULL, 0, 0, 1}; + struct string_list p1 = {NULL, 0, 0, 1}, p2 = {NULL, 0, 0, 1}; int len1 = 0, len2 = 0, i1, i2, ret = 0; if (name1 && read_directory(name1, &p1)) return -1; if (name2 && read_directory(name2, &p2)) { - path_list_clear(&p1, 0); + string_list_clear(&p1, 0); return -1; } @@ -95,14 +95,14 @@ static int queue_diff(struct diff_options *o, else if (i2 == p2.nr) comp = -1; else - comp = strcmp(p1.items[i1].path, - p2.items[i2].path); + comp = strcmp(p1.items[i1].string, + p2.items[i2].string); if (comp > 0) n1 = NULL; else { n1 = buffer1; - strncpy(buffer1 + len1, p1.items[i1++].path, + strncpy(buffer1 + len1, p1.items[i1++].string, PATH_MAX - len1); } @@ -110,14 +110,14 @@ static int queue_diff(struct diff_options *o, n2 = NULL; else { n2 = buffer2; - strncpy(buffer2 + len2, p2.items[i2++].path, + strncpy(buffer2 + len2, p2.items[i2++].string, PATH_MAX - len2); } ret = queue_diff(o, n1, n2); } - path_list_clear(&p1, 0); - path_list_clear(&p2, 0); + string_list_clear(&p1, 0); + string_list_clear(&p2, 0); return ret; } else { -- cgit v1.2.1