Many small edits.

This commit is contained in:
rsc 2005-01-13 04:49:19 +00:00
parent 741f510ce7
commit c8b6342d3c
160 changed files with 2204 additions and 864 deletions

View file

@ -1,9 +1,9 @@
|$PLAN9/bin/rc
MKSHELL=$PLAN9/bin/rc
use-rc:V:
for(i in a b c)
echo $i
|/bin/sh
MKSHELL=/bin/sh
use-sh:V:
for i in a b c
do

View file

@ -91,18 +91,18 @@ cp = wtos(tail, ' '); print("assign %s to %s\n", head->s, cp); free(cp);
*/
setvar(head->s, (void *) tail);
symlook(head->s, S_WESET, (void *)"");
if(strcmp(head->s, "MKSHELL") == 0){
if((err = setshell(tail)) != nil){
SYNERR(hline);
fprint(2, "%s\n", err);
Exit();
break;
}
}
}
if(attr)
symlook(head->s, S_NOEXPORT, (void *)"");
break;
case 'S':
if((err = setshell(tail)) != nil){
SYNERR(hline);
fprint(2, "%s\n", err);
Exit();
break;
}
break;
default:
SYNERR(hline);
fprint(2, "expected one of :<=\n");
@ -144,19 +144,14 @@ rhead(char *line, Word **h, Word **t, int *attr, char **prog)
int n;
Word *w;
if(*line == '|'){
sep = 'S'; /* shell */
p = line+1;
}else{
p = shellt->charin(line,":=<");
if(p == 0)
return('?');
sep = *p;
*p++ = 0;
if(sep == '<' && *p == '|'){
sep = '|';
p++;
}
p = shellt->charin(line,":=<");
if(p == 0)
return('?');
sep = *p;
*p++ = 0;
if(sep == '<' && *p == '|'){
sep = '|';
p++;
}
*attr = 0;
*prog = 0;

View file

@ -41,6 +41,7 @@ initshell(void)
{
shellcmd = stow(shells[0]->name);
shellt = shells[0];
setvar("MKSHELL", shellcmd);
}
void
@ -72,5 +73,6 @@ popshell(void)
shellstack = s->next;
shellt = s->t;
shellcmd = s->w;
setvar("MKSHELL", shellcmd);
free(s);
}