commit 81b40973581de1f3c508c35229ff720b91e13143 from: Neels Hofmeyr date: Wed Jan 22 03:02:58 2020 UTC switch default to unidiff commit - 3b0f3d6191103b52a0619ed00752f7f5e6fa754c commit + 81b40973581de1f3c508c35229ff720b91e13143 blob - be68fea20a6bbf1f0e109ccd5ea2042919055f31 blob + 6a2fd6aeacd8b4d93e4cf4b9b9d310fe8dd20f88 --- diff/diff.c +++ diff/diff.c @@ -109,7 +109,7 @@ diffreg(char *file1, char *file2, int flags) str1 = mmapfile(file1, &st1); str2 = mmapfile(file2, &st2); - diff_plain(stdout, &diff_config, &info, str1, st1.st_size, str2, st2.st_size); + diff_unidiff(stdout, &diff_config, &info, str1, st1.st_size, str2, st2.st_size, 3); munmap(str1, st1.st_size); munmap(str2, st2.st_size); blob - 48768c491c8dc456f94d9bd13e9a2f27590bbb0d blob + 10fc21a065ea7662ada86afa15db95344d7e98e4 --- test/expect001.diff +++ test/expect001.diff @@ -1,5 +1,6 @@ --- test001.left.txt +++ test001.right.txt +@@ -1,7 +1,6 @@ -A -B C blob - 5a409a01b7a7269424e11fd6a07a054e997dd3c5 blob + 1ce7fb3bddfe8db6c469d14ef1dbe056aa2eb0c2 --- test/expect002.diff +++ test/expect002.diff @@ -1,5 +1,6 @@ --- test002.left.txt +++ test002.right.txt +@@ -1,10 +1,9 @@ -A -B C blob - ff1c8b5c8d3c587b15fe9d9ec83ba6ceb516436e blob + 1694445da7905453457ec123378f5899498eee21 --- test/expect003.diff +++ test/expect003.diff @@ -1,5 +1,6 @@ --- test003.left.txt +++ test003.right.txt +@@ -1,5 +1,4 @@ -a +x b blob - 5989a134be2ab91b93f757600becacc8065b8f94 blob + 061a76ad650bc1f108d364e44f759bb48cc99e41 --- test/expect004.diff +++ test/expect004.diff @@ -1,5 +1,6 @@ --- test004.left.txt +++ test004.right.txt +@@ -1,3 +1,10 @@ +int Chunk_bounds_check(Chunk *chunk, size_t start, size_t n) +{ + if (chunk == NULL) return 0; @@ -10,7 +11,7 @@ void Chunk_copy(Chunk *src, size_t src_start, Chunk *dst, size_t dst_start, size_t n) { if (!Chunk_bounds_check(src, src_start, n)) return; - if (!Chunk_bounds_check(dst, dst_start, n)) return; +@@ -5,10 +12,3 @@ memcpy(dst->data + dst_start, src->data + src_start, n); } blob - 25e2e0bc35f05d8383e52fad77872be96de5dca0 blob + 9ce014a67eb66dd7abe5bd325c8c492f78283aa1 --- test/expect005.diff +++ test/expect005.diff @@ -1,5 +1,6 @@ --- test005.left.txt +++ test005.right.txt +@@ -1,7 +1,7 @@ +The Slits +Gil Scott Heron David Axelrod blob - ea0a5d1c20b159e7dad0631318ef5690875da3ba blob + 70233e0337e1afcfbfdd44a5951006cfaef32de1 --- test/expect006.diff +++ test/expect006.diff @@ -1,7 +1,6 @@ --- test006.left.txt +++ test006.right.txt - Below is an example license to be used for new code in OpenBSD, - modeled after the ISC license. +@@ -3,7 +3,7 @@ It is important to specify the year of the copyright. Additional years should be separated by a comma, e.g. @@ -10,7 +9,7 @@ If you add extra text to the body of the license, be careful not to add further restrictions. - +@@ -11,7 +11,6 @@ /* * Copyright (c) CCYY YOUR NAME HERE * @@ -18,11 +17,7 @@ * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +@@ -23,3 +22,4 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ blob - 996246e7974d7b25bc76ee14c63114a241be4704 blob + ac93bcd3ccf2615381907e61aa9e07d216224f59 --- test/expect007.diff +++ test/expect007.diff @@ -1,4 +1,5 @@ --- test007.left.txt +++ test007.right.txt +@@ -1,1 +1,1 @@ -x +abcdx blob - c4f9c82c25819151690ffa3bcd44eea1b6e43159 blob + 12d576d9e937a74fa6092eb46826729a1c0f16fe --- test/expect008.diff +++ test/expect008.diff @@ -1,5 +1,6 @@ --- test008.left.txt +++ test008.right.txt +@@ -1,1 +1,6 @@ x +a +b blob - 8f75e2ee8130368c1ef12eb5b35b99b786f49ec1 blob + c2dae93ed893b2667cd6146a071f557e96ab9d2e --- test/expect009.diff +++ test/expect009.diff @@ -1,5 +1,6 @@ --- test009.left.txt +++ test009.right.txt +@@ -1,3 +1,10 @@ x a b blob - 4a0ec1a64add5fccad7d01d0856e38be06629717 blob + 17f8df091e1bb71385f342f2e783b09347df7d75 --- test/verify_all.sh +++ test/verify_all.sh @@ -2,7 +2,7 @@ diff_prog="../diff/diff" -diff_type=plain +diff_type=unidiff verify_diff_script() { orig_left="$1"