summaryrefslogtreecommitdiff
path: root/cmd-line-utils/readline
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-07-02 22:08:51 +0200
committerSergei Golubchik <sergii@pisem.net>2011-07-02 22:08:51 +0200
commit9809f05199aeb0b67991fac41bd86f38730768dc (patch)
treefa2792ff86d0da014b535d743759810612338042 /cmd-line-utils/readline
parent0accbd0364e0333e0b119aa9ce93e34ded9df6cb (diff)
parent5a0e7394a5ae0c7b6a1ea35b7ea3a8985325987a (diff)
downloadmariadb-git-9809f05199aeb0b67991fac41bd86f38730768dc.tar.gz
5.5-merge
Diffstat (limited to 'cmd-line-utils/readline')
-rw-r--r--cmd-line-utils/readline/CMakeLists.txt2
-rw-r--r--cmd-line-utils/readline/Makefile.am34
-rw-r--r--cmd-line-utils/readline/bind.c2
-rw-r--r--cmd-line-utils/readline/complete.c7
-rw-r--r--cmd-line-utils/readline/histfile.c1
-rw-r--r--cmd-line-utils/readline/isearch.c8
-rw-r--r--cmd-line-utils/readline/parens.c4
-rw-r--r--cmd-line-utils/readline/readline.c3
-rw-r--r--cmd-line-utils/readline/terminal.c8
-rw-r--r--cmd-line-utils/readline/text.c3
10 files changed, 21 insertions, 51 deletions
diff --git a/cmd-line-utils/readline/CMakeLists.txt b/cmd-line-utils/readline/CMakeLists.txt
index ed6a6b902ea..be84f22f210 100644
--- a/cmd-line-utils/readline/CMakeLists.txt
+++ b/cmd-line-utils/readline/CMakeLists.txt
@@ -16,7 +16,7 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/cmd-line-utils)
-ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNO_KILL_INTR -DMYSQL_CLIENT_NO_THREADS)
+ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNO_KILL_INTR)
INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH})
diff --git a/cmd-line-utils/readline/Makefile.am b/cmd-line-utils/readline/Makefile.am
deleted file mode 100644
index 48d3af34412..00000000000
--- a/cmd-line-utils/readline/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-## Process this file with automake to create Makefile.in
-# Makefile for the GNU readline library.
-# Copyright (C) 1994,1996,1997 Free Software Foundation, Inc.
-
-# Last -I$(top_srcdir) needed for RedHat!
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
- -I$(top_srcdir)
-
-noinst_LIBRARIES = libreadline.a
-
-libreadline_a_SOURCES = readline.c funmap.c keymaps.c \
- vi_mode.c parens.c rltty.c \
- complete.c bind.c isearch.c \
- display.c signals.c \
- util.c kill.c \
- undo.c macro.c input.c \
- callback.c terminal.c xmalloc.c \
- history.c histsearch.c histexpand.c \
- histfile.c nls.c search.c \
- shell.c tilde.c misc.c text.c mbutil.c \
- compat.c savestring.c
-
-noinst_HEADERS = readline.h chardefs.h keymaps.h \
- history.h tilde.h rlmbutil.h rltypedefs.h rlprivate.h \
- rlshell.h xmalloc.h \
-\
- config_readline.h rldefs.h histlib.h rlwinsize.h \
- posixstat.h posixdir.h posixjmp.h \
- tilde.h rlconf.h rltty.h ansi_stdlib.h \
- tcap.h rlstdc.h
-
-EXTRA_DIST= emacs_keymap.c vi_keymap.c CMakeLists.txt
-
-DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -D_GNU_SOURCE=1
diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c
index cea1d0d81f6..7f733abe80c 100644
--- a/cmd-line-utils/readline/bind.c
+++ b/cmd-line-utils/readline/bind.c
@@ -855,7 +855,7 @@ _rl_read_init_file (filename, include_level)
{
register int i;
char *buffer, *openname, *line, *end;
- size_t file_size;
+ size_t file_size = 0;
current_readline_init_file = filename;
current_readline_init_include_level = include_level;
diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c
index 2745e4e4801..d11ea2493a6 100644
--- a/cmd-line-utils/readline/complete.c
+++ b/cmd-line-utils/readline/complete.c
@@ -1839,8 +1839,11 @@ rl_username_completion_function (text, state)
#else /* !__WIN32__ && !__OPENNT) */
static char *username = (char *)NULL;
static struct passwd *entry;
- static int namelen, first_char, first_char_loc;
+ static int first_char, first_char_loc;
char *value;
+#if defined (HAVE_GETPWENT)
+ static int namelen;
+#endif
if (state == 0)
{
@@ -1850,7 +1853,9 @@ rl_username_completion_function (text, state)
first_char_loc = first_char == '~';
username = savestring (&text[first_char_loc]);
+#if defined (HAVE_GETPWENT)
namelen = strlen (username);
+#endif
setpwent ();
}
diff --git a/cmd-line-utils/readline/histfile.c b/cmd-line-utils/readline/histfile.c
index cbd367542ce..1a6d69b6684 100644
--- a/cmd-line-utils/readline/histfile.c
+++ b/cmd-line-utils/readline/histfile.c
@@ -402,6 +402,7 @@ history_truncate_file (fname, lines)
if (bp > buffer && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1))
{
bytes_written= write (file, bp, chars_read - (bp - buffer));
+ (void) bytes_written;
#if defined (__BEOS__)
/* BeOS ignores O_TRUNC. */
diff --git a/cmd-line-utils/readline/isearch.c b/cmd-line-utils/readline/isearch.c
index 305c847d8da..977e08eb9ba 100644
--- a/cmd-line-utils/readline/isearch.c
+++ b/cmd-line-utils/readline/isearch.c
@@ -617,7 +617,7 @@ rl_search_history (direction, invoking_key)
int direction, invoking_key __attribute__((unused));
{
_rl_search_cxt *cxt; /* local for now, but saved globally */
- int c, r;
+ int r;
RL_SETSTATE(RL_STATE_ISEARCH);
cxt = _rl_isearch_init (direction);
@@ -632,7 +632,7 @@ rl_search_history (direction, invoking_key)
r = -1;
for (;;)
{
- c = _rl_search_getchar (cxt);
+ _rl_search_getchar (cxt);
/* We might want to handle EOF here (c == 0) */
r = _rl_isearch_dispatch (cxt, cxt->lastc);
if (r <= 0)
@@ -655,9 +655,9 @@ int
_rl_isearch_callback (cxt)
_rl_search_cxt *cxt;
{
- int c, r;
+ int r;
- c = _rl_search_getchar (cxt);
+ _rl_search_getchar (cxt);
/* We might want to handle EOF here */
r = _rl_isearch_dispatch (cxt, cxt->lastc);
diff --git a/cmd-line-utils/readline/parens.c b/cmd-line-utils/readline/parens.c
index fe1578ed3e2..58f22291172 100644
--- a/cmd-line-utils/readline/parens.c
+++ b/cmd-line-utils/readline/parens.c
@@ -115,7 +115,7 @@ rl_insert_close (count, invoking_key)
else
{
#if defined (HAVE_SELECT)
- int orig_point, match_point, ready;
+ int orig_point, match_point;
struct timeval timer;
fd_set readfds;
@@ -136,7 +136,7 @@ rl_insert_close (count, invoking_key)
orig_point = rl_point;
rl_point = match_point;
(*rl_redisplay_function) ();
- ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
+ select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
rl_point = orig_point;
#else /* !HAVE_SELECT */
_rl_insert_char (count, invoking_key);
diff --git a/cmd-line-utils/readline/readline.c b/cmd-line-utils/readline/readline.c
index 3a0f533fcd6..d98d7880005 100644
--- a/cmd-line-utils/readline/readline.c
+++ b/cmd-line-utils/readline/readline.c
@@ -446,11 +446,10 @@ readline_internal_char ()
readline_internal_charloop ()
#endif
{
- static int lastc, eof_found;
+ static int lastc;
int c, code, lk;
lastc = -1;
- eof_found = 0;
#if !defined (READLINE_CALLBACKS)
while (rl_done == 0)
diff --git a/cmd-line-utils/readline/terminal.c b/cmd-line-utils/readline/terminal.c
index 3f92821f9dd..e2785908160 100644
--- a/cmd-line-utils/readline/terminal.c
+++ b/cmd-line-utils/readline/terminal.c
@@ -268,7 +268,7 @@ _rl_get_screen_size (tty, ignore_env)
#if !defined (__DJGPP__)
if (_rl_screenwidth <= 0 && term_string_buffer)
- _rl_screenwidth = tgetnum ("co");
+ _rl_screenwidth = tgetnum ((char *)"co");
#endif
}
@@ -284,7 +284,7 @@ _rl_get_screen_size (tty, ignore_env)
#if !defined (__DJGPP__)
if (_rl_screenheight <= 0 && term_string_buffer)
- _rl_screenheight = tgetnum ("li");
+ _rl_screenheight = tgetnum ((char *)"li");
#endif
}
@@ -516,7 +516,7 @@ _rl_init_terminal_io (terminal_name)
if (!_rl_term_cr)
_rl_term_cr = "\r";
- _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn");
+ _rl_term_autowrap = tgetflag ((char *)"am") && tgetflag ((char *)"xn");
/* Allow calling application to set default height and width, using
rl_set_screen_size */
@@ -531,7 +531,7 @@ _rl_init_terminal_io (terminal_name)
/* Check to see if this terminal has a meta key and clear the capability
variables if there is none. */
- term_has_meta = (tgetflag ("km") || tgetflag ("MT"));
+ term_has_meta = (tgetflag ((char *)"km") || tgetflag ((char *)"MT"));
if (!term_has_meta)
_rl_term_mm = _rl_term_mo = (char *)NULL;
diff --git a/cmd-line-utils/readline/text.c b/cmd-line-utils/readline/text.c
index 774ba1eb2c0..75ffd0e482a 100644
--- a/cmd-line-utils/readline/text.c
+++ b/cmd-line-utils/readline/text.c
@@ -811,11 +811,10 @@ _rl_overwrite_char (count, c)
int i;
#if defined (HANDLE_MULTIBYTE)
char mbkey[MB_LEN_MAX];
- int k;
/* Read an entire multibyte character sequence to insert COUNT times. */
if (count > 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- k = _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
+ _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
#endif
rl_begin_undo_group ();