@matheusbsbs / matheus-bagliano / commits / 72ee96c0f1
Fork 0

check return value from diff_setup_done()

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Aug 9, 2006 at 12:45 UTC 72ee96c0f1861fcdb9eaf39e78d86888437a27a9
2 files changed +4 -2
builtin-diff.c
+2 -1
@@ -253,7 +253,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
253 argc = setup_revisions(argc, argv, &rev, NULL);
254 if (!rev.diffopt.output_format) {
255 rev.diffopt.output_format = DIFF_FORMAT_PATCH;
256 - diff_setup_done(&rev.diffopt);
256 + if (diff_setup_done(&rev.diffopt) < 0)
257 + die("diff_setup_done failed");
258 }
259
260 /* Do we have --cached and not have a pending object, then
revision.c
+2 -1
@@ -936,7 +936,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
936 revs->diffopt.output_format = DIFF_FORMAT_PATCH;
937 }
938 revs->diffopt.abbrev = revs->abbrev;
939 - diff_setup_done(&revs->diffopt);
939 + if (diff_setup_done(&revs->diffopt) < 0)
940 + die("diff_setup_done failed");
941
942 return left;
943 }