home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / utils / bug / 2077 < prev    next >
Encoding:
Text File  |  1992-11-19  |  2.0 KB  |  54 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!thor.sdrc.com!scjones
  3. From: scjones@thor.sdrc.com (Larry Jones)
  4. Subject: Patch bug
  5. Message-ID: <9211191755.AA03518@thor.sdrc.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Thu, 19 Nov 1992 07:55:25 GMT
  10. Approved: bug-gnu-utils@prep.ai.mit.edu
  11. Lines: 41
  12.  
  13. Patch has a problem patching a read-only file with a 14
  14. character name on a file system that only supports 14 character
  15. names.  Since the file is read-only, patch tries to find an RCS
  16. or SCCS file to check out.  Unfortunately, the generated RCS
  17. file name, when truncated to 14 characters, is the same as the
  18. original file name so patch thinks it has found an RCS file and
  19. tries to do RCS stuff which then fails.  The following diff
  20. (against the 12u8 version) fixes this problem by checking that
  21. the RCS file is not the same as the original file before trying
  22. to process it.
  23.  
  24. *** inp.c.old    Thu Nov 19 12:04:18 1992
  25. --- inp.c    Thu Nov 19 12:06:02 1992
  26. ***************
  27. *** 109,117 ****
  28.       strncpy(s, filename, pathlen);
  29.   
  30.   #define try(f, a1, a2) (Sprintf(s + pathlen, f, a1, a2), stat(s, &cstat) == 0)
  31. !     if (   try("RCS/%s%s", filebase, RCSSUFFIX)
  32. !         || try("RCS/%s"  , filebase,         0)
  33. !         || try(    "%s%s", filebase, RCSSUFFIX)) {
  34.           Sprintf(buf, CHECKOUT, filename);
  35.           Sprintf(lbuf, RCSDIFF, filename);
  36.           cs = "RCS";
  37. --- 109,119 ----
  38.       strncpy(s, filename, pathlen);
  39.   
  40.   #define try(f, a1, a2) (Sprintf(s + pathlen, f, a1, a2), stat(s, &cstat) == 0)
  41. !     if ((   try("RCS/%s%s", filebase, RCSSUFFIX)
  42. !          || try("RCS/%s"  , filebase,         0)
  43. !          || try(    "%s%s", filebase, RCSSUFFIX)) &&
  44. !         (   filestat.st_dev != cstat.st_dev
  45. !          || filestat.st_ino != cstat.st_ino)) {
  46.           Sprintf(buf, CHECKOUT, filename);
  47.           Sprintf(lbuf, RCSDIFF, filename);
  48.           cs = "RCS";
  49. ----
  50. Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
  51. larry.jones@sdrc.com  or  ...uunet!sdrc!larry.jones
  52. Hmm... That might not be politic. -- Calvin
  53.  
  54.