aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg/forward.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-06-28 23:42:09 +0200
committerRobin Jarry <robin@jarry.cc>2022-07-02 17:53:11 +0200
commitc04446327ef24410e6a98eb670674e2b8caabcde (patch)
tree8bb8ee791e1184ad98fc05560e4c5ad207f343a9 /commands/msg/forward.go
parent60052c607011ab09fe204cf5adc0cc9e29b34cdd (diff)
downloadaerc-c04446327ef24410e6a98eb670674e2b8caabcde.tar.gz
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>
Diffstat (limited to 'commands/msg/forward.go')
-rw-r--r--commands/msg/forward.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/msg/forward.go b/commands/msg/forward.go
index bc5953f5..8fc34aa7 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