diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-05-23 16:28:32 +0200 |
---|---|---|
committer | Andreas Ericsson <ae@op5.se> | 2010-06-02 10:32:07 +0200 |
commit | 47c31f584e09d79f3674987582a60c7bb6b673c0 (patch) | |
tree | 6e2b3105c1c5fa82ae4e33a8c24d50d69c50782c /src/commit.c | |
parent | a7c182c59414cece10c819989bce3f1247f4eacc (diff) | |
download | libgit2-47c31f584e09d79f3674987582a60c7bb6b673c0.tar.gz |
Fixed linked list tail being lost when sorting.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>
Diffstat (limited to 'src/commit.c')
-rw-r--r-- | src/commit.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/commit.c b/src/commit.c index dec93efc7..10b759e73 100644 --- a/src/commit.c +++ b/src/commit.c @@ -293,7 +293,7 @@ void git_commit_list_clear(git_commit_list *list, int free_commits) void git_commit_list_sort(git_commit_list *list) { - git_commit_node *p, *q, *e, *tail; + git_commit_node *p, *q, *e; int in_size, p_size, q_size, merge_count, i; if (list->head == NULL) @@ -304,7 +304,7 @@ void git_commit_list_sort(git_commit_list *list) do { p = list->head; - tail = NULL; + list->tail = NULL; merge_count = 0; while (p != NULL) @@ -329,18 +329,18 @@ void git_commit_list_sort(git_commit_list *list) else e = q, q = q->next, q_size--; - if (tail != NULL) - tail->next = e; + if (list->tail != NULL) + list->tail->next = e; else list->head = e; - tail = e; + list->tail = e; } p = q; } - tail->next = NULL; + list->tail->next = NULL; in_size *= 2; } while (merge_count > 1); |