Skip to content

Commit 97a540b

Browse files
committed
Small fix to hardlinking to deal with Joliet.
pylint pointed out that we weren't necessarily handling all situations, which isn't quite true. Nevertheless, it is easy enough for us to change this and slightly improve performance along the way. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
1 parent 68cce51 commit 97a540b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pycdlib/pycdlib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3102,16 +3102,16 @@ def _add_hard_link_to_inode(self, data_ino, length, file_mode,
31023102
vd = self.pvd
31033103
rr = self.rock_ridge
31043104
xa = self.xa
3105-
elif joliet_new_path is not None:
3105+
else:
3106+
# Above we checked to make sure we got exactly one new path, so
3107+
# we know for certain that this is Joliet.
31063108
if self.joliet_vd is None:
31073109
raise pycdlibexception.PyCdlibInternalError('Tried to link to Joliet record on non-Joliet ISO')
31083110
# ... to a file on the Joliet filesystem.
31093111
(new_name, new_parent) = self._joliet_name_and_parent_from_path(joliet_new_path)
31103112
vd = self.joliet_vd
31113113
rr = ''
31123114
xa = False
3113-
# Above we checked to make sure we got at least one new path, so we
3114-
# don't need to worry about the else situation here.
31153115

31163116
new_rec = dr.DirectoryRecord()
31173117
new_rec.new_file(vd, length, new_name, new_parent,

0 commit comments

Comments
 (0)