Torrent.String: Quote raw names
This commit is contained in:
parent
b102ce901a
commit
9ea65d672f
6
t.go
6
t.go
@ -1,6 +1,7 @@
|
|||||||
package torrent
|
package torrent
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anacrolix/missinggo/pubsub"
|
"github.com/anacrolix/missinggo/pubsub"
|
||||||
@ -221,9 +222,10 @@ func (t *Torrent) DownloadAll() {
|
|||||||
func (t *Torrent) String() string {
|
func (t *Torrent) String() string {
|
||||||
s := t.name()
|
s := t.name()
|
||||||
if s == "" {
|
if s == "" {
|
||||||
s = t.infoHash.HexString()
|
return t.infoHash.HexString()
|
||||||
|
} else {
|
||||||
|
return strconv.Quote(s)
|
||||||
}
|
}
|
||||||
return s
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Torrent) AddTrackers(announceList [][]string) {
|
func (t *Torrent) AddTrackers(announceList [][]string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user