Code

diff --no-index -q: fix endless loop
authorThomas Rast <trast@student.ethz.ch>
Wed, 7 Jan 2009 11:15:30 +0000 (12:15 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Jan 2009 20:04:38 +0000 (12:04 -0800)
We forgot to move to the next argument when parsing -q, getting stuck
in an endless loop.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-no-index.c

index 12ff1f1eefde8ac33709cd423a980708cd38b072..60ed17470a6a2bf9bea202a04004b06d207a77d7 100644 (file)
@@ -207,8 +207,10 @@ void diff_no_index(struct rev_info *revs,
                int j;
                if (!strcmp(argv[i], "--no-index"))
                        i++;
-               else if (!strcmp(argv[i], "-q"))
+               else if (!strcmp(argv[i], "-q")) {
                        options |= DIFF_SILENT_ON_REMOVED;
+                       i++;
+               }
                else if (!strcmp(argv[i], "--"))
                        i++;
                else {