Commit Graph

9773 Commits

Author SHA1 Message Date
Andrew Borodin
29ecc9825f Merge branch '1876_ctrl_c_fix'
* 1876_ctrl_c_fix:
  Ticket #1876: Fix of Ctrl-c behaviour for S-Lang.
2009-12-16 17:23:48 +03:00
Andrew Borodin
c9a1c7f39e Ticket #1876: Fix of Ctrl-c behaviour for S-Lang.
Since Ctrl-C is used as common shortcut, don't use it
to generate the SIGINN signal in S-Lang library.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 17:23:29 +03:00
Slava Zanko
a958fc9136 Merge branch '1845_code_cleanup'
* 1845_code_cleanup: (30 commits)
  editcmd.c 'eval_marks': removed unused variable 'diff'
  The check result of g_new(), g_new0(), g_malloc(), g_malloc0() and g_realloc() is useless.
  Remove declaration of unused function.
  Added glib library for mcserv
  rearranging some lines in src_skin_colors.c mc_skin_color_parse_ini_file()
  missing check in src_mcconfig_get.c-mc_config_get_groups()_-2
  Unifying of g_strconcat() calls
  Types accuracy, minor optimization, removed unneeded goto and return.
  Fixed i18n of file operation dialog titles.
  added NULL check before call g_utf8_find_prev_char, g_utf8_get_char_validated for more safety.
  More usage of GLib functions.
  No need to call done_menu() at MC exit.
  Optimization of DLG_RESIZE message handling.
  doxygen: various warning fixes
  Fixed forgotten call of va_end() in mc_log().
  src/boxes.c (configure_vfs): fixed #ifdef directive.
  m4.include/mc-cflags.m4: added -fdiagnostics-show-option (exact warning option)
  configure.ac: guard $CFLAGS with "" in tests
  m4.include/mc-cflags.m4: sorted CFLAGS (no flags were added or removed)
  cflags: enable -Wformat in maintainer mode
  ...
2009-12-16 11:11:31 +02:00
Ilia Maslakov
26689fc39e editcmd.c 'eval_marks': removed unused variable 'diff'
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-12-16 11:10:44 +02:00
Andrew Borodin
dc604d811a The check result of g_new(), g_new0(), g_malloc(), g_malloc0() and g_realloc() is useless.
g_new(), g_new0(), g_malloc(), g_malloc0() and g_realloc() functions
never return NULL and call abort() on fail. So check result of these
functions is useless. g_try_new(), g_try_new0(), g_try_malloc(),
g_try_malloc0() and g_try_realloc() functions are used instead.

Some minor optimization and code formatting are also performed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:43 +02:00
Andrew Borodin
1aee8632ef Remove declaration of unused function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:43 +02:00
Slava Zanko
2a17d8460f Added glib library for mcserv
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-16 11:10:43 +02:00
Vit Rosin
80d474fdfa rearranging some lines in src_skin_colors.c mc_skin_color_parse_ini_file()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-16 11:10:43 +02:00
Vit Rosin
a7110419a6 missing check in src_mcconfig_get.c-mc_config_get_groups()_-2
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-16 11:10:43 +02:00
Vit Rosin
b6875454b2 Unifying of g_strconcat() calls
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:43 +02:00
Andrew Borodin
ec5791b7af Types accuracy, minor optimization, removed unneeded goto and return.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:42 +02:00
Andrew Borodin
718c91e955 Fixed i18n of file operation dialog titles.
Also type accuracy.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:42 +02:00
Ilia Maslakov
b90825fee4 added NULL check before call g_utf8_find_prev_char, g_utf8_get_char_validated for more safety.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-12-16 11:10:42 +02:00
Andrew Borodin
ec3c4c37c3 More usage of GLib functions.
Use g_snprintf instead of snprintf and g_free instaed of free.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:42 +02:00
Andrew Borodin
4ef67c33b9 No need to call done_menu() at MC exit.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:42 +02:00
Andrew Borodin
1e32a51d2d Optimization of DLG_RESIZE message handling.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:42 +02:00
Sergei Trofimovich
66371454c7 doxygen: various warning fixes
Fixes such warnings:
mc/src/viewer/mcviewer.h:1: Warning: the name `view.h' supplied as the second argument
                            in the \file statement is not an input file
mc/vfs/vfs.c:267: Warning: explicit link request to 'op' could not be resolved
mc/src/strescape.c:219: Warning: Found unknown command `\params'
mc/src/strescape.c:153: Warning: Found unknown command `\params'
mc/src/strescape.c:187: Warning: Found unknown command `\params'
mc/src/strescape.c:219: Warning: Found unknown command `\params'
mc/src/strescape.c:153: Warning: Found unknown command `\params'
mc/src/strescape.c:187: Warning: Found unknown command `\params'
mc/vfs/fish.c:33: Warning: explicit link request to 'sh' could not be resolved
mc/vfs/fish.c:33: Warning: Found unknown command `\host'
mc/vfs/ftpfs.c:43: Warning: Found unknown command `\hobit'
mc/vfs/sfs.c:26: Warning: explicit link request to 'ugz' could not be resolved
mc/vfs/vfs.c:267: Warning: explicit link request to 'op' could not be resolved
mc/vfs/vfs.c:267: Warning: explicit link request to 'op' could not be resolved

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-16 11:10:42 +02:00
Andrew Borodin
d3e91b0711 Fixed forgotten call of va_end() in mc_log().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:41 +02:00
Andrew Borodin
34e6b6c036 src/boxes.c (configure_vfs): fixed #ifdef directive.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:41 +02:00
Sergei Trofimovich
7670235dfc m4.include/mc-cflags.m4: added -fdiagnostics-show-option (exact warning option)
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-16 11:10:41 +02:00
Sergei Trofimovich
7fcef13e61 configure.ac: guard $CFLAGS with "" in tests
Fixes ./configure error:
../mc/configure: line 42709: test: too many arguments

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-16 11:10:41 +02:00
Sergei Trofimovich
053cd1fc52 m4.include/mc-cflags.m4: sorted CFLAGS (no flags were added or removed)
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-16 11:10:41 +02:00
Sergei Trofimovich
68417a334f cflags: enable -Wformat in maintainer mode
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-16 11:10:41 +02:00
Sergei Trofimovich
981c19b651 fix formatarg: pass ll instead of passing off_t as "%lld" parameter
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-16 11:10:41 +02:00
Sergei Trofimovich
4f2079fec7 clang: fixed useful warnings (-Wformat related)
../../mc/edit/editcmd.c:2519:50: error: field precision should have type 'int', but argument has type 'gsize' (aka 'unsigned long') [-Wformat]
    match_expr = g_strdup_printf ("(^|\\s+|\\b)%.*s[^\\s\\.=\\+\\[\\]\\(\\)\\,\\;\\:\\\"\\'\\-\\?\\/\\|\\\\\\{\\}\\*\\&\\^\\%%\\$#@\\!]+", word_len, bufpos);
                                                 ^                                                                                         ~~~~~~~~
../../mc/edit/editcmd.c:2700:38: error: field precision should have type 'int', but argument has type 'gsize' (aka 'unsigned long') [-Wformat]
    match_expr = g_strdup_printf ("%.*s", word_len, bufpos);
                                     ^    ~~~~~~~~
2 diagnostics generated.
make[2]: *** [editcmd.o] Error 1
make[2]: Target `all' not remade because of errors.
../../../mc/src/mcconfig/common.c:71:74: error: format string is not a string literal (potentially insecure) [-Wformat-security]
        g_propagate_error (error, g_error_new (mc_main_error_quark() ,0, strerror(errno)));
                                                                         ^~~~~~~~~~~~~~~
../../../mc/src/mcconfig/common.c:83:74: error: format string is not a string literal (potentially insecure) [-Wformat-security]
        g_propagate_error (error, g_error_new (mc_main_error_quark() ,0, strerror(errno)));
                                                                         ^~~~~~~~~~~~~~~
2 diagnostics generated.
make[3]: *** [libmcconfig_la-common.lo] Error 1
make[3]: Target `all' not remade because of errors.
../../mc/src/main.c:2165:41: error: format string is not a string literal (potentially insecure) [-Wformat-security]
        message (D_ERROR, _("Warning"), error->message);
                                        ^~~~~~~~~~~~~~
1 diagnostic generated.

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-16 11:10:41 +02:00
Andrew Borodin
3e12139a94 Editor: some code clean up.
Removed unneeded goto, return, #ifdef.
Type accuracy.
Indentation.
Minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-16 11:10:41 +02:00
Andrew Borodin
06311a3e40 Refactoring of editor initialization.
Since button bar is a part of editor dialog, its initialization
was moved from WIDGET_INIT stage to DLG_INIT one.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:40 +02:00
Slava Zanko
71bb255b2c Refactoring of edit_replace_cmd__conv_to_display() and edit_replace_cmd__conv_to_input() functions.
Now these functions will return newly allocated string in any case.
As third-side effect, fixed memory leak with '--disable-charset' configure option.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-16 11:10:40 +02:00
Andrew Borodin
c57bdc79ba Fixed typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:40 +02:00
Ilia Maslakov
af79d7b3ef fixed uninitialised editor buffers (detected by valgrind) thnx andrew_b
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-12-16 11:10:40 +02:00
Andrew Borodin
d2e096044d Some speed optimization of editor.
Functions that are called only in one place have been maken inline.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:40 +02:00
Slava Zanko
771a2958ad configure.ac: Optimization of building 'CFLAGS' variable.
Now user-defined CFLAG (from envirovement) have higest priority before
internal definitions.

Also, patch have change for respect code optimization options from user.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-16 11:10:40 +02:00
Oswald Buddenhagen
4bc224dd3c Ticket #1845: Code cleanup before 4.7.0 release.
Little optimization for src/filehighlight/get-color.c:c_fhl_is_stale_link() function.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-16 11:10:15 +02:00
Ilia Maslakov
a45d0ba6c2 Merge branch '1789_remove_setuid_getuid_checks'
* 1789_remove_setuid_getuid_checks:
  Ticket #1789: Removed obsolete checks for setuid(), getuid(), etc
2009-12-15 18:15:58 +03:00
Enrico Weigelt, metux IT service
d579bb7877 Ticket #1789: Removed obsolete checks for setuid(), getuid(), etc
Removed obsolete checks for setuid(), getuid(), etc

Signed-off-by: Enrico Weigelt <weigelt@metux.de>
2009-12-15 18:13:40 +03:00
Ilia Maslakov
72c30eda5f Merge branch '1788_remove_pwd_h_grp_h_check'
* 1788_remove_pwd_h_grp_h_check:
  Ticket #1788: remove obsolete checks for <pwd.h> and <grp.h>
2009-12-15 18:04:37 +03:00
Enrico Weigelt, metux IT service
551ac003a4 Ticket #1788: remove obsolete checks for <pwd.h> and <grp.h>
remove obsolete checks for <pwd.h> and <grp.h>

Signed-off-by: Enrico Weigelt, metux IT service <weigelt@metux.de>
2009-12-15 18:00:02 +03:00
Ilia Maslakov
18c5f4e315 Merge branch '1786_remove_sys_wait_h_check'
* 1786_remove_sys_wait_h_check:
  Ticket #1786: remove obsolete check for <sys/wait.h>
2009-12-15 17:21:46 +03:00
Enrico Weigelt, metux IT service
2b4f8103ce Ticket #1786: remove obsolete check for <sys/wait.h>
remove obsolete check for <sys/wait.h>
    This file is C standard, so no explicit check necessary.

Signed-off-by: Enrico Weigelt <weigelt@metux.de>
2009-12-15 17:20:36 +03:00
Ilia Maslakov
a011fcbcca Merge branch '1724_mismatched_hotkeys'
* 1724_mismatched_hotkeys:
  Ticket #1724 (mismatched hotkeys)
2009-12-15 14:57:23 +03:00
Ilia Maslakov
8c2e8c9702 Ticket #1724 (mismatched hotkeys)
fixed mismatched hotkeys EditBeginningOfText, EditEndOfText
    EditBeginPage, EditEndPage (mc.keymap.default, mc.keymap.emacs)

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-12-15 14:54:52 +03:00
Slava Zanko
a0930b7268 Merge branch '1796_fix_passive'
* 1796_fix_passive:
  Ticket #1796: FTPFS does not work in active mode.
2009-12-15 13:26:19 +02:00
Slava Zanko
c0ebaf5bd3 Ticket #1796: FTPFS does not work in active mode.
Fix commit for work in passive ftp-mode.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-15 13:26:03 +02:00
Enrico Weigelt, metux IT service
58b1609559 Merge remote branch 'mco/1787_remove_stdlib_h_check'
* mco/1787_remove_stdlib_h_check:
  Ticket #1787: remove obsolete checks for <stdlib.h>
2009-12-14 22:02:07 +01:00
Enrico Weigelt, metux IT service
e9b01c6400 Ticket #1787: remove obsolete checks for <stdlib.h> 2009-12-13 05:29:35 +01:00
Enrico Weigelt, metux IT service
a7deeaa8fc Merge branch '1783_remove_bzero_decl'
* 1783_remove_bzero_decl:
  Ticket #1783: remove own declaration of bzero()
2009-12-12 21:07:12 +01:00
Enrico Weigelt, metux IT service
294f58e85d Ticket #1783: remove own declaration of bzero() 2009-12-12 21:06:40 +01:00
Enrico Weigelt, metux IT service
67f33e767a Merge branch '1782_remove_ftruncate_decl'
* 1782_remove_ftruncate_decl:
  Ticket #1782: Remove own declaration of ftruncate()
2009-12-12 21:02:06 +01:00
Enrico Weigelt, metux IT service
c99db81350 Ticket #1782: Remove own declaration of ftruncate() 2009-12-12 21:01:46 +01:00
Enrico Weigelt, metux IT service
53483ba170 Merge branch '1784_remove_strdup_decl'
* 1784_remove_strdup_decl:
  Ticket #1784: remove own declaration of strdup
2009-12-12 20:59:48 +01:00