diff options
| author | Eli Zaretskii | 2023-08-08 22:18:46 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2023-08-08 22:18:46 +0300 |
| commit | dd1d8414b33fe620cf21361a4f089d5f14ff454c (patch) | |
| tree | bc0e473c874f043e422f51f541320a2210e8047a /src | |
| parent | 50649a6d1a208b7814a5fc9f0c882442502311e6 (diff) | |
| download | emacs-dd1d8414b33fe620cf21361a4f089d5f14ff454c.tar.gz emacs-dd1d8414b33fe620cf21361a4f089d5f14ff454c.zip | |
Fix insert-file-contents with pipes and /dev/stdin
* src/fileio.c (Finsert_file_contents): Restore logic of
non-regular but seekable files. (Bug#65156)
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c index 995e4142f58..55132f1ec38 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -4581,7 +4581,7 @@ by calling `format-decode', which see. */) | |||
| 4581 | goto handled; | 4581 | goto handled; |
| 4582 | } | 4582 | } |
| 4583 | 4583 | ||
| 4584 | if (seekable || !NILP (end)) | 4584 | if ((seekable && regular) || !NILP (end)) |
| 4585 | total = end_offset - beg_offset; | 4585 | total = end_offset - beg_offset; |
| 4586 | else | 4586 | else |
| 4587 | /* For a special file, all we can do is guess. */ | 4587 | /* For a special file, all we can do is guess. */ |
| @@ -4678,7 +4678,7 @@ by calling `format-decode', which see. */) | |||
| 4678 | For a special file, where TOTAL is just a buffer size, | 4678 | For a special file, where TOTAL is just a buffer size, |
| 4679 | so don't bother counting in HOW_MUCH. | 4679 | so don't bother counting in HOW_MUCH. |
| 4680 | (INSERTED is where we count the number of characters inserted.) */ | 4680 | (INSERTED is where we count the number of characters inserted.) */ |
| 4681 | if (seekable || !NILP (end)) | 4681 | if ((seekable && regular) || !NILP (end)) |
| 4682 | how_much += this; | 4682 | how_much += this; |
| 4683 | inserted += this; | 4683 | inserted += this; |
| 4684 | } | 4684 | } |