Add fix for volume name "C:" missed in merge
This commit is contained in:
parent
9baa37a73c
commit
60517b2594
2 changed files with 12 additions and 2 deletions
|
@ -19,7 +19,13 @@ func preProcessTargets(_ fs.FS, _ *[]string) {
|
|||
// processTarget processes each target in the loop.
|
||||
// In case of non-windows OS it uses the passed filesys to clean the target.
|
||||
func processTarget(filesys fs.FS, target string) string {
|
||||
return filesys.Clean(target)
|
||||
if target != "" && filesys.VolumeName(target) == target {
|
||||
// special case to allow users to also specify a volume name "C:" instead of a path "C:\"
|
||||
target = target + filesys.Separator()
|
||||
} else {
|
||||
target = filesys.Clean(target)
|
||||
}
|
||||
return target
|
||||
}
|
||||
|
||||
// preProcessPaths processes paths before looping.
|
||||
|
|
|
@ -31,7 +31,11 @@ func preProcessTargets(filesys fs.FS, targets *[]string) {
|
|||
// processTarget processes each target in the loop.
|
||||
// In case of windows the clean up of target is already done
|
||||
// in preProcessTargets before the loop, hence this is no-op.
|
||||
func processTarget(_ fs.FS, target string) string {
|
||||
func processTarget(filesys fs.FS, target string) string {
|
||||
if target != "" && filesys.VolumeName(target) == target {
|
||||
// special case to allow users to also specify a volume name "C:" instead of a path "C:\"
|
||||
target = target + filesys.Separator()
|
||||
}
|
||||
return target
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue