summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 206de27)
raw | patch | inline | side by side (parent: 206de27)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 13 Jun 2005 00:23:15 +0000 (17:23 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Mon, 13 Jun 2005 03:29:31 +0000 (20:29 -0700) |
When an unmerged path was fed via diff_unmerged() into diffcore,
it eventually called run_diff() with "one" and "two" parameters
with NULL, but run_diff() was not written carefully enough to
notice this situation.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
it eventually called run_diff() with "one" and "two" parameters
with NULL, but run_diff() was not written carefully enough to
notice this situation.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diff.c | patch | blob | history | |
diffcore.h | patch | blob | history |
index 046d9a39293fa5d33529b59a251f626785ced233..dd1c0b6d55ded16509e8ea5f6cfd1ce5e770e22c 100644 (file)
--- a/diff.c
+++ b/diff.c
{
const char *pgm = external_diff();
if (!pgm &&
+ one && two &&
DIFF_FILE_VALID(one) && DIFF_FILE_VALID(two) &&
(S_IFMT & one->mode) != (S_IFMT & two->mode)) {
/* a filepair that changes between file and symlink
diff --git a/diffcore.h b/diffcore.h
index ac159d7154ce02034eb88dab279894e5572da7b6..f1b5ca748cae8d40f599552c3605080808da7803 100644 (file)
--- a/diffcore.h
+++ b/diffcore.h
* if false, use the name and read from
* the filesystem.
*/
-#define DIFF_FILE_VALID(spec) ((spec) && ((spec)->mode) != 0)
+#define DIFF_FILE_VALID(spec) (((spec)->mode) != 0)
unsigned should_free : 1; /* data should be free()'ed */
unsigned should_munmap : 1; /* data should be munmap()'ed */
};