diff options
Diffstat (limited to 'conf/name.go')
-rw-r--r-- | conf/name.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/conf/name.go b/conf/name.go index 2b42c0e9..1ecb3225 100644 --- a/conf/name.go +++ b/conf/name.go @@ -18,9 +18,11 @@ var reservedNames = []string{ "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9", } -const serviceNameForbidden = "$" -const netshellDllForbidden = "\\/:*?\"<>|\t" -const specialChars = "/\\<>:\"|?*\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x00" +const ( + serviceNameForbidden = "$" + netshellDllForbidden = "\\/:*?\"<>|\t" + specialChars = "/\\<>:\"|?*\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x00" +) var allowedNameFormat = regexp.MustCompile("^[a-zA-Z0-9_=+.-]{1,32}$") @@ -60,6 +62,7 @@ type naturalSortToken struct { maybeString string maybeNumber int } + type naturalSortString struct { originalString string tokens []naturalSortToken |