Bug ID 1201122
Summary MidnightCommander no longer performs open or view action on files with multi-byte characters in the filename (at least snapshot 20220702)
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware x86-64
OS openSUSE Tumbleweed
Status NEW
Severity Normal
Priority P5 - None
Component Other
Assignee screening-team-bugs@suse.de
Reporter d_werner@gmx.net
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

mc has an extension file. default:
/etc/mc/mc.ext

in this file actions (open, view) to perform for specific file types are
defined.

E.g. for image files a script
/usr/libexec/mc/ext.d/image.sh open xcf

I noticed with snapshot 20220702 that mc no longer opens files which contain
multi-byte characters in the filename, e.g. test���������.jpg. Files without multi-byte
characters, e.g. test.jpg, can still be opened as before.

This problem was introduced between snapshot 20220613 and 20220702.

In standard configuration images, e.g. jpeg, are opened using
/usr/libexec/mc/ext.d/image.sh.

I made a small adaptation to this file and put it in ~/.local/share/mc/ext.d
and adapted the path in the ~/.config/mc/mc.ext to use this one instead.

The modification is just to record the opening action and the file name:

user@factory:~/.local/share/mc/ext.d$ diff /usr/libexec/mc/ext.d/image.sh
~/.local/share/mc/ext.d/image.sh
9c9,11
< [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
---
> echo "before action $action filetyte $filetype MC_XDG_OPEN ${MC_XDG_OPEN} ${MC_EXT_FILENAME}" >> ~/mc_image.sh_open.txt
> [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="_xdg_open"
> echo "after action $action filetyte $filetype MC_XDG_OPEN ${MC_XDG_OPEN} ${MC_EXT_FILENAME}" >> ~/mc_image.sh_open.txt


Trying to open the 2 files {cover.jpg,cover���������.jpg} (pressing enter when the file
is highlighted in the mc panel) results in the entries as expected in snapshot
20220630 and both file open successfully.
In snapshot 20220702 only the file without multi-byte character appears in the
log output, no call of the script happens for the filename with the multi-byte
character in the filename:

cat mc_image.sh_open.txt
before action open filetyte ALL_FORMATS MC_XDG_OPEN  /home/user/cover.jpg
after action open filetyte ALL_FORMATS MC_XDG_OPEN _xdg_open
/home/user/cover.jpg
before action open filetyte ALL_FORMATS MC_XDG_OPEN  /home/user/cover���������.jpg
after action open filetyte ALL_FORMATS MC_XDG_OPEN _xdg_open
/home/user/cover���������.jpg
---------------^^^ 0613

before action open filetyte ALL_FORMATS MC_XDG_OPEN  /home/user/cover.jpg
after action open filetyte ALL_FORMATS MC_XDG_OPEN _xdg_open
/home/user/cover.jpg
---------------^^^ 0702


Maybe the bug is not in mc itself but in some used library (like f bug 1200688)
or a bug in mc is uncovered by FORTIFY_SOURCE=3.


You are receiving this mail because: