Skip to content

Commit

Permalink
Fixed display bug in utils.windows_ls_entry()
Browse files Browse the repository at this point in the history
  • Loading branch information
p0dalirius committed May 31, 2024
1 parent 0ab1e75 commit 8cf603f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion smbclientng/core/InteractiveShell.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def command_ls(self, arguments, command):
directory_contents = self.smbSession.list_contents(path=' '.join(arguments))

for longname in sorted(directory_contents.keys(), key=lambda x:x.lower()):
windows_ls_entry(directory_contents[longname])
windows_ls_entry(directory_contents[longname], self.config)

@command_arguments_required
@active_smb_connection_needed
Expand Down
6 changes: 4 additions & 2 deletions smbclientng/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ def windows_ls_entry(entry, config, pathToPrint=None):
str: A string representing the metadata of the entry, including attributes like directory, archive, compressed, hidden, normal, readonly, system, and temporary.
"""

if pathToPrint is None:
pathToPrint = entry
if pathToPrint is not None:
pathToPrint = pathToPrint + ntpath.sep + entry.get_longname()
else:
pathToPrint = entry.get_longname()

meta_string = ""
meta_string += ("d" if entry.is_directory() else "-")
Expand Down

0 comments on commit 8cf603f

Please sign in to comment.