Fix windows rxReservedNames

This regex is currently matching volumes that include a
reserved word (ex. test-aux-volume)

Signed-off-by: Robert Shade <robert.shade@gmail.com>
This commit is contained in:
Robert Shade 2021-11-05 17:20:58 -04:00
parent c09789c114
commit 502b35c8f6
2 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,7 @@ const (
rxName = `[^\\/:*?"<>|\r\n]+`
// RXReservedNames are reserved names not possible on Windows
rxReservedNames = `(con)|(prn)|(nul)|(aux)|(com[1-9])|(lpt[1-9])`
rxReservedNames = `(con|prn|nul|aux|com[1-9]|lpt[1-9])`
// rxPipe is a named path pipe (starts with `\\.\pipe\`, possibly with / instead of \)
rxPipe = `[/\\]{2}.[/\\]pipe[/\\][^:*?"<>|\r\n]+`

View File

@ -22,6 +22,7 @@ func TestWindowsParseMountRaw(t *testing.T) {
`c:\program files:d:\s p a c e i n h o s t d i r`,
`0123456789name:d:`,
`MiXeDcAsEnAmE:d:`,
`test-aux-volume:d:`, // includes reserved word, but is not one itself
`name:D:`,
`name:D::rW`,
`name:D::RW`,