summaryrefslogtreecommitdiff
path: root/libgo/go/mime/multipart/writer.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/mime/multipart/writer.go')
-rw-r--r--libgo/go/mime/multipart/writer.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/libgo/go/mime/multipart/writer.go b/libgo/go/mime/multipart/writer.go
index 97a8897b299..1bff02fa2a0 100644
--- a/libgo/go/mime/multipart/writer.go
+++ b/libgo/go/mime/multipart/writer.go
@@ -85,10 +85,10 @@ func (w *Writer) CreatePart(header textproto.MIMEHeader) (io.Writer, os.Error) {
return p, nil
}
+var quoteEscaper = strings.NewReplacer("\\", "\\\\", `"`, "\\\"")
+
func escapeQuotes(s string) string {
- s = strings.Replace(s, "\\", "\\\\", -1)
- s = strings.Replace(s, "\"", "\\\"", -1)
- return s
+ return quoteEscaper.Replace(s)
}
// CreateFormFile is a convenience wrapper around CreatePart. It creates