diff options
author | rsc <devnull@localhost> | 2004-12-27 01:16:26 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-12-27 01:16:26 +0000 |
commit | 6d7fdb243ca2611e31648d57c8b3ac4101407cfa (patch) | |
tree | c06f6a7764885fd4b4d15eb776c77fb4fc505b0b /src/cmd/acme/acme.c | |
parent | 334cb1e91ceb2d667c1cfd0b71aa9801bef089ec (diff) | |
download | plan9port-6d7fdb243ca2611e31648d57c8b3ac4101407cfa.tar.gz plan9port-6d7fdb243ca2611e31648d57c8b3ac4101407cfa.tar.bz2 plan9port-6d7fdb243ca2611e31648d57c8b3ac4101407cfa.zip |
changes from plan 9
Diffstat (limited to 'src/cmd/acme/acme.c')
-rw-r--r-- | src/cmd/acme/acme.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c index 14d17e2c..ee8bf150 100644 --- a/src/cmd/acme/acme.c +++ b/src/cmd/acme/acme.c @@ -113,6 +113,9 @@ threadmain(int argc, char *argv[]) exits("usage"); }ARGEND + fontnames[0] = estrdup(fontnames[0]); + fontnames[1] = estrdup(fontnames[1]); + quotefmtinstall(); cputype = getenv("cputype"); objtype = getenv("objtype"); @@ -218,9 +221,7 @@ threadmain(int argc, char *argv[]) #define WPERCOL 8 disk = diskinit(); - if(loadfile) - rowload(&row, loadfile, TRUE); - else{ + if(!loadfile || !rowload(&row, loadfile, TRUE)){ rowinit(&row, screen->clipr); if(ncol < 0){ if(argc == 0) @@ -859,7 +860,7 @@ rfget(int fix, int save, int setfont, char *name) } r = emalloc(sizeof(Reffont)); r->f = f; - fontcache = realloc(fontcache, (nfontcache+1)*sizeof(Reffont*)); + fontcache = erealloc(fontcache, (nfontcache+1)*sizeof(Reffont*)); fontcache[nfontcache++] = r; } Found: @@ -868,8 +869,10 @@ rfget(int fix, int save, int setfont, char *name) if(reffonts[fix]) rfclose(reffonts[fix]); reffonts[fix] = r; - free(fontnames[fix]); - fontnames[fix] = name; + if(fontnames[fix] != name){ + free(fontnames[fix]); + fontnames[fix] = estrdup(name); + } } if(setfont){ reffont.f = r->f; |