leave +nnnn doesn't work at all

support at UCI-750A.ARPA support at UCI-750A.ARPA
Wed Aug 1 03:27:27 AEST 1984


From:  Support Group (agent: Richard Johnson) <support at UCI-750A.ARPA>


Description:
	Leave doesn't work if you specify the time using the "+" syntax.
	When the bug causing this is fixed, it gives a bogus error message.
Repeat-By:
	Type "leave +1".  You'll never see the warning.
Fix:
	Diff listing follows:
	(We install all bug fixes so that compiling with "-DUCI" is needed
	 to compile them in.  Ignore the ifdef's.)

	*** bk_leave.c	Thu Mar 31 11:57:12 1983
	--- leave.c	Fri Jul 20 19:10:06 1984
	***************
	*** 1,4
	  static char *sccsid = "@(#)leave.c	4.3 (Berkeley) 3/31/83";
	  #include <stdio.h>
	  #include <signal.h>
	  /*
	
	--- 1,12 -----
	  static char *sccsid = "@(#)leave.c	4.3 (Berkeley) 3/31/83";
	+ /* UCICHANGES (enabled via -DUCI):
	+ 
	+ 0) Fri Jul 20 19:08:21 1984 Sources (agent: Richard Johnson)
	+ 	Leave doesn't ever print a message if you use the "+nnnn" syntax.
	+ 	Even if it did, then it would give a bogus error.
	+ 	(ucb/leave.c)
	+ 
	+  */
	  #include <stdio.h>
	  #include <signal.h>
	  /*
	***************
	*** 32,37
	  
	  	if (buff[0] == '\n')
	  		exit(0);
	  	if (buff[0] == '+') {
	  		diff = atoi(buff+1);
	  		doalarm(diff);
	
	--- 40,48 -----
	  
	  	if (buff[0] == '\n')
	  		exit(0);
	+ #ifdef	UCI
	+ 	strcpy(origlogin,getlogin());
	+ #endif	UCI
	  	if (buff[0] == '+') {
	  		diff = atoi(buff+1);
	  		doalarm(diff);
	***************
	*** 35,40
	  	if (buff[0] == '+') {
	  		diff = atoi(buff+1);
	  		doalarm(diff);
	  	}
	  	if (buff[0] < '0' || buff[0] > '9') {
	  		printf("usage: %s [hhmm]\n",argv[0]);
	
	--- 46,54 -----
	  	if (buff[0] == '+') {
	  		diff = atoi(buff+1);
	  		doalarm(diff);
	+ #ifdef	UCI
	+ 		exit(0);
	+ #endif	UCI
	  	}
	  	if (buff[0] < '0' || buff[0] > '9') {
	  		printf("usage: %s [hhmm]\n",argv[0]);
	***************
	*** 40,45
	  		printf("usage: %s [hhmm]\n",argv[0]);
	  		exit(1);
	  	}
	  	strcpy(origlogin,getlogin());
	  
	  	tod = atoi(buff);
	
	--- 54,60 -----
	  		printf("usage: %s [hhmm]\n",argv[0]);
	  		exit(1);
	  	}
	+ #ifndef	UCI
	  	strcpy(origlogin,getlogin());
	  #endif	UCI
	  
	***************
	*** 41,46
	  		exit(1);
	  	}
	  	strcpy(origlogin,getlogin());
	  
	  	tod = atoi(buff);
	  	hours = tod / 100;
	
	--- 56,62 -----
	  	}
	  #ifndef	UCI
	  	strcpy(origlogin,getlogin());
	+ #endif	UCI
	  
	  	tod = atoi(buff);
	  	hours = tod / 100;



More information about the Comp.unix.wizards mailing list