On Jan 13, 2004, at 12:58 AM, Sid Sid wrote:
I've used GNU diff with -urN:
diff -v
diff (GNU diffutils) 2.8.1
Copyright (C) 2002 Free Software Foundation, Inc.
...
Please advice what should I use instead of GNU diff.
Use GNU diff, but a version that, for "diff -u", puts spaces at the
beginnings of lines that aren't being changed.
If I do "diff -u" between the previous and current version of
"packet-ses.c" with GNU diff 2.7 (as comes with Mac OS X 10.3), I get:
@@ -161,7 +161,7 @@
/* large second initial serial number */
static int hf_large_second_initial_serial_number = -1;
-static const value_string ses_vals[] =
+const value_string ses_vals[] =
{
{SES_CONNECTION_REQUEST, "Connection request PDU" },
{SES_CONNECTION_ACCEPT, "Connection accept PDU" },
Your patch had:
/* large second initial serial number */
static int hf_large_second_initial_serial_number = -1;
-static const value_string ses_vals[] =
+const value_string ses_vals[] =
{
{SES_CONNECTION_REQUEST, "Connection request PDU" },
{SES_CONNECTION_ACCEPT, "Connection accept PDU" },
The lack of the extra spaces at the beginnings of lines that aren't
being changed caused the version of patch that comes with Mac OS X:
% patch --version
patch 2.5.8
Copyright (C) 1988 Larry Wall
Copyright (C) 2002 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
written by Larry Wall and Paul Eggert
to reject the patch.
I have seen similar problems, as I remember, with the version of patch
that are on my FreeBSD partitions at home.
I don't know whether this is GNU diff 2.8.1 "helpfully" omitting the
leading blank, or some other software stripping it out, but in either
case it doesn't work with the versions of patch I've seen.