mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-01 03:36:26 -04:00
Patch: fix for bug 938
This patch prevents handle_itrm_stdin() and clear_handlers(itrm->in.std) to be called when -remote is set and in.std < 0. It adds two assertions for in.std >= 0 in handle_itrm_stdin() and unhandle_itrm_stdin(). May be a bad fix, please test and review. [Added a NEWS entry. --KON]
This commit is contained in:
parent
dc747a6ec3
commit
ffb5edd047
1
NEWS
1
NEWS
@ -28,6 +28,7 @@ To be released as 0.11.4.
|
|||||||
hostname
|
hostname
|
||||||
* bug 712: GnuTLS works on https://www-s.uiuc.edu/[]
|
* bug 712: GnuTLS works on https://www-s.uiuc.edu/[]
|
||||||
* fix active and passive FTP over IPv6
|
* fix active and passive FTP over IPv6
|
||||||
|
* bug 938: elinks -remote no longer needs a controlling tty
|
||||||
* bug 978: Python's webbrowser.open_new_tab(URL) works since now
|
* bug 978: Python's webbrowser.open_new_tab(URL) works since now
|
||||||
* minor bug 54, Debian bug 338402: don't force the terminal to 8 bits
|
* minor bug 54, Debian bug 338402: don't force the terminal to 8 bits
|
||||||
with no parity, and don't disable XON/OFF flow control either
|
with no parity, and don't disable XON/OFF flow control either
|
||||||
|
@ -284,10 +284,12 @@ handle_trm(int std_in, int std_out, int sock_in, int sock_out, int ctl_in,
|
|||||||
#ifdef CONFIG_MOUSE
|
#ifdef CONFIG_MOUSE
|
||||||
enable_mouse();
|
enable_mouse();
|
||||||
#endif
|
#endif
|
||||||
|
handle_itrm_stdin(itrm);
|
||||||
|
} else {
|
||||||
|
/* elinks -remote may not have a valid stdin if not run from a tty (bug 938) */
|
||||||
|
if (std_in >= 0) handle_itrm_stdin(itrm);
|
||||||
}
|
}
|
||||||
|
|
||||||
handle_itrm_stdin(itrm);
|
|
||||||
|
|
||||||
if (sock_in != std_out)
|
if (sock_in != std_out)
|
||||||
set_handlers(sock_in, (select_handler_T) in_sock,
|
set_handlers(sock_in, (select_handler_T) in_sock,
|
||||||
NULL, (select_handler_T) free_itrm, itrm);
|
NULL, (select_handler_T) free_itrm, itrm);
|
||||||
@ -380,7 +382,8 @@ free_itrm(struct itrm *itrm)
|
|||||||
|
|
||||||
mem_free_set(&itrm->orig_title, NULL);
|
mem_free_set(&itrm->orig_title, NULL);
|
||||||
|
|
||||||
clear_handlers(itrm->in.std);
|
/* elinks -remote may not have a valid stdin if not run from a tty (bug 938) */
|
||||||
|
if (!itrm->remote || itrm->in.std >= 0) clear_handlers(itrm->in.std);
|
||||||
clear_handlers(itrm->in.sock);
|
clear_handlers(itrm->in.sock);
|
||||||
clear_handlers(itrm->out.std);
|
clear_handlers(itrm->out.std);
|
||||||
clear_handlers(itrm->out.sock);
|
clear_handlers(itrm->out.sock);
|
||||||
@ -929,6 +932,9 @@ in_kbd(struct itrm *itrm)
|
|||||||
static void
|
static void
|
||||||
handle_itrm_stdin(struct itrm *itrm)
|
handle_itrm_stdin(struct itrm *itrm)
|
||||||
{
|
{
|
||||||
|
assert(itrm->in.std >= 0);
|
||||||
|
if_assert_failed return;
|
||||||
|
|
||||||
set_handlers(itrm->in.std, (select_handler_T) in_kbd, NULL,
|
set_handlers(itrm->in.std, (select_handler_T) in_kbd, NULL,
|
||||||
(select_handler_T) free_itrm, itrm);
|
(select_handler_T) free_itrm, itrm);
|
||||||
}
|
}
|
||||||
@ -936,6 +942,9 @@ handle_itrm_stdin(struct itrm *itrm)
|
|||||||
static void
|
static void
|
||||||
unhandle_itrm_stdin(struct itrm *itrm)
|
unhandle_itrm_stdin(struct itrm *itrm)
|
||||||
{
|
{
|
||||||
|
assert(itrm->in.std >= 0);
|
||||||
|
if_assert_failed return;
|
||||||
|
|
||||||
set_handlers(itrm->in.std, (select_handler_T) NULL, NULL,
|
set_handlers(itrm->in.std, (select_handler_T) NULL, NULL,
|
||||||
(select_handler_T) free_itrm, itrm);
|
(select_handler_T) free_itrm, itrm);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user