[libcatmandu-perl] 86/101: os independent paths in tests
Jonas Smedegaard
dr at jones.dk
Tue Feb 23 13:43:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libcatmandu-perl.
commit ccaab5aa3c65b3866dfe2e01906b9a29d3c2185d
Author: Nicolas Steenlant <nicolas.steenlant at ugent.be>
Date: Wed Feb 10 13:34:03 2016 +0100
os independent paths in tests
---
lib/Catmandu/Util.pm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/Catmandu/Util.pm b/lib/Catmandu/Util.pm
index d7bef7d..612c54d 100644
--- a/lib/Catmandu/Util.pm
+++ b/lib/Catmandu/Util.pm
@@ -162,14 +162,16 @@ sub read_json {
sub join_path {
my $path = File::Spec->catfile(@_);
- normalize_path($path);
+ $path =~ s!/\./!/!g;
+ while ($path =~ s![^/]*/\.\./!!) {}
+ $path;
}
sub normalize_path { # taken from Dancer::FileUtils
my ($path) = @_;
$path =~ s!/\./!/!g;
while ($path =~ s![^/]*/\.\./!!) {}
- $path;
+ File::Spec->catfile($path);
}
sub segmented_path {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-perl.git
More information about the Pkg-perl-cvs-commits
mailing list