Commit Graph

8101 Commits

Author SHA1 Message Date
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
Slava Zanko
e8f71d0db8 Fix memory leak and coredump if do search in editor. 2009-04-22 11:59:14 +03:00
Andrew Borodin
4e64ee3b8d edit/editcmd.c (edit_search_cmd): removed redundant code. 2009-04-22 06:19:20 +04:00
Ilia Maslakov
945d2183ac fix: incorrect delete selected block if is utf-8 text
add param byte_delete to edit_delete, if byte_delete = 1 then one byte only delete,
but not multibyte char.
2009-04-21 22:32:30 +00: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
356b501bdc revert commit No. e19de53a06 "change addch to addstr" 2009-04-21 11:51:24 +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
Ilia Maslakov
e19de53a06 change addch to addstr 2009-04-20 20:18:12 +00:00
Ilia Maslakov
83c10b2f6e fix: build without charsets 2009-04-20 19:10:33 +00:00
Ilia Maslakov
17c4e67cb2 Merge branch 'm-utf-8' of ssh://angel_il@midnight-commander.org:2222/git/mc into m-utf-8 2009-04-20 14:55:39 +00:00
Ilia Maslakov
202ec6d78f fix: incorrect show and input capitalize chars in UTF-8 locale and 8-bit source 2009-04-20 14:46:22 +00: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
Ilia Maslakov
cc54a2083b change check S-LANG for use addch() 2009-04-20 10:56:31 +00:00
Ilia Maslakov
571ed66b76 fix: utf-8 output in editor with use ncurses 2009-04-20 10:26:14 +00:00
Slava Zanko
dd07d30c0b Fix coredump with jumps to function definition/declaration 2009-04-20 13:35:09 +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
Sergei Trofimovich
e88a6bd4d8 vfs/vfs.c: build fix: iconv_t(-1) -> INVALID_CONV
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-04-19 22:11:49 +03: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
9da8faa62d Merge branch 'm-utf-8' of ssh://angel_il@midnight-commander.org:2222/git/mc into m-utf-8 2009-04-17 12:04:37 +00:00
Slava Zanko
ea30fa7d88 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: incorrect convert_from_utf_to_current_c, convert_from_utf_to_current
2009-04-17 15:02:41 +03:00
Slava Zanko
3802929f94 edit/editcmd.c: Fixed search and replace with scanf-search 2009-04-17 15:01:25 +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