Handle potential NULL argument.
Clarify detection of absolute path: handle a case when path starts
with #enc:.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (vfs_dirent_assign): set d_len up.
* (mc_readdir): sync with new vfs_dirent: use d_len member.
* (filename_completion_function): likewise.
* (handle_dirent): likewise.
* (find_ignore_dir_search): add 2nd argument to use length of
directory name if it's known.
* (do_search): sync with modified vfs_dirent and find_ignore_dir_search().
* (NLENGTH): remove.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Add new item to a listbox taking ownerhip of item text
and avoid a string duplication.
(listbox_add_item): reimplement using listbox_add_item_take().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(panel_load_setup): if user's format of file list and status line
are undefined in the ini file, set them to NULL instead of
DEFAULT_USER_FORMAT.
Move definition of DEFAULT_USER_FORMAT macro from panel.h to panel.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(edit_user_menu): fix misinterpretation of return value of
edit_block_delete_cmd(). The bug was introduced in
e2e34d82ab.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Steps to reproduce:
1. Create file owth a space in the name:
touch "a b"
There should no other files with name begins with "a" in the directory.
2. Press Shift-F4 to open editor
3. Press Shift-F2 to display dialog window "Save as..."
4. Press Esc+Tab to fill an input line
Result:
a\ b will appear in the edit field.
If you attempt to save the file, the back slash will be in the filename.
Expected result:
no any extra back slashes in the file name.
Soution: escape only '?', '*', and '&' symbols as described in the
manual page (see a11995e12b).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* 3570_xorriso_slow:
extfs: add test data for the iso9660 extfs helper (xorriso part)
extfs: modify the iso9660 extfs helper to support testing (xorriso part)
Ticket #3570: reimplement xorriso part of iso9660 listing.
When xorriso is installed, iso9660 listing was done with `xorriso .. -lsl ..`
per dir recursively. It was unbearably slow on iso images with lots of subdirs.
For example, it took my machine 2 minutes to open debian-12.5.0-amd64-DVD-1.iso
which contains 2627 dirs. This commit makes use of `xorriso .. -find / -exec
lsdl ..` instead to list the whole directory tree in a single pass.
Also, parsing of xorriso output has been reworked and as a result such
previously missing items became visible in the listing:
- symlinks
- the boot catalog file
ClosesMidnightCommander/mc#196.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (mc_tmpdir): use g_mkdtemp() to create temporary directory.
Make it name unique to avoid conflicts with other software such as
Distrobox container.
* (main): temporary directory has unique name from now. Remove it at exit.
If EOF has been read, don't attempt to seek past it.
Sync with GNU tar 21318f385627a30da5d92811dd80f70abbe80ee7.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>