Commit Graph

83 Commits

Author SHA1 Message Date
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
Andrew V. Samoilov
3fff2ff3c9 * subshell.c (init_subshell_child): Does not g_strdup() constant string
in putenv() calls.
2004-12-08 13:07:53 +00:00
Andrew V. Samoilov
cee8133838 * subshell.c (do_subshell_chdir): Filter out a possible password from
warning dialog.

        * command.c (do_cd_command): Likewise.

        * screen.c (panel_callback): Likewise.

        * util.c (path_trunc): Add function. path_trunc() is the same as
        name_trunc(), but it deletes possible password from path for security
        reasons.

        * util.h: Add functions path_trunc().

        * filegui.c (file_progress_show_target): Filter out a possible password
        from dialog.
        (file_progress_show_deleting): Likewise.
        (file_mask_dialog): Likewise.

        * file.c (move_file_file): Likewise.
        (move_dir_dir): Likewise.
        (file_error): Likewise.
        (files_error): Likewise.
        (real_query_recursive): Likewise.

        * hotlist.c (add2hotlist): Typo fix.
2004-11-03 19:43:17 +00:00
Roland Illig
8b1e87523a * boxes.c (display_unit): Added const qualifier.
* file.c (check_hardlinks): Likewise.
	* find.c (find_do_view_edit): Likewise. (find_file): Likewise.
	* global.h (home_dir): Likewise.
	* main.c (get_parent_dir_name): Likewise. (init_xterm_support):
	Likewise. (OS_Setup): Likewise.
	* menu.c (create_menu): Likewise.
	* mountlist.c (xatoi): Likewise. (read_filesystem_list): Likewise.
	* poptconfig.c (poptReadDefaultConfig): Likewise.
	* popthelp.c (showHelpIntro): Likewise.
	* rxvt.c (look_for_rxvt_extensions): Likewise.
	* slint.c (has_colors): Likewise.
	* subshell.c (check_sid): Likewise.
	* user.c (check_format_var): Likewise.
	* widget.c (radio_callback): Likewise.
2004-09-25 13:46:23 +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
Andrew V. Samoilov
2253379eb8 * subshell.c (exit_subshell): Prevent unwanted reuse of freed
pty_buffer.
        * complete.c (variable_completion_function): strncpy()->memcpy()
        changes are because we know there is no '\0' among the first
        length bytes.
        (insert_text): Likewise.
        (command_completion_function): Avoid memory leaks.
        (filename_completion_function): g_free handles NULL argument too,
        no need for the comparison.
        (try_complete): Likewise.
        (command_completion_function): Likewise.
        (free_completions): Likewise.
        * widget.c (gauge_callback): Fix for 64-bit arches (%*s len must
        be int, %3d takes int.
        (copy_region): g_free handles NULL argument too, no need for
        the comparison.
        (kill_line): Likewise.
        * find.c (do_search): Likewise.
        (init_find_vars): Likewise.
        (do_find): Likewise.
2004-09-03 22:00:27 +00:00
Roland Illig
7bff9337c0 * Code cleanup: Added const qualifier for variables and
function declarations where possible. Additionally wrapped
	the calls to putenv() by g_strdup().
2004-08-29 23:59:17 +00:00
Roland Illig
bfb2047463 Removed unnecessary type cast. 2004-08-16 16:22:14 +00:00
Roland Illig
f4129bc22b Fixed a format string bug (%s => %d). 2004-08-16 05:17:49 +00:00
Roland Illig
60ae60fb1e Print the pid as an int. 2004-08-16 04:57:07 +00:00
Roland Illig
4afb6e832d Added a prototype to the function declaration. 2004-08-16 03:24:49 +00:00
Pavel Roskin
d78f9b9bf0 * subshell.c: Partly revert previous patch to preserve translated strings. 2004-03-05 08:08:13 +00:00
Pavel Roskin
b46fe283f6 Fix use of uninitialized pty_name. 2004-02-10 00:16:17 +00:00
Pavel Roskin
7eb0ef8bd2 * subshell.c: Use "rn" at the end of all error messages.
Don't use perror().  Make error messages more exact.
2004-02-10 00:11:09 +00:00
Pavel Roskin
24384e9a89 * panel.h: Fix duplication between cpanel and current_panel in
favor of current_panel.  Ditto opanel and other_panel.
2003-10-26 06:45:59 +00:00
Pavel Roskin
17a04526cf * subshell.c (pty_open_master) [HAVE_GRANTPT]: Prefer
posix_openpt() over GNU-specific getpt().  Needed for FreeBSD
5.x.  Original patch by Max Khon <fjoe@FreeBSD.org>
2003-07-21 23:33:34 +00:00
Pavel Roskin
5b2bd08768 * configure.in: Remove test for SCO UNIX. Remove all references
to SCO_FLAVOR everywhere.  SCO flavor is rather unsavory now.
2003-06-18 04:47:17 +00:00
Pavel Roskin
1fc1bdd0a4 * command.c (command_new): Fix memory leak.
* subshell.c (exit_subshell): Free pty_buffer.
2003-06-06 15:52:13 +00:00
Pavel Roskin
022fce89cb * subshell.c: Remove dead code (SYNC_PTY_SIDES).
(init_subshell_child): Remove dead code (initfile for TCSH).
(init_subshell): Use ZSH_VERSION environment variable to detect
ZSH.  Use -g option to zsh to hide entries beginning with space
from history.  Add space before ZSH precmd to hide it.
2003-03-22 05:15:46 +00:00
Pavel Roskin
2915491aa0 Call check_sid() only if possible. 2003-03-05 20:23:50 +00:00
Pavel Roskin
861deaf09d * subshell.c (init_subshell_child): Set environment variable
MC_SID to the session number of the subshell.
(check_sid): Check that we are not running mc already in the
same session.
* main.c (main): Don't run do_nc() if shutdown was requested.
2003-03-05 20:18:11 +00:00
Pavel Roskin
ff82223a35 Remove references to the archaic "linux" preprocessor definition.
Only __linux__ should be used.
2003-02-27 05:09:35 +00:00
Pavel Roskin
8e7ad454d6 * subshell.c (resize_tty) [!TIOCSWINSZ]: Warning fix. 2003-01-24 21:00:49 +00:00
Pavel Roskin
107e1f0954 Partly revert last change - subshell_switch_key has to be char. 2002-12-24 03:05:09 +00:00
Pavel Roskin
5da0a2f08a * subshell.c (subshell_switch_key): Make static const int. 2002-12-24 00:13:30 +00:00
Pavel Roskin
b246f3c7ea s/Could not/Cannot/ 2002-12-08 01:12:18 +00:00
Pavel Roskin
996886fcfd Update includes. 2002-11-14 17:08:56 +00:00
Pavel Roskin
2c3b0c50b6 * subshell.c (subshell_name_quote): Don't quote numbers and
letters if possible and safe.
2002-10-31 04:01:19 +00:00
Pavel Roskin
d3f0a2f61b Remove spaces around "Error" and "Warning" together with their translations.
Also remove spaces from "Quit" and "Search", but leave alone the
translations, that already have them without spaces.
2002-10-21 04:13:49 +00:00
Pavel Roskin
a3f9820755 * subshell.c (pty_open_master) [IS_AIX]: Open /dev/ptc, not
/dev/ptmx.  From Sergey Pavlukhin <psi@dmng.ru>
2002-09-25 04:38:29 +00:00
Pavel Roskin
c785d4195b * global.h: Move fcntl.h inclusion here. Define O_BINARY.
* mountlist.c: Remove more includes already handled in global.h.
2002-09-23 06:43:22 +00:00
Pavel Roskin
547567ae47 * subshell.c: Move tcsh_fifo to the file scope. Use mc_tmpdir()
to calculate tcsh_fifo.
2002-09-11 05:23:18 +00:00
Pavel Roskin
7d723361b2 * subshell.c (subshell_name_quote): Return NULL if we are out of
memory.  Use "echo -e" with zsh (Debian bug #150996).
(do_subshell_chdir): Be prepared to get NULL from
subshell_name_quote().
2002-09-07 00:27:53 +00:00
Pavel Roskin
60f9328e8d * key.c: Use the maximal file descriptor, not FD_SETSIZE in all
calls to select().
* subshell.c: Likewise.
2002-08-25 05:44:57 +00:00
Pavel Roskin
d1e02fba0f * subshell.c (synchronize): Workaround for Cygwin (should not be
needed for the next version) - remove SIGCHLD blocking from
old_mask.
2002-08-19 22:28:00 +00:00
Pavel Roskin
11bd8d9c39 * subshell.c (synchronize): Discard all remaining data from
stdin to the subshell.
2002-08-19 02:06:01 +00:00
Pavel Roskin
105877896d * subshell.c (exit_subshell) [AIX_TCSH_CODE_BELOW_IS_IT_FIXED]:
Remove.  Nobody has fixed this code for years.
2002-08-19 01:54:34 +00:00
Pavel Roskin
f0dbdeb72e * subshell.c (read_subshell_prompt): Remove argument "how", it's
never set to VISIBLY.  Adjust all dependencies.  Eliminate hack
with "clear_now" - it causes invalid memory access and hides the
real problem.
* util.c (strip_ctrl_codes): Fix possible invalid memory access
if the escape sequence ends unexpectedly.
2002-08-15 06:53:44 +00:00
Pavel Roskin
b7cdfa9c93 * main.c (sigchld_handler_no_subshell) [linux]: SIGTSTP is
always defined on Linux.
* subshell.c (sigchld_handler): No need to use SIGTSTP
explicitly when we really care about SIGCONT.
2002-08-09 23:36:06 +00:00
Pavel Roskin
e26cef8825 * subshell.c: Assume that SIGTSTP and SIGCONT are always
defined.  This is now checked in configure.  Otherwise
synchronize() would hang until subshell exits.
2002-08-04 06:59:34 +00:00
Pavel Roskin
e2a37d3809 * charsets.c: Unconditionally enable finalization code that was
only used with HAVE_MAD.
* color.c: Likewise.
* color.h: Likewise.
* key.c: Likewise.
* main.c: Likewise.
* slint.c: Likewise.
* subshell.c (exit_subshell): Free subshell_prompt.
2002-08-01 20:31:52 +00:00
Pavel Roskin
2935c85c85 * subshell.c (feed_subshell): Reading 0 bytes in a channel with
FD_ISSET being set is a sign of something being wrong - exit
immediately.  Observed when mc is run under su in xterm and
xterm is closed while the subshell is running.
Reported by Vlad Harchev <hvv@hippo.ru>
2002-07-30 00:03:26 +00:00
Pavel Roskin
073e17a8d0 * subshell.c: ioctl() doesn't set errno - don't use perror() to
report failures.  Use fprintf() instead, ignore errors from
TIOCSWINSZ.
(resize_tty): New function - code common for resize_subshell()
and init_subshell_child().
2002-07-10 22:49:08 +00:00
Pavel Roskin
0c0a5ae270 * subshell.c (sigchld_handler): Remove subshell_pty from the
channel list if the subshell has died.
2002-07-03 16:35:42 +00:00
Pavel Roskin
2b7cf88d85 * global.h: Include unix.h under "classical" QNX.
* subshell.c: Don't include unix.h.
* utilunix.c: Likewise.
2002-02-18 21:54:27 +00:00
Pavel Roskin
b03032c29b * main.c: Remove support for subshell debugging. Firstly, it
was broken.  Secondly, every developer should be able to add
this code when needed.  Finally, there is no need to expose the
option to the user and translate it into 30 languages.
* subshell.h: Remove debug_subshell.
* subshell.c: Likewise.
2001-11-12 22:09:40 +00:00
Pavel Roskin
13e92aca94 * layout.c: Use HAVE_TERMIOS_H and HAVE_SYS_IOCTL_H more
consistently.
* mouse.c: Likewise.
* subshell.c: Likewise.
* win.c: Likewise.
* util.c: Remove unused includes.
2001-09-11 02:18:02 +00:00
Pavel Roskin
a16f742216 * subshell.c: Move definitions of WEXITSTATUS and WIFEXITED
below all includes so that they can be defined elsewhere.
2001-09-08 05:36:23 +00:00
Pavel Roskin
c11389facb * global.h: Include io.h, pwd.h, grp.h and utime.h. Adjust all
sources not to include them and to include global.h at the right
place.
2001-09-07 17:52:19 +00:00
Pavel Roskin
a8ef641beb * x.h: Remove. Adjust all users. Make sure that global.h is
included instead.  Don't include sys/param.h unconditionally -
rely on global.h taking care of it.
* Makefile.in: Remove x.h.
2001-09-03 05:07:40 +00:00