check return value from diff_setup_done()
authorJunio C Hamano <junkio@cox.net>
Wed, 9 Aug 2006 19:45:27 +0000 (12:45 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 9 Aug 2006 19:45:27 +0000 (12:45 -0700)
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-diff.c
revision.c

index 1075855102fdb9d49f923edc4b62ddb75aa8027c..dd9886c6e81030bfd893089e5d2a34fe710f0ba7 100644 (file)
@@ -253,7 +253,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
        argc = setup_revisions(argc, argv, &rev, NULL);
        if (!rev.diffopt.output_format) {
                rev.diffopt.output_format = DIFF_FORMAT_PATCH;
-               diff_setup_done(&rev.diffopt);
+               if (diff_setup_done(&rev.diffopt) < 0)
+                       die("diff_setup_done failed");
        }
 
        /* Do we have --cached and not have a pending object, then
index a58257ad8037f7009c69ee0502c3669756bb3987..5a91d06b980d710e30a80c353a636ca1ca6b9a55 100644 (file)
@@ -936,7 +936,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
                        revs->diffopt.output_format = DIFF_FORMAT_PATCH;
        }
        revs->diffopt.abbrev = revs->abbrev;
-       diff_setup_done(&revs->diffopt);
+       if (diff_setup_done(&revs->diffopt) < 0)
+               die("diff_setup_done failed");
 
        return left;
 }