diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2008-07-21 19:03:49 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-21 19:11:50 -0700 |
commit | c455c87c5cd42bbbe586b31cea1143132f3a39e4 (patch) | |
tree | 5271cd3b8b7be270c78612047f42ff6fd47e4bbe /builtin-mailsplit.c | |
parent | 51ef1daa4a0dfaa4d777b2fa949ba051cf800554 (diff) | |
download | git-c455c87c5cd42bbbe586b31cea1143132f3a39e4.tar.gz |
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 <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-mailsplit.c')
-rw-r--r-- | builtin-mailsplit.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c index 13c60c39a4..71f3b3b874 100644 --- a/builtin-mailsplit.c +++ b/builtin-mailsplit.c @@ -6,7 +6,7 @@ */ #include "cache.h" #include "builtin.h" -#include "path-list.h" +#include "string-list.h" static const char git_mailsplit_usage[] = "git mailsplit [-d<prec>] [-f<n>] [-b] -o<directory> [<mbox>|<Maildir>...]"; @@ -115,7 +115,7 @@ static int split_one(FILE *mbox, const char *name, int allow_bare) exit(1); } -static int populate_maildir_list(struct path_list *list, const char *path) +static int populate_maildir_list(struct string_list *list, const char *path) { DIR *dir; struct dirent *dent; @@ -136,7 +136,7 @@ static int populate_maildir_list(struct path_list *list, const char *path) if (dent->d_name[0] == '.') continue; snprintf(name, sizeof(name), "%s/%s", *sub, dent->d_name); - path_list_insert(name, list); + string_list_insert(name, list); } closedir(dir); @@ -152,14 +152,14 @@ static int split_maildir(const char *maildir, const char *dir, char name[PATH_MAX]; int ret = -1; int i; - struct path_list list = {NULL, 0, 0, 1}; + struct string_list list = {NULL, 0, 0, 1}; if (populate_maildir_list(&list, maildir) < 0) goto out; for (i = 0; i < list.nr; i++) { FILE *f; - snprintf(file, sizeof(file), "%s/%s", maildir, list.items[i].path); + snprintf(file, sizeof(file), "%s/%s", maildir, list.items[i].string); f = fopen(file, "r"); if (!f) { error("cannot open mail %s (%s)", file, strerror(errno)); @@ -179,7 +179,7 @@ static int split_maildir(const char *maildir, const char *dir, ret = skip; out: - path_list_clear(&list, 1); + string_list_clear(&list, 1); return ret; } |