Patch for PCAL (problems finding ~/calendar)

Andrew Rogers rogers at sud509.ed.ray.com
Sat Jul 21 05:02:21 AEST 1990


It has come to my attention that the newest Pcal doesn't work on all Un*x
systems - apparently because not all file systems automatically translate "~".
If this is the case with yours (symptoms: calendar data file must be explicitly
included with the -f option in order to be found), patch it as follows:

Andrew
------------------------------- cut here --------------------------------
#
ed pcal.c << 'EOF'
277a
#else
	else if (nocal == FALSE) {
		char buf[80], *p;
		extern char *getenv();

		*buf = '\0';
		if ((p = getenv("HOME")) != NULL) {
			strcpy(buf, p);
			strcat(buf, "/");
		}
		strcat(buf, INFILE);
		cfp = fopen(buf, "r");
	}
#endif
.
275a
#ifdef VMS
.
69c
#define INFILE  "calendar"
.
w
q
'EOF'



More information about the Alt.sources mailing list