opnsense-ports/net/syncthing-cli/files/patch-utils.go
Franco Fichtner 69b48d3f1e */*: sync with upstream
Taken from: FreeBSD
2015-09-10 05:23:56 +02:00

11 lines
517 B
Go

--- utils.go
+++ utils.go
@@ -146,7 +146,7 @@ func validAddress(input string) {
if len(tokens) != 2 {
die(input + " is not a valid value for an address\nExpected format <ip or hostname>:<port>")
}
- matched, err := regexp.MatchString("^[a-zA-Z0-9]+([a-zA-Z0-9.]+[a-zA-Z0-9]+)?$", tokens[0])
+ matched, err := regexp.MatchString("^[a-zA-Z0-9]+([-a-zA-Z0-9.]+[-a-zA-Z0-9]+)?$", tokens[0])
die(err)
if !matched {
die(input + " is not a valid value for an address\nExpected format <ip or hostname>:<port>")