Long-standing bug in syminit, tickled by placing
initshell before syminit. Don't understand why syminit exists at all.
This commit is contained in:
parent
5ad21e8620
commit
3300f9cd89
2 changed files with 5 additions and 3 deletions
|
|
@ -39,7 +39,6 @@ main(int argc, char **argv)
|
|||
* instead of sharing them
|
||||
*/
|
||||
|
||||
initshell();
|
||||
Binit(&bout, 1, OWRITE);
|
||||
buf = newbuf();
|
||||
whatif = 0;
|
||||
|
|
@ -120,6 +119,7 @@ main(int argc, char **argv)
|
|||
iflag = 1;
|
||||
usage();
|
||||
syminit();
|
||||
initshell();
|
||||
initenv();
|
||||
usage();
|
||||
|
||||
|
|
|
|||
|
|
@ -7,11 +7,13 @@ static Symtab *hash[NHASH];
|
|||
void
|
||||
syminit(void)
|
||||
{
|
||||
Symtab **s, *ss;
|
||||
Symtab **s, *ss, *next;
|
||||
|
||||
for(s = hash; s < &hash[NHASH]; s++){
|
||||
for(ss = *s; ss; ss = ss->next)
|
||||
for(ss = *s; ss; ss = next){
|
||||
next = ss->next;
|
||||
free((char *)ss);
|
||||
}
|
||||
*s = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue