Commit Graph

113 Commits

Author SHA1 Message Date
Mikhail S. Pobolovets
758ab591d8 Simple doxygen description for files in src directory.
Mostly \file and \brief tag added.

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-02-10 16:07:59 +02:00
Slava Zanko
e54f318cef Completely removed MHL stuff
Changed all source files relative to remove MHL

Some string-related functions moved into src/util.c

This stable fix.
2009-02-06 14:01:28 +02:00
Patrick Winnertz
589ffd0b10 Use g_snprintf instead of snprintf as we switch back to glib
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-05 23:49:00 +01:00
Patrick Winnertz
ae987b923e Reverted the use of bool in favour of gboolean
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-05 23:46:07 +01:00
Patrick Winnertz
d84586ba82 Reverted the use of mhl_str_dup and use g_strdup instead.
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-05 23:40:32 +01:00
Patrick Winnertz
1c287d798d First bunch of mhl_mem_free removal patches
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-05 23:36:58 +01:00
Patrick Winnertz
155fd328a4 Revert second bunch of mhl patches (see 9b9cab5874)
This reintroduce GString again and drop the use of mhl_mem_free in some files

Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-05 23:18:38 +01:00
Patrick Winnertz
5920d13810 First bunch of reverting stuff from mhl to switch back to glib
This removes the usage of stdbool.h in favour of mhl/tyes.h as we have to revert everything one by one

Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-05 23:09:37 +01:00
Enrico Weigelt, metux IT service
0c97636212 fixed #240 2009-02-04 01:11:56 +01:00
Enrico Weigelt, metux IT service
9b9cab5874 manually merged 234_remove_g_string 2009-02-02 22:39:12 +01:00
Enrico Weigelt, metux IT service
8b38cf44da manully merged 227_replace_g_free 2009-02-02 22:34:05 +01:00
Enrico Weigelt, metux IT service
035fa47c06 manually merged 228_replace_g_strdup 2009-02-02 21:28:01 +01:00
Enrico Weigelt, metux IT service
7015de5db5 Merge commit 'origin/236_replace_gboolean' 2009-02-02 21:16:39 +01:00
Enrico Weigelt, metux IT service
0434e3de5d manually merged 235_remove_g_snprintf 2009-02-02 20:53:03 +01:00
Enrico Weigelt, metux IT service
45964f373b replaced gboolean by bool (from mhl/types.h) 2009-02-02 05:07:56 +01:00
Enrico Weigelt, metux IT service
e4a4f77ac2 replaced g_snprintf() by snprintf() 2009-02-01 20:03:28 +01:00
Sergei Trofimovich
df4129517b Merge branch 'mc-4.6'
* mc-4.6: (38 commits)
  mhl: mhl_shell_unescape_buf(): fixed memory array OOB.
  completion: fixed complete already escaped secuences.
  completion: added changelog entry for solved #147
  completion: fixed completion of escaped commands in commandline
  Removed unused char*.
  mhl: added mhl_strmove() function (memmove semantics)
  completion: added escapes in command line on completion
  complete: cleanup: #define to enum INPUT_COMPLETION_FLAGS
  added a new parameter for completion flags to input_new
  fish: cleanup: unboxed quoted strings when generate shell commands
  introduced new type SHELL_ESCAPED_STR for more type safety
  added mhl/types.h which defines bool enum, escape.h now using this type
  Removed unused variable
  Changes for use MHL.
  Fixed bug with renamig/copying files with backshashes in names
  Remove some testing stuff
  Temporarry commit. Fixed completion in browse by directoryes.
  Fixed some memory leaks.
  Add $ and ` for escaping and reorder it according to the ascii values
  Rewrite it to use g_string_append_c instead of some homebrew stuff
  ...
2009-02-01 14:26:54 +02:00
Enrico Weigelt, metux IT service
f921cc40cd replaced calls to g_strdup() by mhl_str_dup() 2009-01-30 20:10:40 +01:00
Enrico Weigelt, metux IT service
15d7d47c15 replaced g_free() by mhl_mem_free() 2009-01-30 19:28:35 +01:00
Sergei Trofimovich
e48cb7c89f mhl: added mhl_strmove() function (memmove semantics)
valgrind detected an error in completion path:
==2962== Source and destination overlap in strcpy(0x459F068, 0x459F06A)
==2962==    at 0x4026056: strcpy (mc_replace_strmem.c:268)
==2962==    by 0x808F70B: canonicalize_pathname (string3.h:106)
==2962==    by 0x805ECBA: filename_completion_function (complete.c:125)
==2962==    by 0x805FB35: command_completion_function (complete.c:448)
==2962==    by 0x805EA34: completion_matches (complete.c:552)
==2962==    by 0x8060454: complete (complete.c:735)
==2962==    by 0x809AAC4: handle_char (widget.c:1545)
==2962==    by 0x807867E: midnight_callback (dialog.h:201)
==2962==    by 0x8061B27: dlg_process_event (dialog.c:664)
==2962==    by 0x8061ECE: run_dlg (dialog.c:786)
==2962==    by 0x807996C: main (main.c:1674)

Snippet of man strcpy:
DESCRIPTION
       The  strcpy()  function copies the string pointed to by src, including the terminating
       null byte ('\0'), to the buffer pointed to by dest.  ___The strings may not overlap___,
       and the destination string dest must be  large enough to receive the copy.
We used strcpy to move data chunk in memory: "./foo" -> "foo", etc.

This patch introduces mhl_strmove and fixed canonicalize_pathname.

Signed-off-by: Sergei Trofimovich <st@anti-virus.by>
2009-01-30 09:31:28 +02:00
Enrico Weigelt, metux IT service
154feb5160 2009-01-10 Enrico Weigelt, metux ITS <weigelt@metux.de>
* edit/editcmd.c:
    * src/achown.c src/background.c src/boxes.c src/chmod.c:
    * src/chown.c src/cmd.c src/command.c src/dir.c src/execute.c:
    * src/ext.c src/file.c src/filegui.c src/find.c src/help.c:
    * src/learn.c src/main.c src/panelize.c src/screen.c:
    * src/selcodepage.c src/subshell.c src/tree.c src/user.c:
    * src/utilunix.c src/view.c:
    * vfs/cpio.c vfs/direntry.c vfs/extfs.c vfs/fish.c vfs/ftpfs.c:
    * vfs/mcfs.c vfs/sfs.c vfs/smbfs.c vfs/tar.c vfs/undelfs.c:
    * vfs/utilvfs.c vfs/vfs.c:

    Changed message type codes on calls to message(), query_dialog(),
    close_error_pipe() from numeric IDs to symbols D_ERROR, D_NORMAL
2009-01-10 14:13:56 +01:00
Pavel Tsekov
2f3df3af4e * edit/bookmark.c: Update copyright notice.
* edit/edit.c: Likewise.
* edit/editcmd.c: Likewise.
* edit/editdraw.c: Likewise.
* edit/editkeys.c: Likewise.
* edit/editlock.c: Likewise.
* edit/editmenu.c: Likewise.
* edit/editoptions.c: Likewise.
* edit/editwidget.c: Likewise.
* edit/syntax.c: Likewise.
* src/background.c: Likewise.
* src/boxes.c: Likewise.
* src/complete.c: Likewise.
* src/execute.c: Likewise.
* src/ext.c: Likewise.
* src/file.c: Likewise.
* src/filegui.c: Likewise.
* src/fileopctx.c: Likewise.
* src/find.c: Likewise.
* src/hotlist.c: Likewise.
* src/key.c: Likewise.
* src/keyxdef.c: Likewise.
* src/layout.c: Likewise.
* src/learn.c: Likewise.
* src/listmode.c: Likewise.
* src/main.c: Likewise.
* src/panelize.c: Likewise.
* src/slint.c: Likewise.
* src/textconf.c: Likewise.
* src/tree.c: Likewise.
* src/treestore.c: Likewise.
* src/tty.c: Likewise.
* src/util.c: Likewise.
* src/utilunix.c: Likewise.
* src/view.c: Likewise.
* src/widget.c: Likewise.
* src/wtools.c: Likewise.
* src/x11conn.c: Likewise.
* vfs/cpio.c: Likewise.
* vfs/extfs.c: Likewise.
* vfs/fish.c: Likewise.
* vfs/ftpfs.c: Likewise.
* vfs/gc.c: Likewise.
* vfs/mcfs.c: Likewise.
* vfs/mcserv.c: Likewise.
* vfs/smbfs.c: Likewise.
* vfs/tar.c: Likewise.
2007-09-25 15:33:35 +00:00
Pavel Tsekov
23361694b6 * src/background.c: Use the correct form of FSF's name in the copyright
notice.
* src/boxes.c: Ditto.
* src/complete.c: Ditto.
* src/execute.c: Ditto.
* src/ext.c: Ditto.
* src/file.c: Ditto.
* src/filegui.c: Ditto.
* src/fileopctx.c: Ditto.
* src/fileopctx.h: Ditto.
* src/find.c: Ditto.
* src/hotlist.c: Ditto.
* src/key.c: Ditto.
* src/keyxdef.c: Ditto.
* src/layout.c: Ditto.
* src/learn.c: Ditto.
* src/listmode.c: Ditto.
* src/main.c: Ditto.
* src/panelize.c: Ditto.
* src/slint.c: Ditto.
* src/textconf.c: Ditto.
* src/tree.c: Ditto.
* src/treestore.c: Ditto.
* src/tty.c: Ditto.
* src/util.c: Ditto.
* src/utilunix.c: Ditto.
* src/view.c: Ditto.
* src/widget.c: Ditto.
* src/wtools.c: Ditto.
* src/x11conn.c: Ditto.
* vfs/cpio.c: Ditto.
* vfs/extfs.c: Ditto.
* vfs/fish.c: Ditto.
* vfs/ftpfs.c: Ditto.
* vfs/gc.c: Ditto.
* vfs/mcfs.c: Ditto.
* vfs/mcserv.c: Ditto.
* vfs/smbfs.c: Ditto.
* vfs/tar.c: Ditto.
* vfs/undelfs.c: Ditto.
* vfs/utilvfs.c: Ditto.
* vfs/vfs.c: Ditto.
* edit/bookmark.c: Ditto.
* edit/edit.c: Ditto.
* edit/edit.h: Ditto.
* edit/editcmd.c: Ditto.
* edit/editdraw.c: Ditto.
* edit/editkeys.c: Ditto.
* edit/editlock.c: Ditto.
* edit/editmenu.c: Ditto.
* edit/editoptions.c: Ditto.
* edit/editwidget.c: Ditto.
* edit/syntax.c: Ditto.
2007-09-24 09:28:32 +00:00
Pavel Tsekov
8e04248ef9 * src/utilunix.c (mc_tmpdir): Do not accept relative path in TMPDIR. Use
a hardcoded value instead.
2007-02-22 11:49:01 +00:00
Pavel Tsekov
cfdc950171 * src/utilunix.c (mc_tmpdir): Call mc_mkstemps() with an absolute
path to prevent stack overflows due to circular dependecy.
2007-01-02 15:55:01 +00:00
Leonard den Ottolander
772c2600b9 * utilunix.c (mc_tmpdir): Check that tmpdir is correctly initialized. 2005-07-27 15:03:24 +00:00
Roland Illig
c22e826761 Updated German translation. 2005-07-22 21:16:50 +00:00
Pavel Roskin
1f60f44145 Update postal address of Free Software Foundation. 2005-05-27 03:35:10 +00:00
Roland Illig
6407873f69 * cons.handler.c: Marked unused parameters.
* dir.c: Likewise.
	* find.c: Likewise.
	* help.c: Likewise.
	* layout.c: Likewise.
	* mountlist.c: Likewise.
	* popt.c: Likewise.
	* poptconfig.c: Likewise.
	* popthelp.c: Likewise.
	* regex.c: Likewise.
	* subshell.c: Likewise.
	* tree.c: Likewise.
	* util.c: Likewise.
	* utilunix.c: Likewise.
	* widget.c: Likewise.
	* wtools.c: Likewise.
2005-02-08 22:33:52 +00:00
Roland Illig
fc85bdba7e * *.c: Reordered header inclusion. 2005-02-08 09:04:03 +00:00
Andrew V. Samoilov
711f268786 * utilunix.c (mc_realpath) [USE_SYSTEM_REALPATH]: Use realpath(). 2005-02-02 18:28:49 +00:00
Andrew V. Samoilov
172cead7fb * utilunix.c (init_groups): Use glib memory allocation functions. 2005-02-01 12:04:05 +00:00
Miguel de Icaza
324f4c5644 2005-01-29 Miguel de Icaza <miguel@novell.com>
* utilunix.c (init_groups): Added support for getgrouplist patch
	from Stefan Gohmann <gohmann@univention.de>.

2005-01-29  Miguel de Icaza  <miguel@novell.com>

	* configure.ac: Check for getgrouplist API call.
2005-01-30 05:06:13 +00:00
Andrew V. Samoilov
d332606fd5 * subshell.c (do_subshell_chdir): Use mc_realpath() to fix tcsh's
problem with symlink.
        * utilunix.c: Add function mc_realpath(). Is the BSD version of
        realpath(3).
        * util.h: Add mc_realpath() declaration.
2005-01-13 19:37:46 +00:00
Roland Illig
612e8238c9 * utilunix.c (mc_tmpdir): Use putenv(3) instead of setenv(3) if
the latter is not available. Needed for Solaris.
2004-11-01 12:03:45 +00:00
Roland Illig
11f8d4e2ea * utilunix.c (mc_tmpdir): Convert uid to unsigned long for
pathname of the temporary directory.
2004-10-23 12:55:35 +00:00
Roland Illig
3716da314b * utilunix.c (mc_tmpdir): Convert uid to int for pathname
of the temporary directory.

	From Pavel Tsekov <ptsekov gmx net>.
2004-10-23 07:18:48 +00:00
Roland Illig
d3774b9d94 * utilunix.c (close_error_pipe): Fixed possible invalid memory access
(three lines below).
2004-10-11 21:53:30 +00:00
Andrew V. Samoilov
68a7c1dfab * boxes.c (configure_vfs): g_free handles NULL argument too,
no need for the comparison.
        * cmd.c (set_panel_filter_to): Likewise.
            (do_link): Likewise.
            (quick_cd_cmd): Likewise.
        * color.c (done_colors): Likewise.
        * dialog.c (destroy_dlg): Likewise.
        * dir.c (alloc_dir_copy): Likewise.
        * ext.c (flush_extension_file): Likewise.
        * file.c (copy_file_file): Likewise.
            (panel_operate): Likewise.
        * hotlist.c (remove_group): Likewise.
            (remove_from_hotlist): Likewise.
            (done_hotlist): Likewise.
        * main.c (main): Likewise.
        * setup.c (panel_load_setup): Likewise.
        * tree.c (tree_destroy): Likewise.
            (show_tree): Likewise.
        * user.c (user_menu_cmd): Likewise.
        * utilunix.c (i_cache_add): Likewise.
            (putenv): Likewise.
        * view.c (view_done): Likewise.
            (regexp_search): Likewise.
            (normal_search): Likewise.
            (change_viewer): Likewise.
        * widget.c (label_set_text): Likewise.
            (set_label_text): Likewise.
2004-09-24 22:22:35 +00:00
Roland Illig
11842a375f 2004-09-24 Roland Illig <roland.illig@gmx.de>
* boxes.c: Replaced NULL with (char *) NULL. Likewise for 0, where
	NULL was meant.
	* cmd.c: Likewise.
	* dialog.c: Likewise.
	* ext.c: Likewise.
	* file.c: Likewise.
	* find.c: Likewise.
	* hotlist.c: Likewise.
	* learn.c: Likewise.
	* main.c: Likewise.
	* screen.c: Likewise.
	* setup.c: Likewise.
	* treestore.c: Likewise.
	* user.c: Likewise.
	* util.c: Likewise.
	* utilunix.c: Likewise.
	* view.c: Likewise.
	* widget.c: Likewise.
	* wtools.c: Likewise.
2004-09-24 15:05:28 +00:00
Roland Illig
e0f5d6e37f * cons.handler.c (handle_console_linux): Replaced NULL with
(char *) NULL in call to execl.
	* subshell.c (init_subshell_child): Likewise.
	* utilunix.c (my_system): Likewise.

	From patches from the OpenBSD ports collection.
2004-09-24 14:02:39 +00:00
Roland Illig
9c334b4dd8 * achown.c: Added const qualifiers and const_cast.
* background.c: likewise.
	* boxes.c: likewise.
	* file.c: likewise.
	* filegui.c: likewise.
	* find.c: likewise.
	* hotlist.c: likewise.
	* info.c: likewise.
	* layout.c: likewise.
	* myslang.h: likewise.
	* option.c: likewise.
	* user.c: likewise.
	* util.c: likewise.
	* utilunix.c: likewise.
	* view.c: likewise.
	* widget.c: likewise.
2004-09-19 15:55:58 +00:00
Andrew V. Samoilov
8919656440 * utilunix.c (tilde_expand): Fix extra slash in result from tilde_expand() for ~<user>/dir. 2004-09-14 17:23:16 +00:00
Roland Illig
17714fd8d9 * Code cleanup: Added const qualifier for variables and
function declarations where possible. No functional changes.
2004-08-29 23:20:01 +00:00
Andrew V. Samoilov
6ca233ecea * utilunix.c (tilde_expand): Use more suitable function
g_strndup, instead sequence g_malloc, strncpy, name[len] = '\0'
2004-08-20 21:28:05 +00:00
Andrew V. Samoilov
fecb161283 x.c (mc_tmpdir): Fix typos in comment.
Set MC_TMPDIR environment variable for vfs scripts.
        Clear error after successful test of mc temp dir.
2004-08-18 20:34:01 +00:00
Andrew V. Samoilov
72488a9d6c mc_tmpdir: Check return value of getpwuid() for NULL. 2004-08-17 18:45:47 +00:00
Pavel Roskin
291f976b13 * utilunix.c (canonicalize_pathname): Add support for UNC paths. 2004-01-24 00:17:34 +00:00
Pavel Roskin
4ced5086ac * utilunix.c (canonicalize_pathname): Return void to make it
clear that the conversion is done in place.  Adjust all callers.
2004-01-23 23:53:37 +00:00
Pavel Roskin
e30307ea4a * utilunix.c (tilde_expand): Correct last fix, simplify code.
Reported by David Sterba <dave@jikos.cz>
2003-11-28 15:23:19 +00:00