[Bug 277646] patch no longer work for simple diff

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 12 Mar 2024 04:35:42 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277646

            Bug ID: 277646
           Summary: patch no longer work for simple diff
           Product: Base System
           Version: 13.3-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: jguojun@gmail.com

%mkdir a b
%echo aaa > a/txt
%echo bbb > b/txt

# 13.3-R /usr/bin/patch failing case for normal simple diff, no matter if -p#
is used
# patch at earlier versions of FreeBSD releases do not have this issue.

%diff -r a b > ab.dif
patch < ab.dif
Hmm...  Looks like a normal diff to me...
The text leading up to this was:
--------------------------
|diff -r a/txt b/txt
--------------------------
File to patch: ^C

# works well for context based and unified diff
diff -ur a b > ab.dif
patch < ab.dif
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ur a/txt b/txt
|--- a/txt      2024-03-11 21:21:19.328439000 -0700
|+++ b/txt      2024-03-11 21:22:49.232518000 -0700
--------------------------
Patching file a/txt using Plan A...
Hunk #1 succeeded at 1.
done

-- 
You are receiving this mail because:
You are the assignee for the bug.