home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume13 / hd1.6 / patch01 < prev    next >
Text File  |  1990-06-05  |  2KB  |  79 lines

  1. Newsgroups: comp.sources.misc
  2. organization: Pyramid Technology Ltd, Farnborough, ENGLAND
  3. subject: v13i025: patch to v13i020: hd - hexadecimal dump V1.6 for MSDOS
  4. From: pjr@pyra.co.uk (Peter Ruczynski)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 13, Issue 25
  8. Submitted-by: pjr@pyra.co.uk (Peter Ruczynski)
  9. Archive-name: hd1.6/patch01
  10.  
  11. Thanks to Stephen Trier for pointing this one out to me.
  12.  
  13. > On most MS-DOS C compilers, a file must be opened in _binary_ mode, or
  14. > else \n\r sequences are collapsed into \n's and ^Z's are treated as end
  15. > of file markers.
  16.  
  17. Meaning that hd will currently work only on text files :-(
  18.  
  19. Here is a context diff that will cause "patch" to change hd.c, all that is
  20. needed is the -DMSDOS flag added to your msdos makefile.
  21. run:
  22.  
  23. patch -c hd.c patchfile
  24.  
  25. If you don't have patch then there are NOT a lot of changes to make by hand :-)
  26.  
  27. Thanks again to Stephen
  28.  
  29. Keep Enjoying!
  30.  
  31. Pete.
  32.  
  33. ---- CUT HERE ----
  34. *** hd.c    Mon Jun  4 12:11:01 1990
  35. --- hd.c    Mon Jun  4 12:11:25 1990
  36. ***************
  37. *** 321,326
  38.   int fd;    /* file descriptor to read from */
  39.   
  40.       if (fname[0] != 0)
  41.           if ((fd = open(fname, O_RDONLY)) < 0)
  42.           {
  43.               perror(progname);
  44.  
  45. --- 321,329 -----
  46.   int fd;    /* file descriptor to read from */
  47.   
  48.       if (fname[0] != 0)
  49. + #ifdef MSDOS
  50. +         if ((fd = open(fname, O_RDONLY|O_BINARY)) < 0)
  51. + #else
  52.           if ((fd = open(fname, O_RDONLY)) < 0)
  53.   #endif
  54.           {
  55. ***************
  56. *** 322,327
  57.   
  58.       if (fname[0] != 0)
  59.           if ((fd = open(fname, O_RDONLY)) < 0)
  60.           {
  61.               perror(progname);
  62.               exit(1);
  63.  
  64. --- 325,331 -----
  65.           if ((fd = open(fname, O_RDONLY|O_BINARY)) < 0)
  66.   #else
  67.           if ((fd = open(fname, O_RDONLY)) < 0)
  68. + #endif
  69.           {
  70.               perror(progname);
  71.               exit(1);
  72. ---- CUT HERE ----
  73. -- 
  74.       -w---------    Pyramid Technology U.K.       Peter Ruczynski    
  75.     ---www-------    Pyramid House                 #include <std/disclaimer.h>
  76.   -----wwwww-----    Farnborough                   pjr@pyra.co.uk
  77. -------wwwwwww---    Hants GU14 7PL     England.   Wot no funny comment :-)
  78.  
  79.