# Copyright (C) 2017 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # in any medium, are permitted without royalty provided the copyright # notice and this notice are preserved. . $srcdir/test-lib.sh require cat use_local_patch use_tmpdir # ============================================================== # Check if patch incorrectly applies overlapping hunks: after the # first hunk is applied, the second hunk should not apply # anymore. Older versions of patch didn't recognize that and did # apply the second hunk on top of the first one, leading to the # following incorrect result, with no information about hunk 2: # # Hunk #1 succeeded at 7 (offset 6 lines). # # printf '%s\n' x x x x x x 1 2 3 a a 4 5 6 cat > a.diff < a seq 1 6 >> a check 'patch < a.diff || echo status: $?' <