X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fapply.c;h=f669157b42e658b3769ec775f7aa4dafea634db8;hb=6f79d6689193dad107b9424e9bd699d20c7d5c33;hp=7ca90472c10eed8535e76b1e0ec25c92af7cff05;hpb=5e4f61474202122f376b16181b760f390623bf4e;p=git.git diff --git a/builtin/apply.c b/builtin/apply.c index 7ca90472c..f669157b4 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -1864,13 +1864,13 @@ static int match_fragment(struct image *img, if (match_end && (preimage->nr + try_lno != img->nr)) return 0; } else if (ws_error_action == correct_ws_error && - (ws_rule & WS_BLANK_AT_EOF) && match_end) { + (ws_rule & WS_BLANK_AT_EOF)) { /* - * This hunk that matches at the end extends beyond - * the end of img, and we are removing blank lines - * at the end of the file. This many lines from the - * beginning of the preimage must match with img, and - * the remainder of the preimage must be blank. + * This hunk extends beyond the end of img, and we are + * removing blank lines at the end of the file. This + * many lines from the beginning of the preimage must + * match with img, and the remainder of the preimage + * must be blank. */ preimage_limit = img->nr - try_lno; } else { @@ -2824,11 +2824,8 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s if (stat_ret < 0) { struct checkout costate; /* checkout */ + memset(&costate, 0, sizeof(costate)); costate.base_dir = ""; - costate.base_dir_len = 0; - costate.force = 0; - costate.quiet = 0; - costate.not_new = 0; costate.refresh_cache = 1; if (checkout_entry(*ce, &costate, NULL) || lstat(old_name, st))