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
|
* instead of sharing them
|
||||||
*/
|
*/
|
||||||
|
|
||||||
initshell();
|
|
||||||
Binit(&bout, 1, OWRITE);
|
Binit(&bout, 1, OWRITE);
|
||||||
buf = newbuf();
|
buf = newbuf();
|
||||||
whatif = 0;
|
whatif = 0;
|
||||||
|
|
@ -120,6 +119,7 @@ main(int argc, char **argv)
|
||||||
iflag = 1;
|
iflag = 1;
|
||||||
usage();
|
usage();
|
||||||
syminit();
|
syminit();
|
||||||
|
initshell();
|
||||||
initenv();
|
initenv();
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,13 @@ static Symtab *hash[NHASH];
|
||||||
void
|
void
|
||||||
syminit(void)
|
syminit(void)
|
||||||
{
|
{
|
||||||
Symtab **s, *ss;
|
Symtab **s, *ss, *next;
|
||||||
|
|
||||||
for(s = hash; s < &hash[NHASH]; s++){
|
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);
|
free((char *)ss);
|
||||||
|
}
|
||||||
*s = 0;
|
*s = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue