This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: patch - strange behaviour


   I've tried to apply Mumit Khan's patches to b18 and experienced very strage
   behaviour of patch:

   patch aborts a after some patches, typically a few files, with the message
   "Assertion hunk failed ..." (don't remember exact wording).

   If I split the patch file into seven parts, I can apply the separate patch
   files without problems. I can live with that, but it's inconvenient.

   Has anyone got an idea what's going on?

Yes, "patch" reads its patch file in TEXT mode (rather than BINARY
mode) and occasionally caches a location in the file by performing an
'ftell()' type of operation.  It expects to be able to perform an
'fseek()' to get back to that location in the file, but this doesn't
work for text files (where CR's are silently eaten).  I worked around
it the brute force way by replacing calls to 'fseek()' with calls to
'my_brute_force_fseek()', which looped until 'ftell()' returned the
desired position, reading and discarding one character at a time along
the way.  This is basically what I recall doing... I can send you a
patch (ha ha) if you would like.

-- 
--patrick


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]