Write $-free paths in Dump files (Peter Canning).
This commit is contained in:
parent
acb880af1c
commit
de1168dd9c
1 changed files with 10 additions and 4 deletions
|
|
@ -319,7 +319,7 @@ rowdump(Row *row, char *file)
|
||||||
uint q0, q1;
|
uint q0, q1;
|
||||||
Biobuf *b;
|
Biobuf *b;
|
||||||
char *buf, *a, *fontname;
|
char *buf, *a, *fontname;
|
||||||
Rune *r;
|
Rune *r, *rp;
|
||||||
Column *c;
|
Column *c;
|
||||||
Window *w, *w1;
|
Window *w, *w1;
|
||||||
Text *t;
|
Text *t;
|
||||||
|
|
@ -417,11 +417,17 @@ rowdump(Row *row, char *file)
|
||||||
Bwrite(b, buf, strlen(buf));
|
Bwrite(b, buf, strlen(buf));
|
||||||
m = min(RBUFSIZE, w->tag.file->b.nc);
|
m = min(RBUFSIZE, w->tag.file->b.nc);
|
||||||
bufread(&w->tag.file->b, 0, r, m);
|
bufread(&w->tag.file->b, 0, r, m);
|
||||||
|
if(dodollarsigns && r[0] == '$'){
|
||||||
|
rp = runestrdup(r);
|
||||||
|
expandenv(&rp, (uint*)&m);
|
||||||
|
}else
|
||||||
|
rp = r;
|
||||||
n = 0;
|
n = 0;
|
||||||
while(n<m && r[n]!='\n')
|
while(n<m && rp[n]!='\n')
|
||||||
n++;
|
n++;
|
||||||
r[n++] = '\n';
|
Bprint(b, "%.*S\n", n, rp);
|
||||||
Bprint(b, "%.*S", n, r);
|
if(rp != r)
|
||||||
|
free(rp);
|
||||||
if(dumped){
|
if(dumped){
|
||||||
q0 = 0;
|
q0 = 0;
|
||||||
q1 = t->file->b.nc;
|
q1 = t->file->b.nc;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue