Now \<digit> handle just first 0-9 search groups.
If you need to access to more search groups, need to use
${digits} syntax.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Fixed segfault in file find if MC complied with --disabled-charset.
Fixed wrong search results because of incorrect mc_search_run() argument.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
src/search/glob.c (mc_search__glob_translate_to_regex): added '^'
and '$' symbols to the begin and end of regex respectively to
properly handle shell-style wildcards.
src/cmd: new select/unselect engine.
(reverse_selection_cmd): invert selection for dirs as for files.
(select_unselect_cmd): new dialog. Added "Case sensitive" and "Files
only" checkboxes.
* File version.h will be created (or changed) automatically
* Fixed versions for rpm packages - all '-' changed to '.' in RPM_VERSION variable
* when version.h is changed (or deleted) ./configure script will be invoked
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
There is many places (esp. completion stuff),
whish does stuff like the following:
char * result
while ( (result = do_stuff (&state)) != NULL) {
...
}
Usually do_stuff () uses str_unescape() in function start
and str_escape() at the end. str_escape() hides NULL and
we get endless loop. And g_strdup("") is larger, than NULL :]
Signed-off-by: Sergei Trofimovich <st@anti-virus.by>
Description by Sergei Trofimovich:
GNU ChangeLog? files are result of CVS stupidpity about changeset tracking.
Currently constantly updated ChangeLogs? diverge in different branches and cause collisions(!)
when 'git merge' (almost ANY SINGLE MERGE!).
Major changes can be described in NEWS file, minor changes can be autogenerated via 'git log'/'git shortlog'
and friends (if needed at all).
Also, changes 'normal' search engine - now it wrapper for 'regex' search engine
because old engine don't correct work: search by 'test' success on 'test' or 'TEST'
but fail on 'Test' or 'teSt'. New 'normal' engine work correctly.
(filename_completion_function): tilde_expand() returns a new allocated
string, fixed memleak. Formatting. Small optimization. Type accuracy.
Continue at the end of loop is useless, removed.
(username_completion_function): Type accuracy. Formatting. Small
optimization.
(command_completion_function): Type accuracy. Small optimization.
Fixed bug of previous commit: pointer to freed memory was used.
Disabled by default. This option is available in ini file only.
setup.h: declare mouse_close_dialog variable.
setup.h: read/write mouse_close_dialog variable from/to ini file.
dialog.c: use mouse_close_dialog variable to control the single left click
outside of dialog.
* 130_sysconfdir_mc:
scripts mc.sh, mc.csh, mc-wrapper.csh and mc-wrapper.sh now install into %{libexec}/mc directory
edit/syntax.c: fixed path to Syntax file
Move global config files from pkg_datadir to sysconfdir
Problem arose in freebsd-7.2 system. GCC has 'signed char' there
and thus code like this broke:
> char c = ...;
> if (isprint(c)) ..." // 'signed char' -> 'signed int'
('man isprint' explicitely says to pass 'unsigned char' there)
As we use multibyte chars everywhere - there is not many places to fix.
This patch fixes all 8bit collate functions.
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
configure.ac: Added check for minimal version of Glib2
Since Glib2-2.15 API of file-ini module was changed.
Old API:
void g_key_file_remove_key(...)
New API:
gboolean g_key_file_remove_key(...)
Therefore need to check version of Glib and fix return parameter from mc_config_del_param and mc_config_del_group for success build
Work with ini-file added in Glib2 since version 2.6, therefore in configure.ac added this check.
* 351_show_number_line:
fix hotkey menu entry "Toggle li&ne state" now highlighted "n"
add call CK_Toggle_Line_State to edit menu
show line number in left part of screen (hotkey alt-n)
* mc-4.6:
commandline: strip_escape: strip xterm OSC commands in $PS1
src/main.c (main): create MC home directory with 700 mode instead of 755 one.
src/main.c (main): create MC home directory (~/.mc) if absent.
add option editor_line_status to ini (src/setup.c)
add action CK_Toggle_Line_State (edt/editcmddef.h)
change "print_to_widget()" to show line state, if option_line_state = 1 show line num (edit/editdraw.c)
change "edit_draw_this_line()", (set line state: line num, etc)
add const LINE_STATE_WIDTH, add options: option_line_state, option_line_state_width (edit/edit.h)
add switch on/off show line number (edit/edit.c)
add CK_Toggle_Line_State to translation table command_names (bindings name is Toggle-Line-State).
add const LINE_STATE_COLOR for draw left area bar line state
add color pair "editlinestate" for set in ini
add help for keyword "editlinestate" on "mc --help-color" (src/main.c)
Correctly deal with prompts like (appear in debian/ubuntu):
PS1='\[\e]0;\u@\h: \w\a\]\u@\h:\w\$'
PS1='\[\e]0;\u@\h: \w\e\\\]\u@\h:\w\$'
Based on patch provided provided by Sergey Nizovtsev
https://bugs.launchpad.net/ubuntu/+source/mc/+bug/330633
Signed-off-by: Sergei Trofimovich <st@anti-virus.by>
Here is quote from man(3) mmap:
SUSv3 specifies that mmap() should fail if length is 0. However, in kernels before 2.6.12, mmap()
succeeded in this case: no mapping was created and the call returned addr.
Since kernel 2.6.12, mmap() fails with the error EINVAL for this case.
Thanks to snizovtsev
_icase_search and icase_search stuff has been removed,
because it's not used for now (it is also buggy)
Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
wtools.c:347: assignment from incompatible pointer type
wtools.c:353: assignment from incompatible pointer type
wtools.c:361: assignment from incompatible pointer type
wtools.c:373: assignment from incompatible pointer type
wtools.c:377: assignment from incompatible pointer type
Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
cmd.c:536: ‘c’ may be used uninitialized in this function
At the real position ‘c’ shouldn't be used
Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
* m-utf-8: (223 commits)
Fix wildcard pattern in file select and file find dialogs
Project builds with option --disable-charsets
Deleted build-glib1.sh because glib1 don't work with utf-8
fix building without --enable-charset
Total replacement to mc_search stuff in all places
Search engine: if found_len parameter NULL, then mc_search_run don't try to fill them
src/view.c: Reworked search stuff to usage src/search
refactoring: rename edit/editcmd_dialog.c:editcmd_dialog__get_search_types_list to
Search engine: development of hex search complete
Search engine: remove forgotten debug string and reindent file
Search engine:
configure.ac: if present glib-2.14 and higher, libpcre don't linked
Search engine: now used regexp external engines:
src/find.c: Fixed core dump if content search pattern no present
edit/editcmd_dialogs.c: fixed state of search type between dialog window calls
Find files: checkbox 'Regular expression' for content search now default unchecked
Find files: changes for usage of new search engine:
Fix copy of current/opposite path to command line: remove charset info from path
src/Makefile.am: add some header files to Make-tracking
Fixed editor menu reloading.
to terminal charset.
src/strutil.h: added conv_gerror_message member to str_class structure.
Added str_conv_gerror_message function declaration.
src/strutil.c (str_conv_gerror_message): new function to convert GError
message to terminal charset.
src/strutil8bit.c (str_8bit_conv_gerror_message): new function to convert GError
message to terminal charset for 8-bit locales.
src/strutilascii.c (str_ascii_conv_gerror_message): new function to convert GError
message to terminal charset for 7-bit locales.
src/strutilutf8.c (str_utf8_conv_gerror_message): new function to convert GError
message to terminal charset for utf-8 locales.
replace dialog:
* removed 'replace order' field
* removed 'scanf' and 'regex' chackboxes
* added selectbox element for choise type of search
* confirm replace and 'replace all' now radiobuttons
search dialog:
* removed 'replace order' field
* removed 'scanf' and 'regex' chackboxes
* added selectbox element for choise type of search
(button_callback): use draw_hotkey function to draw button text.
(radio_callback): use draw_hotkey function to draw radiobutton text.
(check_callback): use draw_hotkey function to draw checkbutton text.
* 'm-utf-8' of ssh://www.midnight-commander.org:2222/git/mc:
Fixed coredump in editor after help call.
src/menu.c (create_menu): don't translate menu entry text if ENABLE_NLS isn't defined.
src/strutil.h: created align_crt_t type for string alignment on terminal.
fix: uninitialized variable "p" in str_8bit_fit_to_term
Changed type of related function arguments.
src/strutil.c (str_fit_to_term): changed type of 3rd argument
from int to align_crt_t.
src/strutil8bit.c (str_8bit_fit_to_term): likewise.
src/strutilascii.c (str_ascii_fit_to_term): likewise.
src/strutilutf8.c (str_utf8_fit_to_term): likewise.
src/screen.c: changed type of alignment variables and structure fields
* Fix init of global variables cp_source and cp_display
* add property (mc_search_t*) search to WEdit srtucture
* start of reorganize edit/editcmd.c for new search engine
valgrind log when run viewer
==9981== Conditional jump or move depends on uninitialised value(s)
==9981== at 0x45891B: view_map_offset_and_column (view.c:584)
==9981== by 0x458D5B: view_column_to_offset (view.c:917)
==9981== by 0x458DD8: view_set_first_showed (view.c:1443)
==9981== by 0x45B79F: view_new (view.c:4136)
==9981== by 0x45B911: mc_internal_viewer (view.c:3969)
==9981== by 0x423D85: view_file_at_line (cmd.c:132)
==9981== by 0x423E78: do_view_cmd (cmd.c:217)
==9981== by 0x45CDE7: buttonbar_call (widget.c:2425)
==9981== by 0x45D754: buttonbar_callback (widget.c:2456)
==9981== by 0x427D42: dlg_process_event (dialog.c:618)
==9981== by 0x428035: run_dlg (dialog.c:789)
==9981== by 0x43E708: main (main.c:1688)
==9981== Uninitialised value was created by a stack allocation
==9981== at 0x4586F0: view_map_offset_and_column (view.c:593)
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
Modified descriptions.
src/strutil.c (_str_convert): return value of estr_t type instead of int.
Check coder first. Removed redundant code.
(str_convert): simplified. Changed returned type to estr_t.
(str_nconvet): likewise.
(str_vfs_convert_to): likewise.
(str_vfs_convert_from): likewise. Used symbolic names instead of hardcoded values.
(str_translate_char): likewise.
src/strutil8bit.c (str_8bit_vfs_convert_to): likewise. Made function static.
src/strutilascii.c (str_ascii_vfs_convert_to): likewise.
src/strutilutf8.c: (str_utf8_vfs_convert_to): Used symbolic names
instead of hardcoded values.
src/charsets.c (convert_from_utf_to_current): likewise.
(convert_from_utf_to_current_c): likewise.
(convert_from_8bit_to_utf_c): likewise.
(convert_from_8bit_to_utf_c2): likewise.
src/view.c (view_get_char): likewise.
vfs/vfs.c (_vfs_translate_path): Changed returned type to estr_t.
Used symbolic names instead of hardcoded values.
(vfs_translate_path): likewise.
charset.c: cp_display and cp_source variables are made global not static and...
charset.h: ...defined here as extern.
search.h: added required #include's.
search.c: fixed cp_display and cp_source variables declaration.
* added multicharset search feature
* added template for HEX and GLOB searches (for viewer and for search files dialog)
* implemented normal search with/without characters cases
WARNING! UNSTABLE! Code not checked for work! I'm just wrote and compiled.
Removed <iconv.h> include. Add "global.h" include.
Moved str_isutf8 function declaration under header guard.
Formatting.
view.c: used symbolic constant.
Formatting.
src/charsets.c:
* fix error with recoding string for display
edit/editcmd.c:
* fix core dump if search dialog calls some multiple times
* fix memory leak
* 'm-utf-8' of ssh://www.midnight-commander.org:2222/git/mc:
fix by andrew_b uninitialised tool->compose.
fix incorrect draw utf-8 text in 8-bit locale
fix some warnings
add convert_from_utf_to_current_c, fix little warnings
add utf8_display global variable, if display bits select utf-8 utf8_display = 1
add more convertion before draw text
change charbuf to char from unsigned char
add: convert input in utf locale to needle
fix incorrect convertion from utf to display CP
fix: width utf buffer
add in core viewer codepage selection from list
fix: editor status bar
fix: edit_get_prev_utf segfault, add compare str with start of buf
Conflicts:
edit/edit.h
myslang.h: modified definition of ACS_LTEE symbol. Added definition
of ACS_RTEE symbol.
screen.c (show_dir): paint left and right symbols of mini infor separator
as for S-Lang library as for NCurses one.
These functions fully replaced with g_strconcat ()
WARNING! This just stupid replace. Some parts of code need to usage
concat_dir_and_file() function instread of g_strconcat ()
myslang.h: modified definition of ACS_LTEE symbol. Added definition
of ACS_RTEE symbol.
screen.c (show_dir): paint left and right symbols of mini infor separator
as for S-Lang library as for NCurses one.
src/smd.c (single_dirsize_cmd): create status dialog if needed not always.
file.h: fixed typo.
file.c (compute_dir_size_create_ui): changed title of dialog.
(compute_dir_size_destroy_ui): formatting.
(compute_dir_size_update_ui): simplified text of dialog.
file.h: new type and functions for status dialog
of directory computing size. Added required includes.
(compute_dir_size): changed return value. Added new parameters
to handle status dialig.
Fixed comments.
file.c: new functions for status dialog of directory
computing size.
(compute_dir_size): interruptable dir size computing.
Changed return value. Added new parameters to handle status dialig.
(panel_compute_totals): likewise.
(panel_operate): likewise.
cmd.c (single_dirsize_cmd): interruptable dir size computing.
(dirsizes_cmd): likewise.