]> asedeno.scripts.mit.edu Git - git.git/blobdiff - diff.c
Remove a CURLOPT_HTTPHEADER (un)setting
[git.git] / diff.c
diff --git a/diff.c b/diff.c
index d97ebc501af20929a07e754cd74bea06c7114811..3dd2f35f7364341bcb5f4507ea36d03925fdc938 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -439,7 +439,7 @@ static void diff_words_show(struct diff_words_data *diff_words)
        ecb.outf = xdiff_outf;
        ecb.priv = diff_words;
        diff_words->xm.consume = fn_out_diff_words_aux;
-       xdl_diff(&minus, &plus, &xpp, &xecfg, &ecb);
+       xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);
 
        free(minus.ptr);
        free(plus.ptr);
@@ -1044,11 +1044,18 @@ static void checkdiff_consume(void *priv, char *line, unsigned long len)
                int i, spaces = 0, space_before_tab = 0, white_space_at_end = 0;
 
                /* check space before tab */
-               for (i = 1; i < len && (line[i] == ' ' || line[i] == '\t'); i++)
+               for (i = 1; i < len; i++) {
                        if (line[i] == ' ')
                                spaces++;
-               if (line[i - 1] == '\t' && spaces)
-                       space_before_tab = 1;
+                       else if (line[i] == '\t') {
+                               if (spaces) {
+                                       space_before_tab = 1;
+                                       break;
+                               }
+                       }
+                       else
+                               break;
+               }
 
                /* check whitespace at line end */
                if (line[len - 1] == '\n')
@@ -1386,7 +1393,7 @@ static void builtin_diff(const char *name_a,
                if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS))
                        ecbdata.diff_words =
                                xcalloc(1, sizeof(struct diff_words_data));
-               xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
+               xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
                if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS))
                        free_diff_words_data(&ecbdata);
        }
@@ -1439,7 +1446,7 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
                xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
                ecb.outf = xdiff_outf;
                ecb.priv = diffstat;
-               xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
+               xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
        }
 
  free_and_return:
@@ -1479,7 +1486,7 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
                xpp.flags = XDF_NEED_MINIMAL;
                ecb.outf = xdiff_outf;
                ecb.priv = &data;
-               xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
+               xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
        }
  free_and_return:
        diff_free_filespec_data(one);
@@ -2891,7 +2898,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
                xecfg.flags = XDL_EMIT_FUNCNAMES;
                ecb.outf = xdiff_outf;
                ecb.priv = &data;
-               xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
+               xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
        }
 
        SHA1_Final(sha1, &ctx);