aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/mk
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-15 20:54:41 +0000
committerrsc <devnull@localhost>2005-01-15 20:54:41 +0000
commit3300f9cd89202e417dee8f1799e88f955d75ac89 (patch)
treecc97f4b001e8bb1da1d29e147085e452be39c68b /src/cmd/mk
parent5ad21e86207dd42295733010dd448b51a614b611 (diff)
downloadplan9port-3300f9cd89202e417dee8f1799e88f955d75ac89.tar.gz
plan9port-3300f9cd89202e417dee8f1799e88f955d75ac89.tar.bz2
plan9port-3300f9cd89202e417dee8f1799e88f955d75ac89.zip
Long-standing bug in syminit, tickled by placing
initshell before syminit. Don't understand why syminit exists at all.
Diffstat (limited to 'src/cmd/mk')
-rw-r--r--src/cmd/mk/main.c2
-rw-r--r--src/cmd/mk/symtab.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/cmd/mk/main.c b/src/cmd/mk/main.c
index 645eb7ae..28e50c01 100644
--- a/src/cmd/mk/main.c
+++ b/src/cmd/mk/main.c
@@ -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();
diff --git a/src/cmd/mk/symtab.c b/src/cmd/mk/symtab.c
index 6f7b8886..06a4d146 100644
--- a/src/cmd/mk/symtab.c
+++ b/src/cmd/mk/symtab.c
@@ -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;
}
}