summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 74376a6)
raw | patch | inline | side by side (parent: 74376a6)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 14 Sep 2005 05:27:42 +0000 (22:27 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 14 Sep 2005 05:27:42 +0000 (22:27 -0700) |
We wanted to detect case #16 which should be rare, but botched the
case when some paths are missing, causing a segfault. My fault.
Signed-off-by: Junio C Hamano <junkio@cox.net>
case when some paths are missing, causing a segfault. My fault.
Signed-off-by: Junio C Hamano <junkio@cox.net>
read-tree.c | patch | blob | history |
diff --git a/read-tree.c b/read-tree.c
index 4db154db2b4ff17f7a2a584799aa5980692efe9f..6a5c08c4c6903fec45cbe37a63f0bc42fbae53bc 100644 (file)
--- a/read-tree.c
+++ b/read-tree.c
static void show_stage_entry(FILE *o,
const char *label, const struct cache_entry *ce)
{
- fprintf(stderr, "%s%06o %s %d\t%s\n",
- label,
- ntohl(ce->ce_mode),
- sha1_to_hex(ce->sha1),
- ce_stage(ce),
- ce->name);
+ if (!ce)
+ fprintf(o, "%s (missing)\n", label);
+ else
+ fprintf(o, "%s%06o %s %d\t%s\n",
+ label,
+ ntohl(ce->ce_mode),
+ sha1_to_hex(ce->sha1),
+ ce_stage(ce),
+ ce->name);
}
#endif