diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-06-28 23:42:09 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-07-02 17:53:11 +0200 |
commit | c04446327ef24410e6a98eb670674e2b8caabcde (patch) | |
tree | 8bb8ee791e1184ad98fc05560e4c5ad207f343a9 | |
parent | 60052c607011ab09fe204cf5adc0cc9e29b34cdd (diff) | |
download | aerc-c04446327ef24410e6a98eb670674e2b8caabcde.zip |
forward: remove crlf in text body
Remove crlf from the text body when forwarding a message.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
-rw-r--r-- | commands/msg/forward.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/msg/forward.go b/commands/msg/forward.go index bc5953f..8fc34aa 100644 --- a/commands/msg/forward.go +++ b/commands/msg/forward.go @@ -1,6 +1,7 @@ package msg import ( + "bufio" "bytes" "errors" "fmt" @@ -164,7 +165,10 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error { } store.FetchBodyPart(msg.Uid, part, func(reader io.Reader) { buf := new(bytes.Buffer) - buf.ReadFrom(reader) + scanner := bufio.NewScanner(reader) + for scanner.Scan() { + buf.WriteString(scanner.Text() + "\n") + } original.Text = buf.String() // create composer |