]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-apply.c
Merge branch 'rz/grepz'
[git.git] / builtin-apply.c
index e2c611bf964d8cd589171f74e5ccce5aeb392643..bf806105062caa47ca168720e0e987ac8957c8af 100644 (file)
@@ -1697,7 +1697,7 @@ static int match_fragment(struct image *img,
                fixlen = ws_fix_copy(buf, orig, oldlen, ws_rule, NULL);
 
                /* Try fixing the line in the target */
-               if (sizeof(tgtfixbuf) < tgtlen)
+               if (sizeof(tgtfixbuf) > tgtlen)
                        tgtfix = tgtfixbuf;
                else
                        tgtfix = xmalloc(tgtlen);
@@ -2586,6 +2586,8 @@ static void build_fake_ancestor(struct patch *list, const char *filename)
                        sha1_ptr = sha1;
 
                ce = make_cache_entry(patch->old_mode, sha1_ptr, name, 0, 0);
+               if (!ce)
+                       die("make_cache_entry failed for path '%s'", name);
                if (add_index_entry(&result, ce, ADD_CACHE_OK_TO_ADD))
                        die ("Could not add %s to temporary index", name);
        }