acme: do not trim spaces during Put

The commit that introduced this was pushed accidentally.
It is not a good idea to do this.
(It breaks programs that think that a clean window
means the body matches the on-disk file.)
This commit is contained in:
Russ Cox 2019-04-19 22:24:53 -04:00
parent 9179fdaaf4
commit 3197719090

View file

@ -783,7 +783,11 @@ putfile(File *f, int q0, int q1, Rune *namer, int nname)
n = BUFSIZE/UTFmax;
bufread(&f->b, q, r, n);
nn = n;
if(w->autoindent)
// An attempt at automatically trimming trailing spaces.
// Breaks programs that inspect body file and think it will match on-disk file
// when window is clean. Should apply the changes to the actual window instead.
// Later.
if(0 && w->autoindent)
nn = trimspaces(r, &n, q+n==q1);
m = snprint(s, BUFSIZE+1, "%.*S", nn, r);
sha1((uchar*)s, m, nil, h);