Skip to content

Commit

Permalink
Fixed double backslashes in paths printed by module find
Browse files Browse the repository at this point in the history
  • Loading branch information
p0dalirius committed Jun 22, 2024
1 parent 7f91439 commit 45db71d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions smbclientng/core/SMBSession.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,13 @@ def recurse_action(paths=[], depth=0, callback=None):

for entry in entries:
if entry.is_directory():
callback(entry, path + ntpath.sep + entry.get_longname() + ntpath.sep, depth)
fullpath = path + ntpath.sep + entry.get_longname() + ntpath.sep
next_directories_to_explore.append(fullpath)
else:
callback(entry, path + ntpath.sep + entry.get_longname(), depth)

# Next directories to explore
for entry in entries:
if entry.is_directory():
next_directories_to_explore.append(path + ntpath.sep + entry.get_longname() + ntpath.sep)

fullpath = path + ntpath.sep + entry.get_longname()
fullpath = re.sub(r'\\\\+', r'\\', fullpath)
callback(entry, fullpath, depth)

return next_directories_to_explore
#
if callback is not None:
Expand Down

0 comments on commit 45db71d

Please sign in to comment.