+
+ /*
+ * Do we have an exact match? If we were told to match
+ * at the end, size must be exactly at try+fragsize,
+ * otherwise try+fragsize must be still within the preimage,
+ * and either case, the old piece should match the preimage
+ * exactly.
+ */
+ if ((match_end
+ ? (try + fragsize == size)
+ : (try + fragsize <= size)) &&
+ !memcmp(buf + try, fragment, fragsize))
+ return 1;
+
+ /*
+ * NEEDSWORK: We can optionally match fuzzily here, but
+ * that is for a later round.
+ */
+ return 0;