mirror of
git://git.suckless.org/sbase
synced 2026-01-26 13:43:17 +00:00
ed: Don't clear modflag in shell escapes
The function dowrite() is used for normal writes and for shell escapes and in the second case we don't have the actual file saved to disk.
This commit is contained in:
parent
5364863516
commit
08b8c73dda
3
ed.c
3
ed.c
@ -795,7 +795,8 @@ dowrite(const char *fname, int trunc)
|
||||
if (r)
|
||||
error("input/output error");
|
||||
strcpy(savfname, fname);
|
||||
modflag = 0;
|
||||
if (!sh)
|
||||
modflag = 0;
|
||||
curln = line;
|
||||
if (optdiag)
|
||||
printf("%zu\n", bytecount);
|
||||
|
||||
11
tests/0017-ed.sh
Executable file
11
tests/0017-ed.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
../ed -s /dev/null <<EOF | grep 'file modified' > /dev/null
|
||||
a
|
||||
1
|
||||
2
|
||||
.
|
||||
w !echo
|
||||
q
|
||||
h
|
||||
EOF
|
||||
Loading…
x
Reference in New Issue
Block a user