[wellylug] Using Diff
McLean, Grant
grant.mclean at bearingpoint.com
Fri May 9 11:46:43 NZST 2003
Hi Edouard
'diff' is a tool for displaying the differences between two
files (typically two versions of the same file) in a
standard format.
'patch' is the tool you want to use to read the output from
diff and change a file. The underlying assumption is that
your file is identical to the older version of the file
that was 'diff'd - it may still work if they're not identical
but it may not.
The output of diff is called a patch. Let's say you've saved
it in a file called 'patch.txt'
Let's also assume the file you wish to patch is called fontsel.cc
(because it is).
cd to the directory where fontsel.cc lives and run the command:
patch fontsel.cc patch.txt
you might also get away with:
patch < patch.txt
If that doesn't work, open the editor go to line 18 and add
all the lines you quoted, but without the leading '> '.
Good luck
Grant
===============================================================
Grant McLean BearingPoint Inc - formerly The Web Limited
+64 4 381 1987 135 Victoria Street, Box 920
grant.mclean at bearingpoint.com Wellington, New Zealand
> -----Original Message-----
> From: Edouard Chalaron [mailto:e.chalaron at paradise.net.nz]
> Sent: Friday, 9 May 2003 10:53 a.m.
> To: Wellylug
> Subject: [wellylug] Using Diff
>
>
>
> Hi
> I have to use Diff to debug a pice of soft. Nothing too
> difficult (well.... I
> thught so !!!)
>
> Could anyone teach me how to properly use diff ? The diff
> --help is a bit
> elliptic to me.
> here is the upgrade I have to do.... thanks a lot
> Edouard
> ***********************
>
> > diff fontsel.cc.~1~ fontsel.cc
> > 18,19c18,42
> > < #include <hash_map>
> > < using std::hash_map;
> > ---
> > > // #include <hash_map>
> > > // using std::hash_map;
> > >
> > >
> > > #if (__GNUC__<3)
> > > # include <hash_map>
> > > namespace Sgi
> > > {
> > > using ::hash_map;
> > > };
> > >
> > > // inherit globals
> > > #else
> > > # include <ext/hash_map>
> > > # if __GNUC_MINOR__ == 0
> > > namespace Sgi = std;
> > > // GCC 3.0
> > > # else
> > > namespace Sgi = ::__gnu_cxx;
> > > // GCC 3.1 and later
> > > # endif
> > > #endif
> > >
> > > using namespace Sgi;
>
> --
> Wellington Linux Users Group Mailing List: wellylug at lists.naos.co.nz
> To Leave: http://lists.naos.co.nz/mailman/listinfo/wellylug
>
More information about the wellylug
mailing list