home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1609 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  903 b 

  1. From: rogers@sud509.ed.ray.com (Andrew Rogers)
  2. Newsgroups: alt.sources
  3. Subject: Patch for PCAL (problems finding ~/calendar)
  4. Message-ID: <1818@sud509.ed.ray.com>
  5. Date: 20 Jul 90 19:02:21 GMT
  6.  
  7. It has come to my attention that the newest Pcal doesn't work on all Un*x
  8. systems - apparently because not all file systems automatically translate "~".
  9. If this is the case with yours (symptoms: calendar data file must be explicitly
  10. included with the -f option in order to be found), patch it as follows:
  11.  
  12. Andrew
  13. ------------------------------- cut here --------------------------------
  14. #
  15. ed pcal.c << 'EOF'
  16. 277a
  17. #else
  18.     else if (nocal == FALSE) {
  19.         char buf[80], *p;
  20.         extern char *getenv();
  21.  
  22.         *buf = '\0';
  23.         if ((p = getenv("HOME")) != NULL) {
  24.             strcpy(buf, p);
  25.             strcat(buf, "/");
  26.         }
  27.         strcat(buf, INFILE);
  28.         cfp = fopen(buf, "r");
  29.     }
  30. #endif
  31. .
  32. 275a
  33. #ifdef VMS
  34. .
  35. 69c
  36. #define INFILE  "calendar"
  37. .
  38. w
  39. q
  40. 'EOF'
  41.