diff options
author | Richard Jones <rjones@redhat.com> | 2009-10-26 09:12:12 +0000 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-10-26 15:09:20 +0000 |
commit | aa7ca27e4be1fd38a1eff4d24974f053080a9704 (patch) | |
tree | 9b3b388bd903f1f024d0e035d08f99da30b8a154 /perl/lib/Sys | |
parent | ec02f0da1550e37acd95d615ff4fcf88569bcf2c (diff) | |
download | libguestfs-aa7ca27e4be1fd38a1eff4d24974f053080a9704.tar.gz libguestfs-aa7ca27e4be1fd38a1eff4d24974f053080a9704.tar.xz libguestfs-aa7ca27e4be1fd38a1eff4d24974f053080a9704.zip |
Modify Sys::Guestfs::Lib::resolve_windows_path to use case_sensitive_path.
Diffstat (limited to 'perl/lib/Sys')
-rw-r--r-- | perl/lib/Sys/Guestfs/Lib.pm | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm index 8ea2c1bf..549916f5 100644 --- a/perl/lib/Sys/Guestfs/Lib.pm +++ b/perl/lib/Sys/Guestfs/Lib.pm @@ -267,38 +267,12 @@ by C</> characters. Do not use C<\>, drive names, etc. sub resolve_windows_path { - local $_; my $g = shift; my $path = shift; - if (substr ($path, 0, 1) ne "/") { - warn __"resolve_windows_path: path must start with a / character"; - return undef; - } - - my @elems = split (/\//, $path); - shift @elems; - - # Start reconstructing the path at the top. - $path = "/"; - - foreach my $dir (@elems) { - my $found = 0; - foreach ($g->ls ($path)) { - if (lc ($_) eq lc ($dir)) { - if ($path eq "/") { - $path = "/$_"; - $found = 1; - } else { - $path = "$path/$_"; - $found = 1; - } - } - } - return undef unless $found; - } - - return $path; + my $r; + eval { $r = $g->case_sensitive_path ($path); }; + return $r; } =head2 file_architecture |