[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to use 'diff' (was Re: Sticky Text Patches)



What you wrote:
> So I added some prot_temp()-calls in fork_restore(), and now it 
> works fine. I've marked the lines below (Sorry, no diff, because I
> don't know (yet) how to use it).
 
How To Use Diff

1) BEFORE you edit foo.c, do this:
   - mv foo.c foo.c.orig
   - cp foo.c.orig foo.c
   This leaves you with an unaltered original.  This is very important!

2) AFTER you're done editing foo.c (ie, you've hacked it, tested it,
   it works properly), do this:
   - diff -c foo.c.orig foo.c > foo.diff

-c means "context", which gives the changes a little extra info so
patch can figure out what to do if you try to use the diffs on a changed
file.

Now you've got a nice context-diff in the file foo.diff; the changes in
foo.diff can be applied by going:

patch -l < foo.diff

-l means "loose", which ignores end-of-line differences; very handy if
some of your tools do silly things like converting the UNIX text to DOS
text (@#$@# MicroEMACS 3.11 does this, my unreleased MiNT port of 3.12
doesn't).

> P.S. This is the first time I mail to this list, so tell me if I did
>      something wrong.

Looked fine to me (but I didn't check your code; I'm not a kernel hacker)!

-- 
----------========================_   /\ ============================----------
Chris Herborth                    \`o.0'       herborth@53iss6.Waterloo.NCR.COM
Information Products Developer    =(___)=
AT&T Global Information Solutions    U