Hello 
 
I'm not really sure if it's mc problem.
Trying to match files with spaces in name. This fails with foreign chars...but strange...just in mc.
I'm using:
 
$ mc -V
GNU Midnight Commander 4.8.22
Kompiliert mit GLib 2.58.2
Benutze die S-Lang Bibliothek mit der terminfo-Datenbank
Mit eingebautem Editor
Mit optionaler Subshell-Unterstützung als Standard
Mit Unterstützung für Hintergrundtätigkeiten
Mit Maus-Unterstützung im xterm und der Linux-Konsole
Mit Unterstützung für X11-Ereignisse
Mit Internationalisierungs-Unterstützung
Mit mehrfach Codepage-Unterstützung
Virtuelles Dateisystem: cpiofs, tarfs, sfs, extfs, ext2undelfs, ftpfs, sftpfs, fish
Datentyp: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
  Operating System: Debian GNU/Linux 10 (buster)
            Kernel: Linux 4.19.0-27-amd64
      Architecture: x86-64
$ locale
LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=

Here my mc user menu:
################################
shell_patterns=0
+? f [[:space:]] & t r
R Rename - Replace " " in Name
        rename 's/ /\./g' %f -v
################################
case 1:
filename='file_without_spaces'
debug=Falsch: f [[:space:]]
result=works as expected
 
case 2:
filename='file with spaces'
debug=Wahr: f [[:space:]]
result=works as expected
 
case 3:
filename='file_without_spaces_utf8_local_chars_ä_ü_ö_ß_'
debug=Falsch: f [[:space:]]
result=works as expected
 
case 4:
filename='file_without_spaces_utf8_nonlocal_chars_à_á_'
debug=Wahr: f [[:space:]]
result=works NOT as expected (WRONG)
 
On the otherside on the bash level everything works as expected:
 
$ var='file_without_spaces'
$ [[ $var =~ [[:space:]] ]] && echo "var has spaces" || echo "var has NO spaces"
var has NO spaces
 
$ var='file with spaces'
$ [[ $var =~ [[:space:]] ]] && echo "var has spaces" || echo "var has NO spaces"
var has spaces
 
$ var='file_without_spaces_utf8_local_chars_ä_ü_ö_ß_'
$ [[ $var =~ [[:space:]] ]] && echo "var has spaces" || echo "var has NO spaces"
var has NO spaces
 
$ var='file_without_spaces_utf8_nonlocal_chars_à_á_'
$ [[ $var =~ [[:space:]] ]] && echo "var has spaces" || echo "var has NO spaces"
var has NO spaces
 
Using the pattern "\s" as replacement for "[[:space:]]": the same problems.

Much more in mc user menu setting the match pattern as :
 
+? f à & t r
 
filename='file_without_spaces_utf8_nonlocal_chars_à_á_'
debug=Wahr: f à
result=works as expected
 
Any hint? Thank You in advance
Eugen
-- 
mc mailing list
[email protected]
https://lists.midnight-commander.org/mailman/listinfo/mc

Reply via email to