mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Tue Apr 13 07:07:36 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
* slang/slutty.c (SLsys_getkey): handle EOF on stdin (return SLANG_GETKEY_ERROR on EOF instead of returning garbage) * slang/Makefile.in (clean): remove the symbolic link slang.h on the distclean target and not on the clean target. Tue Apr 13 07:14:10 1999 Norbert Warmuth <nwarmuth@privat.circular.de> * src/slint.c (getch): Quit MC when SLang_getkey returns an error. Looking at the code that's only the case when we read EOF from stdin. This fixes the problem where MC consumes a lot of cpu time while reading EOF from stdin in a tight loop. This situation arises when the terminal line/connection drops without MC being sent SIGHUP. Tue Apr 13 06:07:05 1999 Norbert Warmuth <nwarmuth@privat.circular.de> * configure.in: Some AC_ARG_WITH macros haven't checked $withval, i.e. --with-PACKAGE and --without-PACKAGE gave the same results.
This commit is contained in:
parent
a0b4b12797
commit
f807b91600
@ -1,3 +1,8 @@
|
||||
Tue Apr 13 06:07:05 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* configure.in: Some AC_ARG_WITH macros havn't checked $withval, i.e.
|
||||
--with-PACKAGE and --without-PACKAGE gave the same results.
|
||||
|
||||
1999-04-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* configure.in (VERSION): Bumped version number to 4.5.30.
|
||||
|
27
configure.in
27
configure.in
@ -795,25 +795,28 @@ AC_CHECK_LIB(slang,SLang_init_tty,
|
||||
|
||||
AC_ARG_WITH(terminfo,
|
||||
[--with-terminfo SLANG: Force usage of terminfo],[
|
||||
AC_USE_TERMINFO
|
||||
slang_check_lib=false
|
||||
slang_use_system_installed_lib=false
|
||||
]
|
||||
if test x$withval = xyes; then
|
||||
AC_USE_TERMINFO
|
||||
slang_check_lib=false
|
||||
slang_use_system_installed_lib=false
|
||||
fi]
|
||||
)
|
||||
|
||||
AC_ARG_WITH(termcap,
|
||||
[--with-termcap SLANG: Force usage of termcap],[
|
||||
AC_USE_TERMCAP
|
||||
slang_check_lib=false
|
||||
slang_use_system_installed_lib=false
|
||||
]
|
||||
if test x$withval = xyes; then
|
||||
AC_USE_TERMCAP
|
||||
slang_check_lib=false
|
||||
slang_use_system_installed_lib=false
|
||||
fi]
|
||||
)
|
||||
|
||||
AC_ARG_WITH(included-slang,
|
||||
[--with-included-slang SLANG: use the SLang library included here],[
|
||||
if test x$withval = xyes; then
|
||||
slang_use_system_installed_lib=false
|
||||
slang_check_lib=true
|
||||
]
|
||||
fi]
|
||||
)
|
||||
|
||||
AC_DEFUN(AC_WITH_SLANG,
|
||||
@ -917,8 +920,10 @@ AC_SUBST(LEDIT)
|
||||
|
||||
AC_ARG_WITH(netrc,
|
||||
[--with-netrc Compile with ftp .netrc support],[
|
||||
AC_DEFINE(USE_NETRC)
|
||||
AC_MSG_RESULT(ftpfs will have .netrc parsing code)
|
||||
if test x$withval = xyes; then
|
||||
AC_DEFINE(USE_NETRC)
|
||||
AC_MSG_RESULT(ftpfs will have .netrc parsing code)
|
||||
fi
|
||||
])
|
||||
|
||||
undelfs_o=""
|
||||
|
@ -1,3 +1,11 @@
|
||||
Tue Apr 13 07:07:36 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* slutty.c (SLsys_getkey): handle EOF on stdin (return
|
||||
SLANG_GETKEY_ERROR on EOF instead of returning garbage)
|
||||
|
||||
* Makefile.in (clean): remove the symbolic link slang.h on the
|
||||
distclean target and not on the clean target.
|
||||
|
||||
Sun Feb 14 01:05:42 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* sldisply.c (SLtt_get_terminfo): use g_snprintf instead of
|
||||
|
@ -51,10 +51,10 @@ TAGS: $(SLANGSRCS)
|
||||
etags $(SLANGSRCS)
|
||||
|
||||
clean:
|
||||
$(RMF) *.o core a.out libmcslang.a slang.h
|
||||
$(RMF) *.o core a.out libmcslang.a
|
||||
|
||||
realclean: clean
|
||||
$(RMF) .depend
|
||||
$(RMF) .depend slang.h
|
||||
$(RMF) TAGS
|
||||
$(RMF) *~
|
||||
|
||||
|
@ -462,6 +462,7 @@ static int handle_interrupt (void)
|
||||
unsigned int SLsys_getkey (void)
|
||||
{
|
||||
unsigned char c;
|
||||
unsigned int i;
|
||||
|
||||
if (TTY_Inited == 0)
|
||||
{
|
||||
@ -497,7 +498,7 @@ unsigned int SLsys_getkey (void)
|
||||
break; /* let read handle it */
|
||||
}
|
||||
|
||||
while (-1 == read(SLang_TT_Read_FD, (char *) &c, 1))
|
||||
while (-1 == (i = read(SLang_TT_Read_FD, (char *) &c, 1)))
|
||||
{
|
||||
if (errno == EINTR)
|
||||
{
|
||||
@ -532,6 +533,9 @@ unsigned int SLsys_getkey (void)
|
||||
return SLANG_GETKEY_ERROR;
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
return SLANG_GETKEY_ERROR;
|
||||
|
||||
return((unsigned int) c);
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,17 @@
|
||||
Tue Apr 13 07:14:10 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* slint.c (getch): Quit MC when SLang_getkey returns an error. Looking
|
||||
at the code that's only the case when we read EOF from stdin.
|
||||
|
||||
This fixes the problem where MC consumes a lot of cpu time while
|
||||
reading EOF from stdin in a tight loop. This situation arises when the
|
||||
terminal line/connection drops without MC being sent SIGHUP.
|
||||
|
||||
Tue Apr 13 07:13:10 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* slint.c (SLang_input_pending2): don't store SLANG_GETKEY_ERROR (int)
|
||||
in the input buffer (char).
|
||||
|
||||
1999-04-12 Andrew T. Veliath <andrewtv@usa.net>
|
||||
|
||||
* main.c (_do_panel_cd): If we are using GNOME, and the panel is a
|
||||
|
17
src/slint.c
17
src/slint.c
@ -105,8 +105,9 @@ static unsigned int SLang_getkey2 (void)
|
||||
|
||||
static int SLang_input_pending2 (int tsecs)
|
||||
{
|
||||
int n;
|
||||
int n, i;
|
||||
unsigned char c;
|
||||
|
||||
if (SLang_Input_Buffer_Len) return (int) SLang_Input_Buffer_Len;
|
||||
#if SLANG_VERSION >= 10000
|
||||
n = _SLsys_input_pending (tsecs);
|
||||
@ -115,7 +116,10 @@ static int SLang_input_pending2 (int tsecs)
|
||||
#endif
|
||||
if (n <= 0) return 0;
|
||||
|
||||
c = (unsigned char) SLang_getkey2 ();
|
||||
i = SLang_getkey2 ();
|
||||
if (i == SLANG_GETKEY_ERROR)
|
||||
return 0; /* don't put crippled error codes into the input buffer */
|
||||
c = (unsigned char)i;
|
||||
SLang_ungetkey_string (&c, 1);
|
||||
|
||||
return n;
|
||||
@ -571,11 +575,18 @@ load_terminfo_keys ()
|
||||
|
||||
int getch ()
|
||||
{
|
||||
int c;
|
||||
if (no_slang_delay)
|
||||
if (SLang_input_pending2 (0) == 0)
|
||||
return -1;
|
||||
|
||||
return (SLang_getkey2 ());
|
||||
c = SLang_getkey2 ();
|
||||
if (c == SLANG_GETKEY_ERROR) {
|
||||
fprintf (stderr, "SLang_getkey returned SLANG_GETKEY_ERROR\n"
|
||||
"Assuming EOF on stdin and exiting\n");
|
||||
quiet_quit_cmd ();
|
||||
}
|
||||
return (c);
|
||||
}
|
||||
|
||||
extern int slow_terminal;
|
||||
|
Loading…
Reference in New Issue
Block a user