summaryrefslogtreecommitdiff
path: root/cmd-line-utils
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
parent0accbd0364e0333e0b119aa9ce93e34ded9df6cb (diff)
parent5a0e7394a5ae0c7b6a1ea35b7ea3a8985325987a (diff)
downloadmariadb-git-9809f05199aeb0b67991fac41bd86f38730768dc.tar.gz
5.5-merge
Diffstat (limited to 'cmd-line-utils')
-rw-r--r--cmd-line-utils/Makefile.am21
-rw-r--r--cmd-line-utils/libedit/CMakeLists.txt15
-rw-r--r--cmd-line-utils/libedit/Makefile.am92
-rw-r--r--cmd-line-utils/libedit/common.c5
-rw-r--r--cmd-line-utils/libedit/el.c21
-rw-r--r--cmd-line-utils/libedit/readline.c23
-rw-r--r--cmd-line-utils/libedit/vi.c41
-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
17 files changed, 95 insertions, 195 deletions
diff --git a/cmd-line-utils/Makefile.am b/cmd-line-utils/Makefile.am
deleted file mode 100644
index 622aa72fd43..00000000000
--- a/cmd-line-utils/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (C) 2004 MySQL AB
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-## Process this file with automake to create Makefile.in
-
-SUBDIRS= @readline_basedir@
-DIST_SUBDIRS= libedit readline
diff --git a/cmd-line-utils/libedit/CMakeLists.txt b/cmd-line-utils/libedit/CMakeLists.txt
index b0e375dfcbd..76fcfc3204e 100644
--- a/cmd-line-utils/libedit/CMakeLists.txt
+++ b/cmd-line-utils/libedit/CMakeLists.txt
@@ -26,6 +26,21 @@ int main()
tgoto(0,0,0);
return 0;
}" HAVE_DECL_TGOTO)
+IF(NOT HAVE_DECL_TGOTO)
+ # On Solaris 11, term.h is broken, curses.h is also required.
+ CHECK_CXX_SOURCE_COMPILES("
+ #include <curses.h>
+ #include <term.h>
+ int main()
+ {
+ tgoto(0,0,0);
+ return 0;
+ }" HAVE_DECL_TGOTO2)
+ IF(HAVE_DECL_TGOTO2)
+ SET(HAVE_DECL_TGOTO 1 CACHE INTERNAL "" FORCE)
+ ENDIF()
+ENDIF()
+
SET(CMAKE_REQUIRED_LIBRARIES)
diff --git a/cmd-line-utils/libedit/Makefile.am b/cmd-line-utils/libedit/Makefile.am
deleted file mode 100644
index 88ea97afffd..00000000000
--- a/cmd-line-utils/libedit/Makefile.am
+++ /dev/null
@@ -1,92 +0,0 @@
-## Process this file with automake to create Makefile.in
-
-ASRC = $(srcdir)/vi.c $(srcdir)/emacs.c $(srcdir)/common.c
-AHDR = vi.h emacs.h common.h
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
-
-noinst_LIBRARIES = libedit.a
-
-libedit_a_SOURCES = chared.c el.c history.c map.c prompt.c readline.c \
- search.c tokenizer.c vi.c common.c emacs.c \
- hist.c key.c parse.c read.c refresh.c sig.c term.c \
- tty.c help.c fcns.c filecomplete.c \
- np/unvis.c np/strlcpy.c np/vis.c np/strlcat.c \
- np/fgetln.c
-
-libedit_a_LIBADD = @LIBEDIT_LOBJECTS@
-libedit_a_DEPENDENCIES = @LIBEDIT_LOBJECTS@
-
-pkginclude_HEADERS = readline/readline.h
-
-noinst_HEADERS = chared.h el.h el_term.h histedit.h key.h parse.h refresh.h sig.h \
- sys.h config.h hist.h map.h prompt.h read.h \
- search.h tty.h filecomplete.h np/vis.h
-
-EXTRA_DIST = makelist.sh CMakeLists.txt
-
-CLEANFILES = makelist common.h emacs.h vi.h fcns.h help.h fcns.c help.c
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''AWK''@!@AWK@!' \
- $< > $@-t
- @MV@ $@-t $@
-
-vi.h: $(srcdir)/vi.c makelist
- sh ./makelist -h $(srcdir)/vi.c > $@.tmp && \
- mv $@.tmp $@
-
-emacs.h: $(srcdir)/emacs.c makelist
- sh ./makelist -h $(srcdir)/emacs.c > $@.tmp && \
- mv $@.tmp $@
-
-common.h: $(srcdir)/common.c makelist
- sh ./makelist -h $(srcdir)/common.c > $@.tmp && \
- mv $@.tmp $@
-
-help.c: ${ASRC} makelist
- sh ./makelist -bc ${ASRC} > $@.tmp && \
- mv $@.tmp $@
-
-help.h: ${ASRC} makelist
- sh ./makelist -bh ${ASRC} > $@.tmp && \
- mv $@.tmp $@
-
-fcns.h: ${AHDR} makelist
- sh ./makelist -fh ${AHDR} > $@.tmp && \
- mv $@.tmp $@
-
-fcns.c: ${AHDR} fcns.h makelist
- sh ./makelist -fc ${AHDR} > $@.tmp && \
- mv $@.tmp $@
-
-#%.o: vi.h emacs.h common.h help.h fcns.h
-#objects := $(patsubst %.c,%.o,$(wildcard *.c))
-#$(objects): vi.h emacs.h
-
-chared.o: vi.h emacs.h common.h help.h fcns.h
-el.o: vi.h emacs.h common.h help.h fcns.h
-history.o: vi.h emacs.h common.h help.h fcns.h
-map.o: vi.h emacs.h common.h help.h fcns.h
-prompt.o: vi.h emacs.h common.h help.h fcns.h
-readline.o: vi.h emacs.h common.h help.h fcns.h
-search.o: vi.h emacs.h common.h help.h fcns.h
-tokenizer.o: vi.h emacs.h common.h help.h fcns.h
-vi.o: vi.h emacs.h common.h help.h fcns.h
-common.o: vi.h emacs.h common.h help.h fcns.h
-emacs.o: vi.h emacs.h common.h help.h fcns.h
-hist.o: vi.h emacs.h common.h help.h fcns.h
-key.o: vi.h emacs.h common.h help.h fcns.h
-parse.o: vi.h emacs.h common.h help.h fcns.h
-read.o: vi.h emacs.h common.h help.h fcns.h
-refresh.o: vi.h emacs.h common.h help.h fcns.h
-sig.o: vi.h emacs.h common.h help.h fcns.h
-term.o: vi.h emacs.h common.h help.h fcns.h
-tty.o: vi.h emacs.h common.h help.h fcns.h
-help.o: vi.h emacs.h common.h help.h fcns.h
-fcns.o: vi.h emacs.h common.h help.h fcns.h
-filecomplete.o: vi.h emacs.h common.h help.h fcns.h
diff --git a/cmd-line-utils/libedit/common.c b/cmd-line-utils/libedit/common.c
index d4d024eae10..ba5890fa606 100644
--- a/cmd-line-utils/libedit/common.c
+++ b/cmd-line-utils/libedit/common.c
@@ -136,7 +136,7 @@ ed_delete_prev_word(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_next_char(EditLine *el, int c)
+ed_delete_next_char(EditLine *el, int c __attribute__((__unused__)))
{
#ifdef notdef /* XXX */
#define EL el->el_line
@@ -431,7 +431,8 @@ ed_argument_digit(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-ed_unassigned(EditLine *el, int c __attribute__((__unused__)))
+ed_unassigned(EditLine *el __attribute__((__unused__)),
+ int c __attribute__((__unused__)))
{
return (CC_ERROR);
diff --git a/cmd-line-utils/libedit/el.c b/cmd-line-utils/libedit/el.c
index d99946eb68f..c7f8386773d 100644
--- a/cmd-line-utils/libedit/el.c
+++ b/cmd-line-utils/libedit/el.c
@@ -478,7 +478,13 @@ el_source(EditLine *el, const char *fname)
fp = NULL;
if (fname == NULL) {
-#ifdef HAVE_ISSETUGID
+/* XXXMYSQL: Bug#49967 */
+#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) && \
+ defined(HAVE_GETGID) && defined(HAVE_GETEGID)
+#define HAVE_IDENTITY_FUNCS 1
+#endif
+
+#if (defined(HAVE_ISSETUGID) || defined(HAVE_IDENTITY_FUNCS))
static const char elpath[] = "/.editrc";
/* XXXMYSQL: Portability fix (for which platforms?) */
#ifdef MAXPATHLEN
@@ -486,9 +492,13 @@ el_source(EditLine *el, const char *fname)
#else
char path[4096];
#endif
-
+#ifdef HAVE_ISSETUGID
if (issetugid())
return (-1);
+#elif defined(HAVE_IDENTITY_FUNCS)
+ if (getuid() != geteuid() || getgid() != getegid())
+ return (-1);
+#endif
if ((ptr = getenv("HOME")) == NULL)
return (-1);
if (strlcpy(path, ptr, sizeof(path)) >= sizeof(path))
@@ -498,9 +508,10 @@ el_source(EditLine *el, const char *fname)
fname = path;
#else
/*
- * If issetugid() is missing, always return an error, in order
- * to keep from inadvertently opening up the user to a security
- * hole.
+ * If issetugid() or the above mentioned get[e][u|g]id()
+ * functions are missing, always return an error, in order
+ * to keep from inadvertently opening up the user to a
+ * security hole.
*/
return (-1);
#endif
diff --git a/cmd-line-utils/libedit/readline.c b/cmd-line-utils/libedit/readline.c
index 1f1b18c97d8..0318ab409b3 100644
--- a/cmd-line-utils/libedit/readline.c
+++ b/cmd-line-utils/libedit/readline.c
@@ -202,7 +202,7 @@ _move_history(int op)
*/
static int
/*ARGSUSED*/
-_getc_function(EditLine *el, char *c)
+_getc_function(EditLine *el __attribute__((__unused__)), char *c)
{
int i;
@@ -1613,7 +1613,8 @@ rl_insert(int count, int c)
/*ARGSUSED*/
int
-rl_newline(int count, int c)
+rl_newline(int count __attribute__((__unused__)),
+ int c __attribute__((__unused__)))
{
/*
* Readline-4.0 appears to ignore the args.
@@ -1623,7 +1624,7 @@ rl_newline(int count, int c)
/*ARGSUSED*/
static unsigned char
-rl_bind_wrapper(EditLine *el, unsigned char c)
+rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c)
{
if (map[c] == NULL)
return CC_ERROR;
@@ -1718,7 +1719,7 @@ rl_get_previous_history(int count, int key)
void
/*ARGSUSED*/
-rl_prep_terminal(int meta_flag)
+rl_prep_terminal(int meta_flag __attribute__((__unused__)))
{
el_set(e, EL_PREP_TERM, 1);
}
@@ -1922,7 +1923,8 @@ _rl_qsort_string_compare(char **s1, char **s2)
int
/*ARGSUSED*/
-rl_kill_text(int from, int to)
+rl_kill_text(int from __attribute__((__unused__)),
+ int to __attribute__((__unused__)))
{
return 0;
}
@@ -1941,20 +1943,25 @@ rl_get_keymap(void)
void
/*ARGSUSED*/
-rl_set_keymap(Keymap k)
+rl_set_keymap(Keymap k __attribute__((__unused__)))
{
}
int
/*ARGSUSED*/
-rl_generic_bind(int type, const char * keyseq, const char * data, Keymap k)
+rl_generic_bind(int type __attribute__((__unused__)),
+ const char * keyseq __attribute__((__unused__)),
+ const char * data __attribute__((__unused__)),
+ Keymap k __attribute__((__unused__)))
{
return 0;
}
int
/*ARGSUSED*/
-rl_bind_key_in_map(int key, Function *fun, Keymap k)
+rl_bind_key_in_map(int key __attribute__((__unused__)),
+ Function *fun __attribute__((__unused__)),
+ Keymap k __attribute__((__unused__)))
{
return 0;
}
diff --git a/cmd-line-utils/libedit/vi.c b/cmd-line-utils/libedit/vi.c
index 00a9f493a9b..beffc7b40b5 100644
--- a/cmd-line-utils/libedit/vi.c
+++ b/cmd-line-utils/libedit/vi.c
@@ -145,7 +145,7 @@ vi_paste_prev(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_prev_big_word(EditLine *el, int c)
+vi_prev_big_word(EditLine *el, int c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.buffer)
@@ -195,7 +195,7 @@ vi_prev_word(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_next_big_word(EditLine *el, int c)
+vi_next_big_word(EditLine *el, int c __attribute__((__unused__)))
{
if (el->el_line.cursor >= el->el_line.lastchar - 1)
@@ -462,7 +462,7 @@ vi_delete_meta(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_end_big_word(EditLine *el, int c)
+vi_end_big_word(EditLine *el, int c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.lastchar)
@@ -797,7 +797,7 @@ vi_repeat_prev_char(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_match(EditLine *el, int c)
+vi_match(EditLine *el, int c __attribute__((__unused__)))
{
const char match_chars[] = "()[]{}";
char *cp;
@@ -844,7 +844,7 @@ vi_match(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_undo_line(EditLine *el, int c)
+vi_undo_line(EditLine *el, int c __attribute__((__unused__)))
{
cv_undo(el);
@@ -858,7 +858,7 @@ vi_undo_line(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_column(EditLine *el, int c)
+vi_to_column(EditLine *el, int c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.buffer;
@@ -872,7 +872,7 @@ vi_to_column(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_yank_end(EditLine *el, int c)
+vi_yank_end(EditLine *el, int c __attribute__((__unused__)))
{
cv_yank(el, el->el_line.cursor,
@@ -886,7 +886,7 @@ vi_yank_end(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_yank(EditLine *el, int c)
+vi_yank(EditLine *el, int c __attribute__((__unused__)))
{
return cv_action(el, YANK);
@@ -898,7 +898,7 @@ vi_yank(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_comment_out(EditLine *el, int c)
+vi_comment_out(EditLine *el, int c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.buffer;
@@ -919,7 +919,8 @@ extern char *get_alias_text(const char *) __weak_reference(get_alias_text);
#endif
protected el_action_t
/*ARGSUSED*/
-vi_alias(EditLine *el, int c)
+vi_alias(EditLine *el __attribute__((__unused__)),
+ int c __attribute__((__unused__)))
{
#if defined(__weak_reference) && !defined(__FreeBSD__)
char alias_name[3];
@@ -949,7 +950,7 @@ vi_alias(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_history_line(EditLine *el, int c)
+vi_to_history_line(EditLine *el, int c __attribute__((__unused__)))
{
int sv_event_no = el->el_history.eventno;
el_action_t rval;
@@ -994,7 +995,7 @@ vi_to_history_line(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_histedit(EditLine *el, int c)
+vi_histedit(EditLine *el, int c __attribute__((__unused__)))
{
int fd;
pid_t pid;
@@ -1011,8 +1012,10 @@ vi_histedit(EditLine *el, int c)
if (fd < 0)
return CC_ERROR;
cp = el->el_line.buffer;
- write(fd, cp, el->el_line.lastchar - cp +0u);
- write(fd, "\n", 1);
+ if (write(fd, cp, el->el_line.lastchar - cp +0u) == -1)
+ goto error;
+ if (write(fd, "\n", 1) == -1)
+ goto error;
pid = fork();
switch (pid) {
case -1:
@@ -1040,6 +1043,12 @@ vi_histedit(EditLine *el, int c)
unlink(tempfile);
/* return CC_REFRESH; */
return ed_newline(el, 0);
+
+/* XXXMYSQL: Avoid compiler warnings. */
+error:
+ close(fd);
+ unlink(tempfile);
+ return CC_ERROR;
}
/* vi_history_word():
@@ -1050,7 +1059,7 @@ vi_histedit(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_history_word(EditLine *el, int c)
+vi_history_word(EditLine *el, int c __attribute__((__unused__)))
{
const char *wp = HIST_FIRST(el);
const char *wep, *wsp;
@@ -1099,7 +1108,7 @@ vi_history_word(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_redo(EditLine *el, int c)
+vi_redo(EditLine *el, int c __attribute__((__unused__)))
{
c_redo_t *r = &el->el_chared.c_redo;
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 ();