[8330] in Athena Bugs

home help back first fref pref prev next nref lref last post

Re: decmips 7.3M: man

daemon@ATHENA.MIT.EDU (Calvin Clark)
Fri Oct 4 14:11:39 1991

Date: Fri, 4 Oct 91 14:12:09 -0400
From: Calvin Clark <ckclark@Athena.MIT.EDU>
To: bugs@Athena.MIT.EDU
Cc: mhpower@Athena.MIT.EDU
Reply-To: ckclark@mit.edu
In-Reply-To: [8326]

Also, doing simply a `man -' will make man dump core on the decmips, as
well.  I cleaned up the code a bit, and am presenting my solution to
some of man's problems.  (Bad pun intended.)  Note that this patch can
and should be applied to /source/bsd-4.3/common/ucb/man.c as well.

-Calvin

*** /source/Ultrix-4.2/ucb/man.c	Thu Jun 27 19:17:26 1991
--- man.c	Fri Oct  4 13:50:51 1991
***************
*** 113,118 ****
--- 113,122 ----
  	}
  	argc--, argv++;
  	while (argc > 0 && argv[0][0] == '-') {
+ 		if (strlen(argv[0]) > 2) {
+ 			fprintf(stderr, "Unknown option: %s\n",argv[0]);
+ 			exit(1);
+ 		}
  		switch(argv[0][1]) {
  
  		case 0:
***************
*** 141,146 ****
--- 145,153 ----
  			argc--, argv++;
  			manpath = *argv;
  			break;
+ 		default:
+ 			fprintf(stderr,"Unknown option: %s\n",argv[0]);
+ 			exit(1);
  		}
  		argc--, argv++;
  	}
***************
*** 147,152 ****
--- 154,163 ----
  	if (troffit == 0 && nomore == 0 && !isatty(1))
  		nomore++;
  	section = 0;
+ 	if (argc < 1) {
+ 		fprintf(stderr,"Usage: man [ section ] name ...\n");
+ 		exit(1);
+ 	}
  	do {
  		if (eq(argv[0], "local")) {
  			section = 'l';




home help back first fref pref prev next nref lref last post