Skip to content

Commit 2a7c2be

Browse files
authored
Merge pull request #740 from domcleal/abspath-double-slash
Permit double slash in absolute/Unix path types
2 parents 08d9680 + 0bca139 commit 2a7c2be

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

spec/aliases/absolute_path_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
/
1616
/var/tmp
1717
/var/opt/../lib/puppet
18+
/var/opt//lib/puppet
1819
/var/ůťƒ8
1920
/var/ネット
2021
}.each do |value|

spec/aliases/absolutepath_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
//host/windows
1616
/var/tmp
1717
/var/opt/../lib/puppet
18+
/var/opt//lib/puppet
1819
}.each do |value|
1920
describe value.inspect do
2021
let(:params) {{ value: value }}

spec/aliases/unixpath_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/Users/helencampbell/workspace/puppetlabs-stdlib
1010
/var/ůťƒ8
1111
/var/ネット
12+
/var//tmp
13+
/var/../tmp
1214
}.each do |value|
1315
describe value.inspect do
1416
let(:params) {{ value: value }}

types/unixpath.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# this regex rejects any path component that is a / or a NUL
2-
type Stdlib::Unixpath = Pattern[/^\/([^\/\0]+(\/)?)+$/]
2+
type Stdlib::Unixpath = Pattern[/^\/([^\/\0]+\/*)+$/]

0 commit comments

Comments
 (0)