Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] Fixed double backslashes in paths printed by module find #57

Merged
merged 1 commit into from
Jun 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading