Skip to content

Commit

Permalink
Merge pull request #740 from domcleal/abspath-double-slash
Browse files Browse the repository at this point in the history
Permit double slash in absolute/Unix path types
  • Loading branch information
wilson208 committed Mar 16, 2017
2 parents 08d9680 + 0bca139 commit 2a7c2be
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions spec/aliases/absolute_path_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/
/var/tmp
/var/opt/../lib/puppet
/var/opt//lib/puppet
/var/ůťƒ8
/var/ネット
}.each do |value|
Expand Down
1 change: 1 addition & 0 deletions spec/aliases/absolutepath_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//host/windows
/var/tmp
/var/opt/../lib/puppet
/var/opt//lib/puppet
}.each do |value|
describe value.inspect do
let(:params) {{ value: value }}
Expand Down
2 changes: 2 additions & 0 deletions spec/aliases/unixpath_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/Users/helencampbell/workspace/puppetlabs-stdlib
/var/ůťƒ8
/var/ネット
/var//tmp
/var/../tmp
}.each do |value|
describe value.inspect do
let(:params) {{ value: value }}
Expand Down
2 changes: 1 addition & 1 deletion types/unixpath.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# this regex rejects any path component that is a / or a NUL
type Stdlib::Unixpath = Pattern[/^\/([^\/\0]+(\/)?)+$/]
type Stdlib::Unixpath = Pattern[/^\/([^\/\0]+\/*)+$/]

0 comments on commit 2a7c2be

Please sign in to comment.