summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-05 09:50:54 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-04-05 09:50:54 (GMT)
commit12d81ce59846e17676c5534257ca2f1783829d63 (patch)
tree1af8d4135e5f50dd8f7a8d375092ddcb25f9ae11
parent42277bc81ce2f4450fe08239e4db34516f879c1d (diff)
parent7d6c447145c07bb7d96a9aa17e33838fbe76e405 (diff)
downloadgit-12d81ce59846e17676c5534257ca2f1783829d63.zip
git-12d81ce59846e17676c5534257ca2f1783829d63.tar.gz
git-12d81ce59846e17676c5534257ca2f1783829d63.tar.bz2
Merge branch 'fix'
* fix: diff_flush(): leakfix. parse_date(): fix parsing 03/10/2006
-rw-r--r--date.c4
-rw-r--r--diff.c44
2 files changed, 27 insertions, 21 deletions
diff --git a/date.c b/date.c
index 1c1917b..376d25d 100644
--- a/date.c
+++ b/date.c
@@ -255,10 +255,10 @@ static int match_multi_number(unsigned long num, char c, const char *date, char
break;
}
/* mm/dd/yy ? */
- if (is_date(num3, num2, num, tm))
+ if (is_date(num3, num, num2, tm))
break;
/* dd/mm/yy ? */
- if (is_date(num3, num, num2, tm))
+ if (is_date(num3, num2, num, tm))
break;
return 0;
}
diff --git a/diff.c b/diff.c
index e496905..fe4664c 100644
--- a/diff.c
+++ b/diff.c
@@ -1280,28 +1280,34 @@ void diff_flush(struct diff_options *options)
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
- if ((diff_output_format == DIFF_FORMAT_NO_OUTPUT) ||
- (p->status == DIFF_STATUS_UNKNOWN))
- continue;
- if (p->status == 0)
- die("internal error in diff-resolve-rename-copy");
- switch (diff_output_format) {
- case DIFF_FORMAT_PATCH:
- diff_flush_patch(p, options);
- break;
- case DIFF_FORMAT_RAW:
- case DIFF_FORMAT_NAME_STATUS:
- diff_flush_raw(p, line_termination,
- inter_name_termination,
- options);
+
+ switch (p->status) {
+ case DIFF_STATUS_UNKNOWN:
break;
- case DIFF_FORMAT_NAME:
- diff_flush_name(p,
- inter_name_termination,
- line_termination);
+ case 0:
+ die("internal error in diff-resolve-rename-copy");
break;
+ default:
+ switch (diff_output_format) {
+ case DIFF_FORMAT_PATCH:
+ diff_flush_patch(p, options);
+ break;
+ case DIFF_FORMAT_RAW:
+ case DIFF_FORMAT_NAME_STATUS:
+ diff_flush_raw(p, line_termination,
+ inter_name_termination,
+ options);
+ break;
+ case DIFF_FORMAT_NAME:
+ diff_flush_name(p,
+ inter_name_termination,
+ line_termination);
+ break;
+ case DIFF_FORMAT_NO_OUTPUT:
+ break;
+ }
}
- diff_free_filepair(q->queue[i]);
+ diff_free_filepair(p);
}
free(q->queue);
q->queue = NULL;