[DGD]Patches
Jason Cone
jcone at uscdev.com
Wed Apr 12 16:28:34 CEST 2000
Ok, I think I see your real question. ;) Sorry about the confusion. I
think you need to understand the patch file format a bit better so as to be
able to manually apply them. Here goes:
*** 289,299 ****
/*
* insert CR before LF
*/
*q++ = LF;
size++;
! } else if ((*p & 0x7f) < ' ' && *p != HT && *p != BEL && *p != BS) {
/*
* illegal character
*/
p++;
--len;
--- 289,299 ----
/*
* insert CR before LF
*/
*q++ = CR;
size++;
! } else if ((*p & 0x7f) < ' ' && *p != HT && *p != BEL && *p != BS && *p
!= ESC) {
/*
* illegal character
*/
p++;
--len;
Ok, so what we have here is the patch file for comm.c. Each "change entry"
in a patch file consists of two sections: one section tells the patch
program (or you, in this case) what section of code to look for and the
other section denotes what changes should take place in said section.
The first section of a "change entry" starts with the '***' and is followed
by the line numbers in the source file at which the 'patch' program should
start looking for the following code.
The second section of a "change entry" starts with the '---' followed and is
followed by the line numbers that will correspond to the updated source
changes.
When the 'patch' program finds the code defined in the first section, it'll
then take those lines that are marked with '+' (add those lines), '-'
(remove those lines), or '!' (change those lines with the same line in the
second section) and perform the necessary operations.
So, in plain English, the above diff file would do the following:
1) Ok, in comm.c, go find the section of code that matches what's in the
first section. Start looking around line 289, but devitate a little bit if
you have to (the amount of deviation can be customized via a parameter to
the 'patch' program).
2) Once you find the block of source code, change the line:
} else if ((*p & 0x7f) < ' ' && *p != HT && *p != BEL && *p != BS) {
to:
} else if ((*p & 0x7f) < ' ' && *p != HT && *p != BEL && *p != BS &&
*p
!= ESC) {
3) You're done.
Does that answer your question/clear the confusion?
JC
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list