changes in sorting strings (name, extension), for comparing are created keys
from strings and than their are compared instead of primary strings. (in
reality, keys are created only for case insensitive comparing, case
sensitive compare original strings). In utf-8 shall by keys faster than
compare strings directly. But this need ediding declaration of all sorts
functions.
changes in handlig keys,
if key is ascii characters, is clear what to do. But when key is between 0x80 and
0xff, it is impossible say, if is valid, alpha, number, ...
I think, that will be better support multibytes characters directly in message
handler, but is not necessary and my patch do not do that.
like buttons use menu entries hotkey_t. But menus are staticly defined, so this
change is much bigger. All menu declaration must be edited. follow standard
changes in drawing and handling hotkeys.
now basic mc's functions works in utf-8, remain correct calculation of controls
width in dialogs, replace functions like tolower, toupper,isspace, ... width
functions from strutil or g_ascii variant.
like in input, added multibytes characters buffer for search in panel (ctrl+s)
drawing is simplier, because alignment do directly str_fit_to_term function
from strutil, changed time functions in util to work correctly in utf-8
in input widget I made a lot of changes:
1. rename some members in WInput to reflect more their functions
(field_len -> field_width, ...)
2. buffer for reading multibytes characters - charbuf, (taken from UTF-8
patch)
3. modified insert_char to accept mulstibytes characters, drawing changed
4. works only with valid strings, str_fix_string used to assure that
input->buffer is valid
changes in complete.c:
- some iteration strings with ++/-- replaced with str_next_char,
str_prev_char, where was needed. ++ was offset oriented, but str_next_char
use directly referecne (char *), so result is not extra beatiful in every
cases
- other buffer for multibytes characters
- complete only valid filenames
all options of radio box are stored in an array of hotkey_t, so radio box has own
copy of options now (in original mc has only a reference to options), changed
drawing and handling hotkey
text of button stored in hotkey_t instead of char*, modified achown.c, because
access directly button text, change in drawing button adn handling hotkey
add new structure hotkey_t for storings caption with hotkey in buttons, menus,...
contains three strings - start, hotkey, end. So hotkey could be any characters,
but mc's message handles works correct only with ascii characters.
for me is working with hotkey_t easier than how are stored hotkeys in original
mc.
add functions for working with strings
some functions are implemented directlu in strutil.c, others have ascii, 8bit
or utf-8 variant. (8bit means singlebyte encodings, where all characters have
width one). Mc autodetects terminal encoding at start and chooses right
variant. If does not know terminal encoding, chooses ascii variant.
contains functions:
1. for translation strings and growing strings
2. for working with characters (next char, prev char, length in
characters, isspace, isalnum, ...)
3. prepeare for display, replace invalid characters with questionmark,
unprintable with dot, left / right / center align
4. comparing strings
in future all string function from util should be moved into strutil, some
function from util have new variant in strutil.
Changes:
* removed "" from all operations, because shells do not like it:
$ LANG=C ls "//\ a\ -\>\ b\ \"\"\""
ls: cannot access //\ a\ -\>\ b\ """: No such file or directory
$ [sf] ~:LANG=C ls //\ a\ -\>\ b\ \"\"\"
// a -> b """
* transited to mhl escaping function in vfs/fish.c
* fixed vast majority of FISH ops in respect to special chars
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
!!!WARNING!!!: FISH is still broken
Changes
* fixed sed fallback (added escaping)
* fixed FISH hangup (introduced earlier in perl changes)
* added FISH 500 if perl script dies somehow (no more FISH hangups on dir list path!)
* added '#if 0' in vfs/fish.c:fish_dir_load() - handy to debug
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
- check if remote have a 'test' utility.
If 'test' exists - use it for recognize symlinks (test -L)
and forming "L<symlink>" string in output
- Restore part of source code for handling "L<symlink>"
- check if 'ls' command support option '-Q' and use it if supported
- FIXME: need to write fish_get_unquoted_filename
- FIXME: need to rewrite algorithm of parsing ' -> ' substring
(relative to -Q option)
New logic will correct show symlinks on lot of OSes, but in some
pure OSes need to review...