mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Make Native globbing on UNIX return an absolute path when it is given an absolute path (#7106)
Fix #7089. Native globbing on UNIX was turning absolute paths into relative paths when it shouldn't. The code suppresses generating a relative path for paths starting with '~'. It also need to do the same for paths starting with '/'.
This commit is contained in:
committed by
Travis Plunk
parent
f858e6d207
commit
0c11582e6c
@@ -47,7 +47,13 @@ Describe 'Native UNIX globbing tests' -tags "CI" {
|
||||
|
||||
$a = $v,$v
|
||||
/bin/ls $a[1] | Should -Match "abc.txt"
|
||||
}
|
||||
}
|
||||
# Test globbing with absolute paths - it shouldn't turn absolute paths into relative paths (#7089)
|
||||
It 'Should not normalize absolute paths' {
|
||||
$matches = /bin/echo /etc/*
|
||||
# Matched path should start with '/etc/' not '../..'
|
||||
$matches.substring(0,5) | Should Be '/etc/'
|
||||
}
|
||||
It 'Globbing should not happen with quoted expressions' {
|
||||
$v = "$TESTDRIVE/abc*"
|
||||
/bin/echo "$v" | Should -BeExactly $v
|
||||
|
||||
Reference in New Issue
Block a user