X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=diff.c;h=bf65892f78f84a31b6bf87b0f82cfc5938485862;hb=d8faea9d182bd0ca2624be74d9dc32b187618840;hp=17873f3d9e88fccbf98e790d243397dcc4ccb24b;hpb=24e7a5be373c95f977bab4f0f41f736bb1d25075;p=git.git diff --git a/diff.c b/diff.c index 17873f3d9..bf65892f7 100644 --- a/diff.c +++ b/diff.c @@ -2704,10 +2704,16 @@ static void diff_fill_sha1_info(struct diff_filespec *one) static void strip_prefix(int prefix_length, const char **namep, const char **otherp) { /* Strip the prefix but do not molest /dev/null and absolute paths */ - if (*namep && **namep != '/') + if (*namep && **namep != '/') { *namep += prefix_length; - if (*otherp && **otherp != '/') + if (**namep == '/') + ++*namep; + } + if (*otherp && **otherp != '/') { *otherp += prefix_length; + if (**otherp == '/') + ++*otherp; + } } static void run_diff(struct diff_filepair *p, struct diff_options *o) @@ -2814,7 +2820,6 @@ static void run_checkdiff(struct diff_filepair *p, struct diff_options *o) void diff_setup(struct diff_options *options) { memset(options, 0, sizeof(*options)); - memset(&diff_queued_diff, 0, sizeof(diff_queued_diff)); options->file = stdout;