Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add Device::Cdio::ISO9660::IFS::find_lsn. Had already same routine in…

… Device::Cdio::FS.

IFS and FS should not assume Device::Cdio::ISO960 is used.
  • Loading branch information...
commit 389ed6d8bda94d41c79e7e0d37e48c5f5fc947e6 1 parent ea91ea5
R. Bernstein authored
View
2  lib/Device/Cdio/ISO9660.pm
@@ -82,7 +82,7 @@ use Device::Cdio::Util qw( _check_arg_count _extra_args _rearrange );
@ISA = qw(Exporter);
@EXPORT = qw( dirname_valid_p is_achar is_dchar pathame_valid_p
- name_translate strncpy_pad %check );
+ name_translate strncpy_pad %check &stat_array_to_href);
%Device::Cdio::ISO9660::check = (
'nocheck' => $perliso9660::NOCHECK,
View
2  lib/Device/Cdio/ISO9660/FS.pm
@@ -1,7 +1,7 @@
package Device::Cdio::ISO9660::FS;
+use Device::Cdio::ISO9660;
require 5.8.6;
#
-# $Id$
# See end for copyright and license.
=pod
View
5 lib/Device/Cdio/ISO9660/IFS.pm
@@ -1,7 +1,7 @@
package Device::Cdio::ISO9660::IFS;
+use Device::Cdio::ISO9660;
require 5.8.6;
#
-# $Id$
# See end for copyright and license.
=pod
@@ -188,6 +188,9 @@ sub find_lsn {
return undef;
}
my @values = perliso9660::ifs_find_lsn($self->{iso9660}, $lsn);
+ # Remove the two input parameters
+ splice(@values, 0, 2) if @values > 2;
+
return Device::Cdio::ISO9660::stat_array_to_href(@values);
}
View
10 swig/perliso9660.swg
@@ -535,20 +535,18 @@ bool iso9660_pathname_valid_p (const char psz_path[]);
Returns stat_t of entry if we found lsn, or NULL otherwise.
*/
-%rename iso9660_find_fs_lsn fs_find_lsn;
-IsoStat_t *iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn);
+%rename iso9660_fs_find_lsn fs_find_lsn;
+IsoStat_t *iso9660_fs_find_lsn(CdIo_t *p_cdio, lsn_t i_lsn);
-#if LIBCDIO_VERSION_NUM > 76
/*!
Given a directory pointer, find the filesystem entry that contains
lsn and return information about it.
Returns stat_t of entry if we found lsn, or NULL otherwise.
*/
-%rename iso9660_find_ifs_lsn ifs_find_lsn;
-IsoStat_t *iso9660_find_ifs_lsn(const iso9660_t *p_iso, lsn_t i_lsn);
-#endif
+%rename iso9660_ifs_find_lsn ifs_find_lsn;
+IsoStat_t *iso9660_ifs_find_lsn(iso9660_t *p_iso, lsn_t i_lsn);
/*!
View
6 t/07.iso1.t
@@ -18,7 +18,7 @@ use Device::Cdio::ISO9660;
use Device::Cdio::ISO9660::IFS;
use File::Spec;
-use Test::More tests => 5;
+use Test::More tests => 6;
note 'Test ISO9660::IFS routines';
# The test ISO 9660 image
@@ -47,4 +47,8 @@ my @okay_stats = (
);
is_deeply(\@file_stats, \@okay_stats, 'ISO 9660 file stats');
+
+my $copy_stat = $iso->find_lsn(24);
+is_deeply($copy_stat, $okay_stats[2], "Finding stat for root (24)");
+
$iso->close();
Please sign in to comment.
Something went wrong with that request. Please try again.