[comp.os.minix] shell bug fix

steve@warwick.UUCP (03/10/87)

Well, after much prodding by John, I've finally got 'round to posting
a quick hack to the minix shell to make shell scripts work properly.
Without this the argument lists to shell scripts come out wrong.

In the version of minix I have (*not* the P-H distribution), the shell
comes in files called sh[1-5].c and sh.h which have obviously been
glued together from a collection of more sensibly names files. I have
split my source back into the "original" files, and the below diff
is based on those names. Sorry if this makes fixing it difficult but
that's life.

Well, here goes:-

-------------------------------------------------------------------------------

*** sh.c.old	Tue Mar 10 17:28:31 1987
--- sh.c	Tue Feb 24 19:04:05 1987
***************
*** 127,132
  			cprompt->status &= ~EXPORT;
  			if (newfile(*++argv))
  				exit(1);
  		}
  	}
  	setdash();

--- 127,134 -----
  			cprompt->status &= ~EXPORT;
  			if (newfile(*++argv))
  				exit(1);
+ 			name = *argv;
+ 			argc--;
  		}
  	}
  	setdash();
-------------------------------------------------------------------------------

Simple huh? There is another bug I am aware of connected with the "-c" flag
giving similar symptoms, but I don't have a fix for that yet. Stay tuned...

					Steve.

PS. Apologies for the double signature on a previous posting - we all 
make mistakes.

-- 
_______________________________________________________________________________
|UUCP:	 ...!ukc!warwick!steve			| Steve Rumsby		      |
|JANET:	 steve@uk.ac.warwick.maths		| Maths Institute	      |
|ARPA:	 steve%uk.ac.warwick.maths@ucl-cs.ARPA	| University of Warwick	      |
|BITNET: steve%uk.ac.warwick.maths@UK.AC	| Coventry		      |
|						| CV4 7AL		      |
|PHONE:	 +44 203 523523 x2657			| ENGLAND		      |
-------------------------------------------------------------------------------

"For every problem there is one solution which is simple, neat, and wrong."
								-- H. L. Menken