Files
MSYS2-packages/readline/readline-6.3-cygwin.patch
2015-03-03 10:44:13 +03:00

479 lines
16 KiB
Diff

--- a/Makefile.in 2014-01-27 07:52:00.000000000 -0700
+++ b/Makefile.in 2015-01-26 20:51:11.524115600 -0700
@@ -312,7 +312,8 @@ install-dvi:
install-html:
install-pdf:
install-ps:
-check:
+check: force
+ -( cd examples && $(MAKE) $(MFLAGS) check )
installcheck:
dist: force
--- a/bind.c 2013-04-06 15:46:38.000000000 -0600
+++ b/bind.c 2015-01-26 20:51:11.524115600 -0700
@@ -452,7 +452,7 @@ rl_translate_keyseq (seq, array, len)
{
register int i, c, l, temp;
- for (i = l = 0; c = seq[i]; i++)
+ for (i = l = 0; (c = seq[i]); i++)
{
if (c == '\\')
{
@@ -1210,7 +1210,7 @@ _rl_skip_to_delim (string, start, delim)
{
int i, c, passc;
- for (i = start,passc = 0; c = string[i]; i++)
+ for (i = start,passc = 0; (c = string[i]); i++)
{
if (passc)
{
@@ -1297,7 +1297,6 @@ rl_parse_and_bind (string)
if (_rl_stricmp (string, "set") == 0)
{
char *var, *value, *e;
- int s;
var = string + i;
/* Make VAR point to start of variable name. */
@@ -2198,7 +2197,7 @@ rl_function_dumper (print_readably)
fprintf (rl_outstream, "\n");
- for (i = 0; name = names[i]; i++)
+ for (i = 0; (name = names[i]); i++)
{
rl_command_func_t *function;
char **invokers;
--- a/chardefs.h 2011-07-25 19:47:56.000000000 -0600
+++ b/chardefs.h 2015-01-26 20:51:11.524115600 -0700
@@ -71,6 +71,7 @@
#else
# define IN_CTYPE_DOMAIN(c) isascii(c)
#endif
+#define to_uchar(c) ((unsigned char)(c))
#if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) && !defined (__cplusplus)
# define isxdigit(c) (isdigit((c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
@@ -87,13 +88,13 @@
/* Beware: these only work with single-byte ASCII characters. */
-#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
-#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
-#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
-#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
-#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
+#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (to_uchar (c)))
+#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (to_uchar (c)))
+#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (to_uchar (c)))
+#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (to_uchar (c)))
+#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (to_uchar (c)))
+#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (to_uchar (c)))
+#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (to_uchar (c)))
#define _rl_lowercase_p(c) (NON_NEGATIVE(c) && ISLOWER(c))
#define _rl_uppercase_p(c) (NON_NEGATIVE(c) && ISUPPER(c))
--- a/complete.c 2013-10-14 07:27:10.000000000 -0600
+++ b/complete.c 2015-01-26 20:51:11.524115600 -0700
@@ -1082,7 +1082,7 @@ _rl_find_completion_word (fp, dp)
/* We didn't find an unclosed quoted substring upon which to do
completion, so use the word break characters to find the
substring on which to complete. */
- while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))
+ while ((rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)))
{
scan = rl_line_buffer[rl_point];
@@ -2116,7 +2116,7 @@ rl_completion_matches (text, entry_funct
match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
match_list[1] = (char *)NULL;
- while (string = (*entry_function) (text, matches))
+ while ((string = (*entry_function) (text, matches)))
{
if (RL_SIG_RECEIVED ())
{
@@ -2190,7 +2190,7 @@ rl_username_completion_function (text, s
}
#if defined (HAVE_GETPWENT)
- while (entry = getpwent ())
+ while ((entry = getpwent ()))
{
/* Null usernames should result in all users as possible completions. */
if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
@@ -2723,7 +2723,7 @@ rl_menu_complete (count, ignore)
static int full_completion = 0; /* set to 1 if menu completion should reinitialize on next call */
static int orig_start, orig_end;
static char quote_char;
- static int delimiter, cstate;
+ static int delimiter;
/* The first time through, we generate the list of matches and set things
up to insert them. */
--- a/display.c 2015-01-26 20:45:49.834452400 -0700
+++ b/display.c 2015-01-26 20:51:11.524115600 -0700
@@ -66,7 +66,6 @@ extern char *strchr (), *strrchr ();
static void update_line PARAMS((char *, char *, int, int, int, int));
static void space_to_eol PARAMS((int));
static void delete_chars PARAMS((int));
-static void insert_some_chars PARAMS((char *, int, int));
static void open_some_spaces PARAMS((int));
static void cr PARAMS((void));
@@ -1314,7 +1313,7 @@ update_line (old, new, current_line, oma
int current_line, omax, nmax, inv_botlin;
{
register char *ofd, *ols, *oe, *nfd, *nls, *ne;
- int temp, lendiff, wsatend, od, nd, twidth, o_cpos;
+ int temp, lendiff, wsatend, od, nd, o_cpos;
int current_invis_chars;
int col_lendiff, col_temp;
int bytes_to_insert;
@@ -2485,6 +2484,7 @@ _rl_clear_screen ()
#endif /* __DJGPP__ */
}
+#if 0
/* Insert COUNT characters from STRING to the output stream at column COL. */
static void
insert_some_chars (string, count, col)
@@ -2494,6 +2494,7 @@ insert_some_chars (string, count, col)
open_some_spaces (col);
_rl_output_some_chars (string, count);
}
+#endif
/* Insert COL spaces, keeping the cursor at the same position. We follow the
ncurses documentation and use either im/ei with explicit spaces, or IC/ic
--- a/examples/Makefile.in 2013-10-03 10:57:31.000000000 -0600
+++ b/examples/Makefile.in 2015-01-26 20:51:11.524115600 -0700
@@ -54,7 +54,7 @@ CPPFLAGS = @CPPFLAGS@
INCLUDES = -I$(srcdir) -I$(top_srcdir) -I..
CCFLAGS = $(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS)
-LDFLAGS = -g -L.. @LDFLAGS@
+LDFLAGS = -g -L../shlib -L.. @LDFLAGS@
PURIFY = @PURIFY@
@@ -86,7 +86,7 @@ all: $(EXECUTABLES)
everything: all
check: rlversion$(EXEEXT)
- @echo Readline version: `rlversion$(EXEEXT)`
+ @echo Readline version: `PATH=../shlib:$$PATH ./rlversion$(EXEEXT)`
installdirs:
-$(SHELL) $(top_srcdir)/support/mkdirs $(DESTDIR)$(installdir)
--- a/examples/rlversion.c 2009-01-06 10:04:33.000000000 -0700
+++ b/examples/rlversion.c 2015-01-26 20:51:11.524115600 -0700
@@ -41,7 +41,7 @@ extern void exit();
# include <readline/readline.h>
#endif
-main()
+int main(void)
{
printf ("%s\n", rl_library_version ? rl_library_version : "unknown");
exit (0);
--- a/histexpand.c 2013-12-02 07:22:30.000000000 -0700
+++ b/histexpand.c 2015-01-26 20:51:11.524115600 -0700
@@ -204,7 +204,7 @@ get_history_event (string, caller_index,
}
/* Only a closing `?' or a newline delimit a substring search string. */
- for (local_index = i; c = string[i]; i++)
+ for (local_index = i; (c = string[i]); i++)
{
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
@@ -677,7 +677,7 @@ history_expand_internal (string, start,
case 's':
{
char *new_event;
- int delimiter, failed, si, l_temp, ws, we;
+ int delimiter, failed, si, l_temp, we;
if (c == 's')
{
@@ -776,7 +776,6 @@ history_expand_internal (string, start,
{
for (; temp[si] && whitespace (temp[si]); si++)
;
- ws = si;
we = history_tokenize_word (temp, si);
}
--- a/histfile.c 2013-07-19 06:17:17.000000000 -0600
+++ b/histfile.c 2015-01-26 20:51:11.524115600 -0700
@@ -104,7 +104,7 @@ int history_write_timestamps = 0;
/* Does S look like the beginning of a history timestamp entry? Placeholder
for more extensive tests. */
-#define HIST_TIMESTAMP_START(s) (*(s) == history_comment_char && isdigit ((s)[1]) )
+#define HIST_TIMESTAMP_START(s) (*(s) == history_comment_char && isdigit ((unsigned char) (s)[1]) )
/* Return the string that should be used in the place of this
filename. This only matters when you don't specify the
--- a/input.c 2015-01-26 20:45:49.881252500 -0700
+++ b/input.c 2015-01-26 20:51:11.524115600 -0700
@@ -431,7 +431,7 @@ rl_read_key ()
else
{
/* If input is coming from a macro, then use that. */
- if (c = _rl_next_macro_key ())
+ if ((c = _rl_next_macro_key ()))
return (c);
/* If the user has an event function, then call it periodically. */
--- a/isearch.c 2013-10-14 07:08:40.000000000 -0600
+++ b/isearch.c 2015-01-26 20:51:11.539711800 -0700
@@ -740,7 +740,7 @@ rl_search_history (direction, invoking_k
int direction, invoking_key;
{
_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);
@@ -755,7 +755,7 @@ rl_search_history (direction, invoking_k
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)
@@ -778,9 +778,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);
--- a/misc.c 2015-01-26 20:45:49.943861800 -0700
+++ b/misc.c 2015-01-26 20:51:11.539711800 -0700
@@ -455,7 +455,7 @@ _rl_revert_all_lines ()
entry = (hpos == history_length) ? previous_history () : current_history ();
while (entry)
{
- if (ul = (UNDO_LIST *)entry->data)
+ if ((ul = (UNDO_LIST *)entry->data))
{
if (ul == saved_undo_list)
saved_undo_list = 0;
@@ -502,7 +502,7 @@ rl_clear_history ()
for (i = 0; i < history_length; i++)
{
hent = hlist[i];
- if (ul = (UNDO_LIST *)hent->data)
+ if ((ul = (UNDO_LIST *)hent->data))
{
if (ul == saved_undo_list)
saved_undo_list = 0;
--- a/nls.c 2013-03-09 12:51:10.000000000 -0700
+++ b/nls.c 2015-01-26 20:51:11.539711800 -0700
@@ -80,7 +80,7 @@ static char *legal_lang_values[] =
static char *normalize_codeset PARAMS((char *));
#endif /* !HAVE_SETLOCALE */
-static char *find_codeset PARAMS((char *, size_t *));
+static char *find_codeset PARAMS((char *, size_t *)) __attribute__ ((__unused__));
static char *_rl_get_locale_var PARAMS((const char *));
@@ -104,12 +104,13 @@ utf8locale (lspec)
char *lspec;
{
char *cp;
- size_t len;
#if HAVE_LANGINFO_CODESET
cp = nl_langinfo (CODESET);
return (STREQ (cp, "UTF-8") || STREQ (cp, "utf8"));
#else
+ size_t len;
+
cp = find_codeset (lspec, &len);
if (cp == 0 || len < 4 || len > 5)
--- a/parens.c 2009-04-19 11:12:06.000000000 -0600
+++ b/parens.c 2015-01-26 20:51:11.539711800 -0700
@@ -106,7 +106,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;
@@ -126,7 +126,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);
--- a/posixjmp.h 2012-12-23 20:20:50.000000000 -0700
+++ b/posixjmp.h 2015-01-26 20:51:11.539711800 -0700
@@ -27,7 +27,7 @@
#if defined (HAVE_POSIX_SIGSETJMP)
# define procenv_t sigjmp_buf
-# if !defined (__OPENNT)
+# if !defined (__OPENNT) && !defined (__CYGWIN__)
# undef setjmp
# define setjmp(x) sigsetjmp((x), 1)
# define setjmp_nosigs(x) sigsetjmp((x), 0)
--- a/readline.c 2015-01-26 20:45:49.740844600 -0700
+++ b/readline.c 2015-01-26 20:51:11.539711800 -0700
@@ -95,7 +95,7 @@ static void bind_arrow_keys_internal PAR
static void bind_arrow_keys PARAMS((void));
static void readline_default_bindings PARAMS((void));
-static void reset_default_bindings PARAMS((void));
+//static void reset_default_bindings PARAMS((void));
static int _rl_subseq_result PARAMS((int, Keymap, int, int));
static int _rl_subseq_getchar PARAMS((int));
@@ -522,7 +522,7 @@ readline_internal_char ()
readline_internal_charloop ()
#endif
{
- static int lastc, eof_found;
+ static int lastc, eof_found __attribute__((unused));
int c, code, lk;
lastc = -1;
@@ -1204,6 +1204,7 @@ readline_default_bindings ()
rl_tty_set_default_bindings (_rl_keymap);
}
+#if 0
/* Reset the default bindings for the terminal special characters we're
interested in back to rl_insert and read the new ones. */
static void
@@ -1215,6 +1216,7 @@ reset_default_bindings ()
rl_tty_set_default_bindings (_rl_keymap);
}
}
+#endif
/* Bind some common arrow key sequences in MAP. */
static void
--- a/rltty.c 2013-08-25 14:57:05.000000000 -0600
+++ b/rltty.c 2015-01-26 20:51:11.539711800 -0700
@@ -30,6 +30,7 @@
#include <signal.h>
#include <errno.h>
#include <stdio.h>
+#include <sys/ioctl.h>
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
--- a/shell.c 2013-03-13 08:17:00.000000000 -0600
+++ b/shell.c 2015-01-26 20:51:11.539711800 -0700
@@ -123,8 +123,10 @@ sh_single_quote (string)
/* Set the environment variables LINES and COLUMNS to lines and cols,
respectively. */
static char setenv_buf[INT_STRLEN_BOUND (int) + 1];
+# if !defined (HAVE_SETENV) && defined (HAVE_PUTENV)
static char putenv_buf1[INT_STRLEN_BOUND (int) + 6 + 1]; /* sizeof("LINES=") == 6 */
static char putenv_buf2[INT_STRLEN_BOUND (int) + 8 + 1]; /* sizeof("COLUMNS=") == 8 */
+# endif
void
sh_set_lines_and_columns (lines, cols)
--- a/signals.c 2014-01-10 13:06:48.000000000 -0700
+++ b/signals.c 2015-01-26 20:51:11.539711800 -0700
@@ -576,7 +576,6 @@ rl_free_line_state ()
/* **************************************************************** */
#if defined (HAVE_POSIX_SIGNALS)
-static sigset_t sigint_set, sigint_oset;
static sigset_t sigwinch_set, sigwinch_oset;
#else /* !HAVE_POSIX_SIGNALS */
# if defined (HAVE_BSD_SIGNALS)
--- a/terminal.c 2013-09-18 07:12:01.000000000 -0600
+++ b/terminal.c 2015-01-26 20:51:11.539711800 -0700
@@ -31,6 +31,7 @@
#if defined (HAVE_SYS_FILE_H)
# include <sys/file.h>
#endif /* HAVE_SYS_FILE_H */
+#include <sys/ioctl.h>
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
--- a/text.c 2013-10-14 07:25:05.000000000 -0600
+++ b/text.c 2015-01-26 20:51:11.539711800 -0700
@@ -859,11 +859,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 ();
--- a/tilde.c 2010-07-25 15:42:13.000000000 -0600
+++ b/tilde.c 2015-01-26 20:51:11.539711800 -0700
@@ -196,7 +196,7 @@ tilde_expand (string)
int result_size, result_index;
result_index = result_size = 0;
- if (result = strchr (string, '~'))
+ if ((result = strchr (string, '~')))
result = (char *)xmalloc (result_size = (strlen (string) + 16));
else
result = (char *)xmalloc (result_size = (strlen (string) + 1));
--- a/undo.c 2014-02-02 13:47:46.000000000 -0700
+++ b/undo.c 2015-01-26 20:51:11.555311900 -0700
@@ -124,7 +124,7 @@ _rl_free_undo_list (ul)
void
rl_free_undo_list ()
{
- UNDO_LIST *release, *orig_list;
+ UNDO_LIST *orig_list;
orig_list = rl_undo_list;
_rl_free_undo_list (rl_undo_list);
--- a/vi_mode.c 2012-09-01 16:55:30.000000000 -0600
+++ b/vi_mode.c 2015-01-26 20:51:11.555311900 -0700
@@ -1089,7 +1089,7 @@ static int
rl_domove_motion_callback (m)
_rl_vimotion_cxt *m;
{
- int c, save, r;
+ int c, r;
int old_end;
_rl_vi_last_motion = c = m->motion;
@@ -1257,7 +1257,6 @@ int
rl_vi_domove (x, ignore)
int x, *ignore;
{
- int r;
_rl_vimotion_cxt *m;
m = _rl_vimvcxt;