Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site elsie.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!zehntel!hplabs!hao!seismo!rlgvax!cvl!elsie!ado
From: ado@elsie.UUCP
Newsgroups: net.unix-wizards
Subject: Re: leave +nnnn doesn't work at all
Message-ID: <1142@elsie.UUCP>
Date: Fri, 3-Aug-84 12:03:44 EDT
Article-I.D.: elsie.1142
Posted: Fri Aug  3 12:03:44 1984
Date-Received: Mon, 6-Aug-84 00:46:04 EDT
References: <580@sri-arpa.UUCP>
Organization: NIH-LEC, Bethesda, MD
Lines: 148

Before we leave the subject, here are our local changes to the "leave.c" source
as distributed with 4.1BSD.
	1.  A mildly sexist comment has been removed.
	2.  You are reminded of when you want to leave,
	    rather than of when you have to leave.
	3.  You can use a command like
		leave 1700 go to the bank
	    to get a reminder of both when to leave and why.

Lines from the current source file follow.

	#ifdef OLDVERSION
	static char *sccsid = "@(#)leave.c	4.1 (Berkeley) 10/1/80";
	#include 
	/*
	 * leave [hhmm]
	 *
	 * Reminds you when you have to leave.
	 * Leave prompts for input and goes away if you hit return.
	 * It nags you like a mother hen.
	 */
	#else
	static char sccsid[] = "@(#)leave.c	1.3";
	#include 
	/*
	 * leave [hhmm [reminder ...]]
	 *
	 * Reminds you when you want to leave.
	 * Leave prompts for input and goes away if you hit return.
	 * It nags you.
	 */
	int	argcsaved;
	char **	argvsaved;
	#endif
	.
	.
	.
	#ifdef OLDVERSION
		if (argc < 2) {
			printf("When do you have to leave? ");
			fflush(stdout);
			buff[read(0,buff,sizeof buff)] = 0;
		} else {
			strcpy(buff,argv[1]);
		}
	#else
	#include 
		if (argc < 2) {
			register char *	cp;
			static char *	fakeargv[1];

			argcsaved = 0;
			printf("When do you want to leave? ");
			fflush(stdout);
			buff[read(0,buff,sizeof buff)] = 0;
			for (cp = buff; *cp != '\0'; ++cp)
				if (!isdigit(*cp)) {
					argcsaved = 1;
					argvsaved = fakeargv;
					fakeargv[0] = cp + 1;
					break;
				}
		} else {
			strcpy(buff,argv[1]);
			argcsaved = argc - 2;
			argvsaved = argv + 2;
		}
	#endif
	.
	.
	.
	#ifdef OLDVERSION
			printf("usage: %s [hhmm]\n",argv[0]);
	#else
			printf("usage: %s [hhmm [reminder ...]]\n",argv[0]);
	#endif
	.
	.
	.
	#ifdef OLDVERSION
			printf("usage: %s [hhmm]\n",argv[0]);
	#else
			printf("usage: %s [hhmm [reminder ...]]\n",argv[0]);
	#endif
	.
	.
	.
	#ifdef OLDVERSION
		msg1 = "You have to leave in 5 minutes";
	#else
		msg1 = "You want to leave in 5 minutes";
	#endif
	.
	.
	.
	#ifdef OLDVERSION
		printf("%s\n",msg);
	#else
		printf("%s",msg);
		if (argcsaved > 0) {
			register	argnum;

			printf("--");
			for (argnum = 0; argnum < argcsaved; ++argnum) {
				printf("%s",argvsaved[argnum]);
				if (argnum != argcsaved - 1)
					printf(" ");
			}
		}
		printf("\n");
	#endif

And here are lines from the current manual page file:
	leave \- remind you when you want to leave
	.ig
	leave \- remind you when you have to leave
	..
	.SH SYNOPSIS
	.B leave
	[ hhmm [ reminder ... ] ]
	.ig
	[ hhmm ]
	..
	.SH DESCRIPTION
	.I Leave
	waits until the specified time, then reminds you that you
	want to leave.
	.ig
	have to leave.
	..
	.
	.
	.
	.PP
	If you give a
	.IR reminder ,
	it is made part of the message.
	.PP
	If no argument is given,
	.I leave
	prompts with "When do you
	want to leave?". A reply of newline causes
	.ig
	have to leave?". A reply of newline causes
	..
--
	...decvax!allegra!umcp-cs!elsie!ado	(301) 496-5688
	(DEC, VAX and Elsie are Digital Equipment Corp. and Borden's trademarks)