Commit Graph

3016 Commits

Author SHA1 Message Date
Slava Zanko
786174fac8 Renamed function shell_is_char_escaped to strutils_is_char_escaped; removed function mc_search_is_char_escaped
* All calls of function mc_search_is_char_escaped replaced to strutils_is_char_escaped

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
5f810602e0 Moved 'escape' and 'unescape' strings functions from src/util.[ch] into src/strescape.[ch]
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
5834a9ed84 Fixed crash if replace group ${N} used into replace string
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
1b08532f5f Some cosmetic optimisation for less code :)
This not important fix - just removing some unsense code (part of older logic?)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
1d4f7fd44d Fixed searched token in source file mask.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
facb94dc48 Fixed NULL acertion if replacement don't correct
Also fixed multiple usage of replacement pointers (such as \1\1).

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:58 +03:00
Slava Zanko
2e9a16487a Handle new search replace behaviour into src/file.c. Also fixed filemask into src/filegui.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:58 +03:00
Slava Zanko
a0d56381e0 Search Replace now handled \U,\u,\L,\l and \E modificators.
Also function mc_search__regex_is_char_escaped() renamed to mc_search_is_char_escaped() and moved into global visibility scope.
2009-06-12 10:31:58 +03:00
Slava Zanko
5e6c14a928 Just identation of regex.c and search.h
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:58 +03:00
Slava Zanko
2d4ee6f616 search engine: Added new syntax for replace tokenks.
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>
2009-06-12 10:31:58 +03:00
Andrew Borodin
dd319ef92e Fixed file find.
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>
2009-06-10 23:21:44 +04:00
Slava Zanko
3708dd28b5 Added new checkbox 'Using shell patterns' into select/unselect dialogs
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-10 14:20:27 +03:00
Slava Zanko
74abbb482f Refactoring: making from anonymous enum new type
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-10 14:20:27 +03:00
Slava Zanko
dbb953bfbe Fixed Select/Unselect file mask. now mask applied to entire filename, not to part of filename
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-10 14:20:27 +03:00
Andrew Borodin
b2a680b768 src/cmd.c (select_unselect_cmd): set dialog sizes using constants
instead of defines.
2009-06-10 14:20:26 +03:00
Andrew Borodin
edc9264a27 Advanced "Select/Unselect Group" dialogs.
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.
2009-06-10 14:20:26 +03:00
Slava Zanko
8a3e1a8f5b Fixed broken history of input elements (history wasn't save into ~/.mc/history file)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-10 09:41:28 +03:00
Slava Zanko
f606e64861 Version of project now formed automatically from current git-describe output
* 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>
2009-06-07 00:56:07 +03:00
Iouri Kharon
089cb8f65d This patch correct 'Compare directories' command.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-03 21:43:22 +03:00
Slava Zanko
3b3dbe0f91 Old state of panels now read once from ~/.mc/ini file (if ~/.mc/panels.ini don't exists) 2009-06-01 11:32:19 +03:00
Slava Zanko
e9930f9e28 Changed all source files for use new config module 2009-06-01 11:05:11 +03:00
Slava Zanko
72461d232e mcconfig: added module for work with ini-files 2009-06-01 10:57:44 +03:00
Slava Zanko
0a1b6bfbb2 Reworked "Special dirs"->"list" parameter handle code
misc/mc.lib: changed ',' to ';'
src/treestore.c: use mc_config_get_string_list() function instread of strtok() function
2009-06-01 10:55:35 +03:00
Slava Zanko
acc64ecd68 Fixed saved panel state and fixed reading key definitions from config-file
misc/mc.lib: added escaping of all backslashes
src/mcconfig/common.c: removed forgotten debug code
src/setup.c: fixed non-saving of panels state
2009-06-01 10:55:35 +03:00
Slava Zanko
a70255f643 Changed all source files for use new config module 2009-06-01 10:55:35 +03:00
Slava Zanko
c583b303da Delete src/profile.[ch] files
Also:
 * add check for minimal version of glib (>= 2.6)
 * add subdir src/mcconfig into build action (by make)
2009-06-01 10:55:06 +03:00
Slava Zanko
3de5486aac mcconfig: added module for work with ini-files 2009-06-01 10:55:06 +03:00
Sergei Trofimovich
4ecef05511 completion: do not duplicate non-escaped strings
Signed-off-by: Sergei Trofimovich <st@anti-virus.by>
2009-05-29 15:14:52 +03:00
Sergei Trofimovich
09cdc11c3c str_escape: do not hide error when NULL is escaped
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>
2009-05-29 15:04:58 +03:00
Slava Zanko
ae96b4dac0 Fixed tab completion (esc-tab) crash.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-05-29 10:28:59 +03:00
Mikhail S. Pobolovets
546b30008a Simple statusbar mode for editor.
Full mode:
    TODO [----] 2 L:[ 1+ 0 1/333] *(2 /11838b)= 102 0x066 cp:Other_8_bit

Simple mode:
    TODO [----] 2 1/333 (2 /11838b) 102 0x066 Other_8_bit

    modified:
        * edit/edit.h
        * edit/editdraw.c
        * src/setup.c

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-05-28 10:40:54 +03:00
Slava Zanko
abcd23406d remove ChangeLog files from mc tree
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).
2009-05-27 14:53:23 +03:00
Andrew Borodin
5bc2a579b3 src/cmd.c (select_inselect_cmd): show previous entered text in input line. 2009-05-27 12:49:26 +03:00
Slava Zanko
17343149d6 Remove 'All charsets' checkbox from all search dialogs when specified '--disable-charsets' configure option 2009-05-27 12:20:21 +03:00
Slava Zanko
49015842c9 Fix case insentitive search with --disable-charset configure option
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.
2009-05-27 12:19:23 +03:00
Slava Zanko
abf38df5e0 src/view.c: fix search result highlighting in backward search. Also fix search results highlight in nroff'ed text 2009-05-27 12:06:13 +03:00
Andrew Borodin
13b12fdd5b src/complete.c:
(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.
2009-05-27 11:20:48 +03:00
Slava Zanko
1a899905bd Fix usage of shell_[un]escape functions.
These functions returns newly allocated string, but calling don't freeze correctly allocated memory.
2009-05-27 11:20:48 +03:00
Andrew Borodin
92353b3848 Added option to enable/disable close dialog by mouse click outside of it.
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.
2009-05-22 16:39:28 +04:00
Andrew Borodin
3be2491d1e src/dialog.c (dlg_mouse_event): close current dialog by mouse click
out of dialog area.
2009-05-22 16:39:28 +04:00
Slava Zanko
28539b2363 Merge branch '130_sysconfdir_mc'
* 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
2009-05-22 15:44:28 +03:00
Slava Zanko
0c17219b2a Move global config files from pkg_datadir to sysconfdir
* Also fixed 'make dist' command
 * changed contrib/dist/redhat/mc.spec.in for builds with new dir
2009-05-21 01:01:10 +03:00
Sergei Trofimovich
6121dfd5b1 8bit: convert properly nonascii signed chars in panel and viewer (#360)
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>
2009-05-21 00:49:01 +03:00
Sergei Trofimovich
fd55b916de Revert "Replace self-made code for work with ini-files to glib native code"
This reverts commit 4648ad8bf9.
2009-05-19 10:22:24 +03:00
Sergei Trofimovich
df5160aaf3 Revert "Added check for glib version in mc_config_del_param and mc_config_del_group functions"
This reverts commit 483a1a05aa.
2009-05-19 10:22:17 +03:00
Andrew Borodin
c572352a04 Fixed default terminal colors usage for NCurses. 2009-05-15 13:31:23 +03:00
Enrico Weigelt, metux IT service
ae33ec6385 fixed #229 2009-05-15 13:29:48 +03:00
Slava Zanko
483a1a05aa Added check for glib version in mc_config_del_param and mc_config_del_group functions
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.
2009-05-14 16:21:28 +03:00
Slava Zanko
4648ad8bf9 Replace self-made code for work with ini-files to glib native code 2009-05-14 16:21:22 +03:00
Ilia Maslakov
f8a487de01 Merge branch '351_show_number_line'
* 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)
2009-05-14 07:57:51 +00:00
Mikhail S. Pobolovets
ec8711ca99 Merge branch '350_compare_empty_files' 2009-05-13 14:33:12 +03:00
Slava Zanko
dd27f52286 Merge branch '352_add_XZ_compression_support'
* 352_add_XZ_compression_support:
  Added XZ compression support. Signed-off-by: xgizzmo <xgizzmo@slackbuilds.org>
2009-05-13 11:35:54 +03:00
xgizzmo
24ca27fe30 Added XZ compression support. Signed-off-by: xgizzmo <xgizzmo@slackbuilds.org>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-05-13 11:35:22 +03:00
Sergei Trofimovich
a70a6e278e Merge branch 'mc-4.6'
* 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.
2009-05-13 10:21:16 +03:00
Ilia Maslakov
854f214563 show line number in left part of screen (hotkey alt-n)
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)
2009-05-13 07:09:47 +00:00
Slava Zanko
121ff2965c Merge branch '345_mcfs_build_failure'
* 345_mcfs_build_failure:
  Fixed mcfs build failure (after reorganize M4-autoconf stuff)
2009-05-12 16:27:55 +03:00
Mikhail S. Pobolovets
9041e6c81f commandline: strip_escape: strip xterm OSC commands in $PS1
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>
2009-05-12 13:27:00 +03:00
Slava Zanko
8c441fdd12 src/cmd.c: Fixed bug was caused by mmap behaviour when length = 0
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
2009-05-12 10:03:32 +03:00
Mikhail S. Pobolovets
31332a2f00 src/utils.[ch]: _icase_search clean up
_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>
2009-05-11 11:40:33 +03:00
Slava Zanko
ae46a004e9 Fixed mcfs build failure (after reorganize M4-autoconf stuff)
Defined variable WITH_MCFS renamed to ENABLE_VFS_MCFS for more sence
2009-05-11 10:28:57 +03:00
Slava Zanko
0a08e13a6c Merge branch '341_broken_file_mark' 2009-05-10 15:10:55 +03:00
Mikhail S. Pobolovets
c079e73d08 Warning fix: assignment from incompatible pointer type
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>
2009-05-10 14:22:24 +03:00
Mikhail S. Pobolovets
5f448874e2 Warning fix: format not a string literal and no format arguments
view.c:3196:
        format not a string literal and no format arguments

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-05-10 14:22:24 +03:00
Mikhail S. Pobolovets
171d6cae22 Warning fix: wrong qualifier in g_snprintf
view.c:124: wrong field type
    view.c:3064: cast from pointer to integer of different size

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-05-10 14:22:24 +03:00
Mikhail S. Pobolovets
4fd6869be2 Warning fix: return discards qualifiers from pointer target type
search.c:312:
        return discards qualifiers from pointer target type

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-05-10 14:22:24 +03:00
Mikhail S. Pobolovets
a91e5be8b7 Warning fix: may be used uninitialized
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>
2009-05-10 14:20:12 +03:00
Mikhail S. Pobolovets
906d25c5c8 Warning fix: defined but not used
view.c:2739: ‘icase_search_p’ defined but not used
    charsets.c:161: unused variable ‘obuflen’

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-05-08 13:30:32 +03:00
Slava Zanko
2ebdf91079 Merge branch 'm-utf-8'
* 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.
2009-05-07 13:01:01 +03:00
Slava Zanko
c8dd6dbbfd Fix wildcard pattern in file select and file find dialogs 2009-05-07 12:53:59 +03:00
Slava Zanko
09bc5434f6 Project builds with option --disable-charsets 2009-05-07 12:20:34 +03:00
Slava Zanko
087ef15b1f Total replacement to mc_search stuff in all places 2009-05-06 19:12:32 +03:00
Slava Zanko
0d76e9aa34 Search engine: if found_len parameter NULL, then mc_search_run don't try to fill them 2009-05-06 16:32:13 +03:00
Slava Zanko
824d12661b src/view.c: Reworked search stuff to usage src/search 2009-05-06 16:16:40 +03:00
Slava Zanko
293310f727 refactoring: rename edit/editcmd_dialog.c:editcmd_dialog__get_search_types_list to
to src/search/lib.c:mc_search_get_types_strings_array
2009-05-06 10:50:12 +03:00
Slava Zanko
589f0b5bd8 Search engine: development of hex search complete
src/search/glob.c: removed unneeded comment
2009-05-06 10:27:06 +03:00
Slava Zanko
9c38485130 Search engine: remove forgotten debug string and reindent file 2009-05-05 22:50:19 +03:00
Slava Zanko
0eb537d8d5 Search engine:
* fixed double-free memory
 * changed logic of parce regexp-string for \x{HEX} token
 * added template file hex.c for HEX search type
2009-05-05 22:28:27 +03:00
Slava Zanko
2276e9b513 Search engine: now used regexp external engines:
* glib
 * pcre
 * POSIX regex

External engine selected automatically, if present.
2009-05-05 16:19:32 +03:00
Slava Zanko
7763c0e866 src/find.c: Fixed core dump if content search pattern no present 2009-05-05 16:16:09 +03:00
Slava Zanko
9880d45123 Find files: checkbox 'Regular expression' for content search now default unchecked 2009-05-04 17:06:47 +03:00
Slava Zanko
af18cb326f Find files: changes for usage of new search engine:
* Changed file search and content search
 * Added regexp-search for filenames
 * Added 'All charset' checkbox for file and content searches
2009-05-04 15:47:49 +03:00
Slava Zanko
841a47e163 Fix copy of current/opposite path to command line: remove charset info from path 2009-05-04 12:40:06 +03:00
Slava Zanko
6f390f5cf3 src/Makefile.am: add some header files to Make-tracking 2009-05-04 11:23:40 +03:00
Andrew Borodin
f7781c16e0 src/main.c (main): create MC home directory with 700 mode instead of 755 one. 2009-05-02 17:35:34 +04:00
Andrew Borodin
d0beb4cfec src/main.c (main): create MC home directory (~/.mc) if absent. 2009-05-02 17:35:10 +04:00
Andrew Borodin
610d724186 src/main.c (main): create MC home directory with 700 mode instead of 755 one. 2009-05-02 17:29:59 +04:00
Andrew Borodin
ab1bdc1429 src/main.c (main): create MC home directory (~/.mc) if absent. 2009-05-02 17:29:30 +04:00
Andrew Borodin
aadcca8048 src/edit.c (create_menu): small fix of i18n for menu entry text. 2009-05-01 21:08:21 +04:00
Slava Zanko
e12b9e50db edit/editcmd.c, edit/editcmd_dialigs.c: added 'search in all charsets' feature
src/search/search.c: fixed error with multicharset search
2009-04-30 16:58:28 +03:00
Slava Zanko
dce5909154 Search engine: added forgotten file. Sorry :) 2009-04-30 16:57:46 +03:00
Slava Zanko
dcf90bf6ec Search engine: added Wildcard search (glob matching) 2009-04-30 16:06:24 +03:00
Slava Zanko
ebd271feca Search engine: change some text constants.
* change names of search types
 * change error message about unimplemented search type
2009-04-30 14:25:42 +03:00
Slava Zanko
15b2d19428 Search engine: fix errors with backward regex-search 2009-04-30 14:21:39 +03:00
Slava Zanko
602f3c5796 Search engine: backward search now works 2009-04-30 12:35:24 +03:00
Slava Zanko
a802e51566 Search engine: regex replace now works correct 2009-04-30 10:32:45 +03:00
Andrew Borodin
4c5c8d4247 src/strutil.c (_str_convert): fixed memory leak: don't get error of valid
byte sequence conversion. Small optimization. Removed redundant code.
2009-04-29 20:35:42 +04:00
Andrew Borodin
a93716386c src/search/regex.c (mc_search__regex_found_cond_one): convert GError message
to terminal charset.
(mc_search__cond_struct_new_init_regex): likewise.
2009-04-29 20:17:09 +04:00
Andrew Borodin
15e1db5157 Added functions to convert GError messages (which are in UTF-8 charset)
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.
2009-04-29 20:08:33 +04:00
Andrew Borodin
45210ad625 src/util.c (_str_convert): don't drop valid byte sequence before first
invalid one.
2009-04-29 20:05:01 +04:00
Slava Zanko
def581b24d Search engine:
* add function for prepare replacement string

edit/editcmd.c:
 * changes for correct replace

WARNING! replace don't fully works!
2009-04-29 18:45:21 +03:00
Slava Zanko
74c8c748b3 internal editor: change search/replace dialogs:
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
2009-04-29 16:13:12 +03:00
Slava Zanko
d2e62a5c87 src/wtools: add callback functions for buttons to QuickWidget structure 2009-04-29 14:07:09 +03:00
Slava Zanko
2137d0037f src/wtools: add (Widget *) widget member to QuickWidget structure 2009-04-29 13:43:18 +03:00
Slava Zanko
d7f85d90d3 Search engine: fix core dump with invalid regex 2009-04-29 10:08:55 +03:00
Ilia Maslakov
6fd08cc199 replace iconv* to g_iconv*, drop iconv.h 2009-04-28 10:03:02 +00:00
Ilia Maslakov
687ab30f74 fix: g_string_free show asserts if str_nconvert_to_display return NULL.
now str_nconvert_to_display return empty GString.
2009-04-27 10:30:18 +00:00
Ilia Maslakov
d99c1def10 fix: broken building on glib < 2.14 2009-04-27 06:34:10 +00:00
Andrew Borodin
931f0d073d src/menu.c: nice menu view: added LTEE and RTEE symbols to menu separators.
Small optimization. Removed some trailing spaces. Some formatting.
2009-04-26 18:22:53 +04:00
Andrew Borodin
f08aee0ad0 widget.c (draw_hotkey): new function to draw widget text with hotkey.
(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.
2009-04-26 11:21:42 +04:00
Andrew Borodin
7ef779dcbc src/search/lib.c (mc_search__recode_str): use symbolic constant
for invalid convertion descriptor.
2009-04-26 09:17:48 +04:00
Andrew Borodin
a20b472807 Merge branch 'm-utf-8' of git://midnight-commander.org/git/mc into m-utf-8 2009-04-26 09:04:58 +04:00
Andrew Borodin
9bb92b02ff src/strutil.h: fixed function descriptions.
src/strutil.c: removed unneeded #include's.
2009-04-26 09:01:34 +04:00
Slava Zanko
94bb61742b Search engine: move string constants from code of normal search to common code area (lib.c) 2009-04-25 16:53:05 +03:00
Slava Zanko
f8deaf63bc Search engine: regex search now worked in any charset 2009-04-25 16:51:37 +03:00
Andrew Borodin
8e43cdbfce Fixed i18n for search error messages.
src/search/internal.h: declare search error messages as global variables.
src/search/normal.c: define search error messages.
2009-04-25 13:44:33 +04:00
Slava Zanko
95ecd0ce54 Merge branch 'm-utf-8' of ssh://www.midnight-commander.org:2222/git/mc into m-utf-8
* '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
2009-04-25 11:10:52 +03:00
Slava Zanko
c2455b246c Make search module more independ (and prepare for future mclib :) ) 2009-04-25 11:09:47 +03:00
Slava Zanko
b2442d1b1e Reorganize source structure: move search engine files into src/search subdir 2009-04-25 10:25:13 +03:00
Slava Zanko
a1f0d9429c Search engine: regexp search now worked 2009-04-25 10:15:56 +03:00
Andrew Borodin
9bd0607048 Fixed coredump in editor after help call.
src/help.c:
Intialize `data' static variable.
(translate_file): fixed memory leak.
(interactive_display): check correct variable to display error message.
2009-04-24 20:40:18 +04:00
Andrew Borodin
95b622f0db src/menu.c (create_menu): don't translate menu entry text if ENABLE_NLS isn't defined. 2009-04-24 20:11:45 +04:00
Andrew Borodin
d716433399 src/strutil.h: created align_crt_t type for string alignment on terminal.
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
2009-04-24 20:01:06 +04:00
Ilia Maslakov
16dd0ad073 fix: uninitialized variable "p" in str_8bit_fit_to_term 2009-04-24 08:40:00 +00:00
Slava Zanko
10b7bdb361 Project now build with:
make CFLAGS="-ansi -pedantic -Wall -Wextra -Werror"

WARNING! Builds wuthout samba.
2009-04-24 01:47:22 +03:00
Slava Zanko
d9500ec836 Search engine: fix return number of found bytes
Some reidentation of code
2009-04-23 16:26:14 +03:00
Slava Zanko
a3e6a1147d Search engine: fixed types in functions parameters.
* renamed founded* to found* :)
2009-04-23 16:16:00 +03:00
Slava Zanko
4114a95723 Search engine: fix search in case sentitive mode 2009-04-23 15:52:03 +03:00
Slava Zanko
9db1cf46a4 Continue develop of search engine: simple search now worked 2009-04-23 15:46:06 +03:00
Slava Zanko
dac42ca7f2 Merge branch 'm-utf-8' of ssh://www.midnight-commander.org:2222/git/mc into m-utf-8
* 'm-utf-8' of ssh://www.midnight-commander.org:2222/git/mc:
  fix: build error on glib < 2.14
2009-04-23 14:32:32 +03:00
Slava Zanko
8fb216e732 Continue develop of mc_search module.
* 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
2009-04-23 14:30:14 +03:00
Ilia Maslakov
1133dd750b fix: build error on glib < 2.14 2009-04-23 07:34:10 +00:00
Sergei Trofimovich
725fe42290 src/view.c: valgrind: hackish fix of uninitialised value usage
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>
2009-04-22 22:15:51 +03:00
Sergei Trofimovich
b88147f0c6 cleanup: build warnings: 'char *' -> 'const char *'
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-04-22 22:15:43 +03:00
Andrew Borodin
dc8150a521 src/strutil.h: created estr_t type for result of charset convertion functions.
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.
2009-04-22 20:35:32 +04:00
Andrew Borodin
2ad5d2e919 Fixed linkage.
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.
2009-04-22 20:20:42 +04:00
Slava Zanko
ab729f822a src/search.[ch]: add experimental search engine. Need to review and revork.
* 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.
2009-04-22 18:52:49 +03:00
Slava Zanko
b0a0a8f17b src/screen.c: fix memleak in remove_encoding_from_path 2009-04-22 15:34:19 +03:00
Andrew Borodin
baef389ce7 menu.c (menubar_new): init the subsel field clearly.
(menu_callback): show menu after screen resize.
2009-04-22 12:00:21 +03:00
Slava Zanko
e8f71d0db8 Fix memory leak and coredump if do search in editor. 2009-04-22 11:59:14 +03:00
Ilia Maslakov
990838a226 fix: draw in core editor 8-bit locale and UTF-8 source 2009-04-21 21:27:42 +00:00
Slava Zanko
1d3c9e1742 Charsets of panel: if no encode, path correctly revert tooriginal 2009-04-21 16:36:03 +03:00
Slava Zanko
659019313f Charsets of panel: Add behaviour for "No translate" choise.
Now translate string will clean from '/#enc<chrs>'
2009-04-21 15:20:17 +03:00
Slava Zanko
76bbeb60b2 Fixed search with different display and source charsets 2009-04-21 14:19:42 +03:00
Slava Zanko
540bdb85ed Changes in SelectCodepage dialog:
* Fixed change codepage of panel by hotkey
 * Dialog now show as centered relative to panel, not center of screen
2009-04-21 11:48:13 +03:00
Slava Zanko
b019ea7f9c Add hotkey CTRL+t for change codesets of panels 2009-04-20 16:05:51 +03:00
Slava Zanko
45abfa28a4 src/strutil.c: Fix returning empty string with partially wrong recoding 2009-04-20 16:04:45 +03:00
Slava Zanko
df3926d1c4 Fix show directory and file names in other that system encoding symbolsets (with error of recoding).
Old behaviour: enrties not show, new behaviour: entries show, but marked as broken files if
recoding impossible
2009-04-20 13:09:59 +03:00
Ilia Maslakov
26f0e58810 fix: definition of convert_from_8bit_to_utf_c2 in src/charsets.h 2009-04-20 09:08:48 +00:00
Ilia Maslakov
78b7678845 Merge branch 'm-utf-8' of ssh://angel_il@midnight-commander.org:2222/git/mc into m-utf-8 2009-04-20 09:03:04 +00:00
Ilia Maslakov
4725fe329c fix: edit in 8-bit locale UTF-8 source 2009-04-20 09:01:47 +00:00
Slava Zanko
303cec8cb6 Supress compiler warnings. Now able to compile project with
make CFLAGS=-Werror
2009-04-20 11:10:06 +03:00
Ilia Maslakov
7494db39ed clear some build warnings 2009-04-20 07:30:32 +00:00
Ilia Maslakov
9d855b3253 fix: build without HAVE_CHARSET 2009-04-20 05:51:32 +00:00
Ilia Maslakov
a4b354f99c fix: incorret draw files in 8-bit codeset after recode 2009-04-19 20:28:00 +00:00
Andrew Borodin
6a638f25b3 strutil.h: replaced iconv_t to GIConv in INVALID_CONV definition.
Removed <iconv.h> include. Add "global.h" include.
Moved str_isutf8 function declaration under header guard.
Formatting.

view.c: used symbolic constant.
Formatting.
2009-04-19 17:45:10 +04:00
Ilia Maslakov
9c713d2128 fix: broken output in 8-bit locale 2009-04-19 13:12:08 +00:00
Ilia Maslakov
b87edfdc26 fix: input in 8-bit locales 2009-04-19 12:18:18 +00:00
Ilia Maslakov
28425d427f Merge branch 'm-utf-8' of ssh://angel_il@midnight-commander.org:2222/git/mc into m-utf-8 2009-04-18 14:51:01 +00:00
Ilia Maslakov
d8175b3e6b fix: incorrect input 2009-04-18 14:50:05 +00:00
Andrew Borodin
db26e75242 src/strutil8bit.c (str_8bit_search_first): fixed case sensitivity searching.
(str_8bit_search_last): likewise.
2009-04-18 16:38:36 +04:00
Andrew Borodin
b8184a4595 src/screen.c (set_panel_formats): use symbolic constant in message() call. 2009-04-18 12:55:48 +04:00
Andrew Borodin
438e95b110 src/strutil.c (str_printf): use g_string_append_vprintf() function if available. 2009-04-18 12:50:32 +04:00
Slava Zanko
6568cad9df Fixies for search stuff in editor.
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
2009-04-17 18:08:51 +03:00
Slava Zanko
95e2fb90ef Fix search with 8-bit system codepage in utf-8 text codepage 2009-04-17 17:05:19 +03:00
Ilia Maslakov
284098a073 fix: convert_from_utf_to_current_c trap on incorrect strint 2009-04-17 11:35:44 +00:00
Ilia Maslakov
137e3e7259 fix: incorrect convert_from_utf_to_current_c, convert_from_utf_to_current 2009-04-17 10:27:59 +00:00
Slava Zanko
0730efa2fc Merge branch 'm-utf-8' of ssh://www.midnight-commander.org:2222/git/mc into m-utf-8
* '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
2009-04-17 11:52:20 +03:00
Slava Zanko
1e5a201abd Temporary commit. Half-fix searching.
Not fixed search by regexp.
2009-04-17 11:46:06 +03:00
Ilia Maslakov
92dac8d7e3 fix by andrew_b uninitialised tool->compose.
Trouble detected by valgrind as "Conditional jump or move depends on uninitialised value(s)"
2009-04-17 06:25:20 +00:00
Ilia Maslakov
8767909493 fix incorrect draw utf-8 text in 8-bit locale 2009-04-17 06:17:37 +00:00
Ilia Maslakov
42eba5c18c fix some warnings 2009-04-16 21:28:02 +00:00
Ilia Maslakov
eb28a3b2b3 add convert_from_utf_to_current_c, fix little warnings 2009-04-16 21:26:08 +00:00
Ilia Maslakov
df1d805b44 add utf8_display global variable, if display bits select utf-8 utf8_display = 1 2009-04-16 21:22:52 +00:00
Ilia Maslakov
8529756be9 fix incorrect convertion from utf to display CP 2009-04-16 15:10:51 +00:00
Ilia Maslakov
408e75c1fa add choice encoding in panel from list ( by call do_select_codepage() ) 2009-04-16 10:32:39 +00:00
Slava Zanko
ac8ae55181 Fix conflicts after rebasing 2009-04-16 13:24:47 +03:00
Slava Zanko
6771a00b4c add in core viewer codepage selection from list
Author: Ilia Maslakov <il.smind@gmail.com>
2009-04-16 13:14:30 +03:00
Andrew Borodin
dd6e11fa9c Unification of widgets API.
widget.h: chaged paremeters order of listbox_new()
and groupbox_new() functions.

widget.c: likewise.

src/achown.c: sync with modified API of WListbox and WGroupbox widgets.
src/boxes.c: likewise.
src/chown.c: likewise.
src/complete.c: likewise.
src/find.c: likewise.
src/hotlist.c: likewise.
src/layout.c: likewise.
src/listmode.c: likewise.
src/option.c: likewise.
src/panelize.c: likewise.
src/wtools.c: likewise.
edit/editcmd.c: likewise.
2009-04-16 13:14:29 +03:00
Andrew Borodin
5141e88f70 Type accuracy.
dialog.h: define values for cb_ret_t enum.

widget.c: removed trailing spaces. Formatting.
(insert_char): type accuracy for cb_ret_t.
(listbox_key): likewise.
2009-04-16 13:14:29 +03:00
Andrew Borodin
12b1081c64 Unification of panel frame painting.
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.
2009-04-16 13:14:29 +03:00
Slava Zanko
4af2c5b938 src/strutil.c: replace call of g_string_append_vprintf() with g_strdup_vprintf and g_string_append
Not all versions of glib2 have function g_string_append_vprintf
2009-04-16 13:14:28 +03:00
Slava Zanko
8e6a6e48b6 edit/{editcmd.c,edit.h,edit.c}: remove catstrs() and freestrs() functions
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 ()
2009-04-16 13:14:28 +03:00
Slava Zanko
2ac6b553c6 Rework strutils for usage GString
instread of self-made buffers.
2009-04-16 13:13:58 +03:00
Mikhail S. Pobolovets
1959b42fdc Merge branch '252_doxygen_desc_src'
Conflicts:

	src/file.h

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-04-16 08:26:52 +03:00
Andrew Borodin
004bc0077e Unification of widgets API.
widget.h: chaged paremeters order of listbox_new()
and groupbox_new() functions.

widget.c: likewise.

src/achown.c: sync with modified API of WListbox and WGroupbox widgets.
src/boxes.c: likewise.
src/chown.c: likewise.
src/complete.c: likewise.
src/find.c: likewise.
src/hotlist.c: likewise.
src/layout.c: likewise.
src/listmode.c: likewise.
src/option.c: likewise.
src/panelize.c: likewise.
src/wtools.c: likewise.
edit/editcmd.c: likewise.
2009-04-15 20:22:26 +04:00
Andrew Borodin
e029489fb6 Type accuracy.
dialog.h: define values for cb_ret_t enum.

widget.c: removed trailing spaces. Formatting.
(insert_char): type accuracy for cb_ret_t.
(listbox_key): likewise.
2009-04-15 20:12:47 +04:00
Andrew Borodin
57167b7a43 Unification of panel frame painting.
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.
2009-04-15 20:04:14 +04:00
Slava Zanko
cada92062a Fix forgot calls of iconv (replace with g_iconv) 2009-04-15 12:22:34 +03:00
Slava Zanko
ad2eb8877b src/strutil.c: replace call of g_string_append_vprintf() with g_strdup_vprintf and g_string_append
Not all versions of glib2 have function g_string_append_vprintf
2009-04-14 15:56:46 +03:00
Slava Zanko
dbf8dd1bc2 Rework strutils for usage GString instread of self-made buffers. 2009-04-14 13:29:01 +03:00
Andrew Borodin
b85f92c3fe Small redesign of status dialog of directory size calculation.
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.
2009-04-13 20:36:01 +04:00
Andrew Borodin
49e72ec135 file.c (compute_dir_size): don't break the directory reading loop
if cannot get the stat of current entry.
2009-04-13 20:36:00 +04:00
Andrew Borodin
11bc00bea9 Interruptable computing of directory size.
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.
2009-04-13 20:36:00 +04:00
Ilia Maslakov
b5c4a9ddf2 add str_isutf8 return 1 if codeset_name is utf8 or utf-8
add unsigned int utf8:1 to struct WEdit if utf8 then file multibute codeset
2009-04-09 14:23:08 +00:00
Ilia Maslakov
b617640aab clear trailing spaces in src/strutil.c 2009-04-09 10:29:00 +00:00
Ilia Maslakov
eba7d3a130 Merge branch 'm-utf-8' of ssh://angel_il@midnight-commander.org:2222/git/mc into m-utf-8 2009-04-09 08:02:43 +00:00
Ilia Maslakov
d004658a1d add source_codepage to ini file, change mechanism (ctrl-t) of selection codepage
if codepage selected then this is source codepage and must be convert to utf-8
2009-04-09 07:57:40 +00:00
Andrew Borodin
6e3cc60e9e src/screen.c (display_mini_info): don't display incorrect info about ".." directory. 2009-04-06 20:42:52 +04:00
Ilia Maslakov
3b5e2c052f Merge branch 'utf-8' into master
resolve conflicts:
	configure.ac
	src/complete.c
	src/file.c
	src/layout.c
	src/main.c
	src/menu.c
	src/screen.c
	src/util.c
	src/widget.c
	src/widget.h
2009-04-04 19:50:46 +00:00
Andrew Borodin
ecd16f7873 util.c (i18n_checktimelength): more correct conflict resolution of previous commit. 2009-04-04 11:39:00 +04:00