You may have problems with the above diff working as a patch. Note that the first one has 4 directory levels mentioned and the 2nd one has only two. I would suggest modifying the --- and +++ lines to make the directory structure in both to be the same number of levels deep.
unless the patchfile has "linux" as part of the directory structure on the +++ line, in that case issue the patch command with the -p1 as follows:
patch -p1 <new-patch
Patch Header:
In these examples a patch header begins with the two lines that begin with a --- and +++. This would indicate which filename to begin processing.
Multiple Patches in a Patchfile:
A patchfile can have multiple sections, each beginning with the --- / +++ headers mentioned above. So a single patchfile can actually modify several files. If you are reviewing a patchfile be sure to search for every instance of --- throughout the patchfile to see all the different files it patches.
An Example of one method to browse a patchfile:
less /tmp/file-patch <ENTER>
/--- <ENTER>
n
n
n
Note that the "/" invokes the search function in less, and each time you press "n" less will search for the next matching searchstring.
Hunks:
A hunk is a section to be patched. A hunk usually begins and ends with lines that don't need any changes, they are just mentioned so that Patch can find the appropriate place in the files to be patched. Hunk in these examples begins with a double at symbol (@@) and ends when either a new hunk starts or it finds a new patch header. Here's an example of a hunk:
In these examples you will notice that each hunk has been indented so that the text does not occupy the first column. In these examples Patch uses the first column in each patch to list the lines to be added or removed.
The First Column of a Hunk (+, -, and a blank):
The + would indicate that this particular line is to be added.
The - would indicate that this particular line is to be removed.
A line with neither a plus or minus would indicate that this particular line of code is just a reference point.
This example was created using the following diff command:
diff -u old/modules/pcitable new/modules/pcitable
However, now I would probably only use the -Naur options instead of just -u. This example modifies two files: new/modules/pcitable, and new/usr/share/kudzu/pcitable.
The first patch header has two hunks. These particular hunks are adding 2 lines and 1 line respectively.