summaryrefslogtreecommitdiff
path: root/readline
diff options
context:
space:
mode:
Diffstat (limited to 'readline')
-rw-r--r--readline/ChangeLog.gdb29
-rw-r--r--readline/display.c6
-rw-r--r--readline/readline.c4
-rw-r--r--readline/rlmbutil.h26
-rw-r--r--readline/terminal.c31
5 files changed, 71 insertions, 25 deletions
diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb
index affba35f7c1..830822aeeee 100644
--- a/readline/ChangeLog.gdb
+++ b/readline/ChangeLog.gdb
@@ -1,3 +1,29 @@
+2003-12-28 Eli Zaretskii <eliz@elta.co.il>
+
+ * readline.c (rl_save_state, rl_restore_state): Support systems
+ that don't define SIGWINCH.
+
+2003-12-25 Eli Zaretskii <eliz@elta.co.il>
+
+ * terminal.c (_rl_get_screen_size) [__DJGPP__]: Compute the
+ screen width and height using console I/O.
+ (_rl_init_terminal_io) [__MSDOS__]: Zero out all the _rl_term_*
+ variables. Convert to _rl_* naming scheme.
+ (_rl_set_cursor) [__MSDOS__]: Ifdef away this function.
+
+2003-12-23 Eli Zaretskii <eliz@elta.co.il>
+
+ * display.c (_rl_move_vert) [__MSDOS__]: Don't use undeclared
+ variable `l'. Use `delta' instead recomputing its value anew.
+ Assign -delta to i instead of the other way around.
+
+2003-12-11 Michael Chastain <mec.gnu@mindspring.com>
+
+ * rlmbutil.h: Require HAVE_MBSTATE_T for HANDLE_MULTIBYTE.
+ Revert requirement of HAVE_MBRTOWC. Delete macro definitions
+ that attempted to fake mbstate_t if HAVE_MBSRTOCWS is defined
+ and HAVE_MBSTATE_T is not defined.
+
2003-06-14 H.J. Lu <hongjiu.lu@intel.com>
* support/config.guess: Update to 2003-06-12 version.
@@ -50,7 +76,8 @@
2002-12-06 Elena Zannoni <ezannoni@redhat.com>
- Import of readline 4.3:
+ Import of readline 4.3. NB: This import includes those gdb
+ local changes that aren't in the official readline sources.
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
diff --git a/readline/display.c b/readline/display.c
index e151cf2862b..e7b75912c9e 100644
--- a/readline/display.c
+++ b/readline/display.c
@@ -1642,10 +1642,10 @@ _rl_move_vert (to)
#ifdef __MSDOS__
int row, col;
- l = fflush (rl_outstream); /* make sure the cursor pos is current! */
+ fflush (rl_outstream); /* make sure the cursor pos is current! */
ScreenGetCursor (&row, &col);
- ScreenSetCursor ((row + to - _rl_last_v_pos), col);
- delta = i;
+ ScreenSetCursor (row + delta, col);
+ i = -delta; /* in case someone wants to use it after the loop */
#else /* !__MSDOS__ */
if (_rl_term_up && *_rl_term_up)
for (i = 0; i < -delta; i++)
diff --git a/readline/readline.c b/readline/readline.c
index 28801f19dfc..efa0bf84c27 100644
--- a/readline/readline.c
+++ b/readline/readline.c
@@ -933,7 +933,9 @@ rl_save_state (sp)
sp->macro = rl_executing_macro;
sp->catchsigs = rl_catch_signals;
+#if defined (SIGWINCH)
sp->catchsigwinch = rl_catch_sigwinch;
+#endif
return (0);
}
@@ -967,7 +969,9 @@ rl_restore_state (sp)
rl_executing_macro = sp->macro;
rl_catch_signals = sp->catchsigs;
+#if defined (SIGWINCH)
rl_catch_sigwinch = sp->catchsigwinch;
+#endif
return (0);
}
diff --git a/readline/rlmbutil.h b/readline/rlmbutil.h
index 9b8464a07f5..dab954fad90 100644
--- a/readline/rlmbutil.h
+++ b/readline/rlmbutil.h
@@ -1,6 +1,6 @@
/* rlmbutil.h -- utility functions for multibyte characters. */
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -30,27 +30,27 @@
/************************************************/
/* For platforms which support the ISO C amendement 1 functionality we
- support user defined character classes. */
+ support user defined character classes.
+
+ Some platforms have the multibyte functions such as mbsrtowcs but
+ are lacking the multitype type mbstate_t. BeOS (unknown version)
+ and HP/UX 11.23 without _XOPEN_SOURCE=500 are like this.
+
+ We really need mbstate_t type to operate properly. For example, see
+ compute_lcd_of_matches, where two mbstate_t's are active at the same
+ time. So we require both the functions and the mbstate_t type in
+ order to enable multibyte support. */
+
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
#if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H)
# include <wchar.h>
# include <wctype.h>
-# if defined (HAVE_MBRTOWC) && defined (HAVE_MBSRTOWCS)
+# if defined (HAVE_MBSTATE_T) && defined (HAVE_MBSRTOWCS)
/* system is supposed to support XPG5 */
# define HANDLE_MULTIBYTE 1
# endif
#endif
-/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
-#if HANDLE_MULTIBYTE && !defined (HAVE_MBSTATE_T)
-# define wcsrtombs(dest, src, len, ps) (wcsrtombs) (dest, src, len, 0)
-# define mbsrtowcs(dest, src, len, ps) (mbsrtowcs) (dest, src, len, 0)
-# define wcrtomb(s, wc, ps) (wcrtomb) (s, wc, 0)
-# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
-# define mbrlen(s, n, ps) (mbrlen) (s, n, 0)
-# define mbstate_t int
-#endif
-
/* Make sure MB_LEN_MAX is at least 16 on systems that claim to be able to
handle multibyte chars (some systems define MB_LEN_MAX as 1) */
#ifdef HANDLE_MULTIBYTE
diff --git a/readline/terminal.c b/readline/terminal.c
index ea3270e9683..06bc8e94d6b 100644
--- a/readline/terminal.c
+++ b/readline/terminal.c
@@ -220,7 +220,10 @@ _rl_get_screen_size (tty, ignore_env)
if (ignore_env == 0 && (ss = sh_get_env_value ("COLUMNS")))
_rl_screenwidth = atoi (ss);
-#if !defined (__DJGPP__)
+#if defined (__DJGPP__)
+ if (_rl_screenwidth <= 0)
+ _rl_screenwidth = ScreenCols ();
+#else
if (_rl_screenwidth <= 0 && term_string_buffer)
_rl_screenwidth = tgetnum ("co");
#endif
@@ -233,7 +236,10 @@ _rl_get_screen_size (tty, ignore_env)
if (ignore_env == 0 && (ss = sh_get_env_value ("LINES")))
_rl_screenheight = atoi (ss);
-#if !defined (__DJGPP__)
+#if defined (__DJGPP__)
+ if (_rl_screenheight <= 0)
+ _rl_screenheight = ScreenRows ();
+#else
if (_rl_screenheight <= 0 && term_string_buffer)
_rl_screenheight = tgetnum ("li");
#endif
@@ -382,12 +388,19 @@ _rl_init_terminal_io (terminal_name)
term = "dumb";
#ifdef __MSDOS__
- term_im = term_ei = term_ic = term_IC = (char *)NULL;
- term_up = term_dc = term_DC = visible_bell = (char *)NULL;
- term_ku = term_kd = term_kl = term_kr = (char *)NULL;
- term_mm = term_mo = (char *)NULL;
- terminal_can_insert = term_has_meta = _rl_term_autowrap = 0;
- term_cr = "\r";
+ _rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL;
+ _rl_term_up = _rl_term_dc = _rl_term_DC = _rl_visible_bell = (char *)NULL;
+ _rl_term_ku = _rl_term_kd = _rl_term_kl = _rl_term_kr = (char *)NULL;
+ _rl_term_mm = _rl_term_mo = (char *)NULL;
+ _rl_terminal_can_insert = term_has_meta = _rl_term_autowrap = 0;
+ _rl_term_cr = "\r";
+ _rl_term_clreol = _rl_term_clrpag = _rl_term_backspace = (char *)NULL;
+ _rl_term_goto = _rl_term_pc = _rl_term_ip = (char *)NULL;
+ _rl_term_ks = _rl_term_ke =_rl_term_vs = _rl_term_ve = (char *)NULL;
+ _rl_term_kh = _rl_term_kH = _rl_term_at7 = _rl_term_kI = (char *)NULL;
+#if defined(HACK_TERMCAP_MOTION)
+ _rl_term_forward_char = (char *)NULL;
+#endif
_rl_get_screen_size (tty, 0);
#else /* !__MSDOS__ */
@@ -677,6 +690,7 @@ void
_rl_set_cursor (im, force)
int im, force;
{
+#ifndef __MSDOS__
if (_rl_term_ve && _rl_term_vs)
{
if (force || im != rl_insert_mode)
@@ -687,4 +701,5 @@ _rl_set_cursor (im, force)
tputs (_rl_term_ve, 1, _rl_output_character_function);
}
}
+#endif
}