@@ -0,0 +1,1393 @@
1+--- bashline.c 2015-02-06 17:12:55.823275600 -0700
2++++ bashline.c 2015-02-06 17:14:11.000103800 -0700
4+ # include "pcomplete.h"
9++# define IMP(x) __imp_##x
11++# define IMP(x) _imp__##x
17+ /* These should agree with the defines for emacs_mode and vi_mode in
18+ rldefs.h, even though that's not a public readline header file. */
19+ #ifndef EMACS_EDITING_MODE
20+@@ -264,6 +274,11 @@ int no_empty_command_completion;
21+ are the only possible matches, even if FIGNORE says to. */
22+ int force_fignore = 1;
25++/* If set, shorten "foo.exe" to "foo" when they are the same file. */
26++int completion_strip_exe;
27++#endif /* __CYGWIN__ */
29+ /* Perform spelling correction on directory names during word completion */
30+ int dircomplete_spelling = 0;
32+@@ -491,11 +506,12 @@ initialize_readline ()
35+ func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
36+- if (func == rl_vi_editing_mode)
37++ extern rl_command_func_t *IMP(rl_vi_editing_mode);
38++ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
39+ rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap);
41+ func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
42+- if (func == rl_vi_editing_mode)
43++ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
44+ rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap);
45+ #if defined (VI_MODE)
46+ rl_unbind_key_in_map (CTRL('E'), vi_movement_keymap);
47+@@ -514,7 +530,8 @@ initialize_readline ()
50+ func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
51+- if (func == 0 || func == rl_tilde_expand)
52++ extern rl_command_func_t *IMP(rl_tilde_expand);
53++ if (func == 0 || func == rl_tilde_expand || func == IMP(rl_tilde_expand))
54+ rl_bind_keyseq_in_map (kseq, bash_complete_username, emacs_meta_keymap);
56+ rl_bind_key_if_unbound_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap);
57+@@ -537,7 +554,8 @@ initialize_readline ()
60+ func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
61+- if (func == 0 || func == rl_tab_insert)
62++ extern rl_command_func_t *IMP(rl_tab_insert);
63++ if (func == 0 || func == rl_tab_insert || func == IMP(rl_tab_insert))
64+ rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap);
66+ /* Tell the completer that we want a crack first. */
67+@@ -2109,6 +2127,21 @@ globword:
69+ if (match && executable_completion ((searching_path ? val : cval), searching_path))
72++ if (completion_strip_exe)
74++ size_t val_len = strlen (val);
76++ if (val_len > 4 && !strcasecmp (&val[val_len - 4], ".exe")
77++ && (candidate = strdup (val)))
79++ candidate[val_len - 4] = '\0';
80++ if (same_file (val, candidate, NULL, NULL))
81++ temp[strlen (temp) - 4] = '\0';
89+@@ -2844,6 +2877,17 @@ test_for_directory (name)
92+ fn = bash_tilde_expand (name, 0);
94++ /* stat("//server") can only be successful as a directory, but takes
95++ a several-second timeout to fail. It is much faster to assume
96++ that //server is a valid name than it is to wait for the stat,
97++ even though it gives false positives on bad names. */
98++ if (fn[0] == '/' && fn[1] == '/' && ! strchr (&fn[2], '/'))
103++#endif /* __CYGWIN__ */
104+ r = file_isdir (fn);
107+--- builtins/evalstring.c 2015-02-06 17:12:55.682776800 -0700
108++++ builtins/evalstring.c 2015-02-06 17:14:11.015662800 -0700
109+@@ -195,7 +195,7 @@ parse_and_execute (string, from_file, fl
111+ volatile int should_jump_to_top_level, last_result;
112+ COMMAND *volatile command;
113+- volatile sigset_t pe_sigmask;
114++ sigset_t pe_sigmask;
116+ parse_prologue (string, flags, PE_TAG);
118+@@ -451,7 +451,7 @@ parse_string (string, from_file, flags,
119+ volatile int should_jump_to_top_level;
120+ COMMAND *volatile command, *oglobal;
122+- volatile sigset_t ps_sigmask;
123++ sigset_t ps_sigmask;
125+ parse_prologue (string, flags, PS_TAG);
127+--- builtins/set.def 2013-04-19 05:20:34.000000000 -0600
128++++ builtins/set.def 2015-02-06 17:14:11.015662800 -0700
129+@@ -56,6 +56,13 @@ extern int dont_save_function_defs;
130+ #if defined (READLINE)
131+ extern int no_line_editing;
132+ #endif /* READLINE */
135++static int set_minus_o_option_maybe (int, const char *, int);
136++# define INTERACTIVE_ONLY ,1
137++#else /* ! __CYGWIN__ */
138++# define INTERACTIVE_ONLY
142+ $FUNCTION set_builtin
143+@@ -92,6 +99,9 @@ Options:
144+ #if defined (HISTORY)
145+ history enable command history
148++ igncr on cygwin, ignore \r in line endings
150+ ignoreeof the shell will not exit upon reading EOF
151+ interactive-comments
152+ allow comments to appear in interactive commands
153+@@ -188,29 +198,41 @@ const struct {
155+ setopt_set_func_t *set_func;
156+ setopt_get_func_t *get_func;
158++ /* Cygwin users have taken to exporting SHELLOPTS for the
159++ cygwin-specific igncr. As a result, we need to make sure
160++ SHELLOPTS parsing does not turn on interactive options when
161++ exported from an interactive shell, but parsed in a
162++ non-interactive setting, since some interactive options violate
163++ POSIX /bin/sh rules. */
164++ int interactive_only;
165++#endif /* __CYGWIN__ */
167+ { "allexport", 'a', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
168+ #if defined (BRACE_EXPANSION)
169+ { "braceexpand",'B', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
171+ #if defined (READLINE)
172+- { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
173++ { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY},
175+ { "errexit", 'e', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
176+ { "errtrace", 'E', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
177+ { "functrace", 'T', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
178+ { "hashall", 'h', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
179+ #if defined (BANG_HISTORY)
180+- { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
181++ { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
182+ #endif /* BANG_HISTORY */
183+ #if defined (HISTORY)
184+- { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL },
185++ { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
188++ { "igncr", '\0', &igncr, NULL, (setopt_get_func_t *)NULL },
190+ { "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
191+ { "interactive-comments", '\0', &interactive_comments, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
192+ { "keyword", 'k', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
193+ #if defined (JOB_CONTROL)
194+- { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
195++ { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
197+ { "noclobber", 'C', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
198+ { "noexec", 'n', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
199+@@ -229,7 +251,7 @@ const struct {
200+ { "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
201+ { "verbose", 'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
202+ #if defined (READLINE)
203+- { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
204++ { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY},
206+ { "xtrace", 'x', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
207+ {(char *)NULL, 0 , (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
208+@@ -416,6 +438,15 @@ int
209+ set_minus_o_option (on_or_off, option_name)
214++ /* See cygwin comments above. */
215++ return set_minus_o_option_maybe (on_or_off, option_name, 0);
218++set_minus_o_option_maybe (int on_or_off, const char *option_name,
219++ int avoid_interactive)
220++#endif /* __CYGWIN__ */
224+@@ -423,6 +454,10 @@ set_minus_o_option (on_or_off, option_na
226+ if (STREQ (option_name, o_options[i].name))
229++ if (o_options[i].interactive_only && avoid_interactive)
230++ return EXECUTION_SUCCESS;
231++#endif /* __CYGWIN__ */
232+ if (o_options[i].letter == 0)
234+ SET_BINARY_O_OPTION_VALUE (i, on_or_off, option_name);
235+@@ -548,7 +583,11 @@ parse_shellopts (value)
237+ while (vname = extract_colon_unit (value, &vptr))
240++ set_minus_o_option_maybe (FLAG_ON, vname, !interactive_shell);
241++#else /* !__CYGWIN__ */
242+ set_minus_o_option (FLAG_ON, vname);
247+--- builtins/shopt.def 2013-02-27 07:43:20.000000000 -0700
248++++ builtins/shopt.def 2015-02-06 17:14:11.015662800 -0700
249+@@ -91,6 +91,11 @@ extern int glob_star;
250+ extern int glob_asciirange;
251+ extern int lastpipe_opt;
254++extern int completion_strip_exe;
258+ #if defined (EXTENDED_GLOB)
259+ extern int extended_glob;
261+@@ -161,6 +166,9 @@ static struct {
262+ { "compat40", &shopt_compat40, set_compatibility_level },
263+ { "compat41", &shopt_compat41, set_compatibility_level },
264+ { "compat42", &shopt_compat41, set_compatibility_level },
266++ { "completion_strip_exe", &completion_strip_exe, NULL },
268+ #if defined (READLINE)
269+ { "complete_fullquote", &complete_fullquote, (shopt_set_func_t *)NULL},
270+ { "direxpand", &dircomplete_expand, shopt_set_complete_direxpand },
271+--- config-top.h 2012-08-18 18:51:30.000000000 -0600
272++++ config-top.h 2015-02-06 17:14:11.015662800 -0700
274+ #define KSH_COMPATIBLE_SELECT
276+ /* System-wide .bashrc file for interactive shells. */
277+-/* #define SYS_BASHRC "/etc/bash.bashrc" */
278++#define SYS_BASHRC "/etc/bash.bashrc"
280+ /* System-wide .bash_logout for login shells. */
281+-/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
282++#define SYS_BASH_LOGOUT "/etc/bash.bash_logout"
284+ /* Define this to make non-interactive shells begun with argv[0][0] == '-'
285+ run the startup files when not in posix mode. */
287+ sshd and source the .bashrc if so (like the rshd behavior). This checks
288+ for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment,
289+ which can be fooled under certain not-uncommon circumstances. */
290+-/* #define SSH_SOURCE_BASHRC */
291++#define SSH_SOURCE_BASHRC
293+ /* Define if you want the case-capitalizing operators (~[~]) and the
294+ `capcase' variable attribute (declare -c). */
295+--- doc/Makefile.in 2013-10-30 14:18:12.000000000 -0600
296++++ doc/Makefile.in 2015-02-06 17:14:11.015662800 -0700
297+@@ -176,7 +176,7 @@ bashref.html: $(BASHREF_FILES) $(HSUSER)
298+ $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
300+ bash.info: bashref.info
301+- ${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \
302++ ${SHELL} ${INFOPOST} < bashref.info > $@ ; \
306+@@ -237,9 +237,9 @@ install: info installdirs bash.info
307+ -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext}
308+ -$(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir)
309+ # uncomment the next lines to install the builtins man page
310+-# sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
311+-# -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
312+-# -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
313++ sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
314++ -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
315++ -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
316+ -if test -f bash.info; then d=.; else d=$(srcdir); fi; \
317+ $(INSTALL_DATA) $$d/bash.info $(DESTDIR)$(infodir)/bash.info
318+ # run install-info if it is present to update the info directory
319+--- doc/bash.1 2014-02-06 07:03:52.000000000 -0700
320++++ doc/bash.1 2015-02-06 17:14:11.015662800 -0700
321+@@ -1658,6 +1658,14 @@ subsequently reset.
322+ Expands to the effective user ID of the current user, initialized at
323+ shell startup. This variable is readonly.
326++A colon-separated list of extended glob (see \fBPattern Matching\fP)
327++patterns. Files with full paths matching one of these patterns are
328++not considered executable for the purposes of completion and PATH
329++searching, but the \fB[\fP, \fB[[\fP, and \fBtest\fP builtins are not
330++affected. Use this variable to deal with systems that set the
331++executable bit on files that are not actually executable.
334+ An array variable containing the names of all shell functions
335+ currently in the execution call stack.
336+@@ -3308,6 +3316,10 @@ the character
338+ at the start of a name or immediately following a slash
339+ must be matched explicitly, unless the shell option
340++.B completion_strip_exe
341++If set, whenever bash sees `foo.exe' during completion, it checks if
342++`foo' is the same file and strips the suffix.
346+ When matching a pathname, the slash character must always be
347+--- doc/bashref.texi 2014-02-22 11:20:36.000000000 -0700
348++++ doc/bashref.texi 2015-02-06 17:14:11.015662800 -0700
349+@@ -4992,6 +4992,10 @@ filenames.
350+ This variable is set by default, which is the default Bash behavior in
351+ versions through 4.2.
353++@item completion_strip_exe
354++If set, whenever bash sees `foo.exe' during completion, it checks if
355++`foo' is the same file and strips the suffix.
359+ replaces directory names with the results of word expansion when performing
360+@@ -5578,6 +5582,14 @@ Similar to @code{BASH_ENV}; used when th
361+ The numeric effective user id of the current user. This variable
365++A colon-separated list of extended glob ((@pxref{Pattern Matching})
366++patterns. Files with full paths matching one of these patterns are
367++not considered executable for the purposes of completion and PATH
368++searching, but the @code{[}, @code{[[}, and @code{test} builtins are
369++not affected. Use this variable to deal with systems that set the
370++executable bit on files that are not actually executable.
373+ The editor used as a default by the @option{-e} option to the @code{fc}
375+--- doc/builtins.1 2012-02-21 12:32:05.000000000 -0700
376++++ doc/builtins.1 2015-02-06 17:14:11.031260100 -0700
377+@@ -19,6 +19,6 @@ shift, shopt, source, suspend, test, tim
378+ ulimit, umask, unalias, unset, wait \- bash built-in commands, see \fBbash\fR(1)
379+ .SH BASH BUILTIN COMMANDS
385+--- execute_cmd.c 2015-02-06 17:12:55.261573700 -0700
386++++ execute_cmd.c 2015-02-06 17:14:11.031260100 -0700
387+@@ -58,6 +58,7 @@ extern int errno;
390+ #define NEED_FPURGE_DECL
391++#define NEED_SH_SETLINEBUF_DECL /* used in externs.h */
393+ #include "bashansi.h"
394+ #include "bashintl.h"
395+--- expr.c 2014-01-03 06:55:00.000000000 -0700
396++++ expr.c 2015-02-06 17:14:11.031260100 -0700
400+ #include "typemax.h" /* INTMAX_MAX, INTMAX_MIN */
403+ /* Because of the $((...)) construct, expressions may include newlines.
404+ Here is a macro which accepts newlines, tabs and spaces as whitespace. */
405+--- findcmd.c 2012-10-15 05:45:04.000000000 -0600
406++++ findcmd.c 2015-02-06 17:14:11.031260100 -0700
411++#include <glob/strmatch.h>
413+ extern int posixly_correct;
414+ extern int last_command_exit_value;
416+@@ -77,6 +79,38 @@ int check_hashed_filenames;
417+ containing the file of interest. */
418+ int dot_found_in_search = 0;
420++static struct ignorevar execignore =
426++ (sh_iv_item_func_t *)0,
430++setup_exec_ignore (char *varname)
432++ setup_ignore_patterns (&execignore);
435++/* Return whether we should never consider file executable
436++ * even if the system tells us it is. */
438++is_on_exec_blacklist (char *name)
441++ int flags = FNM_EXTMATCH | FNM_CASEFOLD;
443++ for (p = execignore.ignores; p && p->val; p++)
445++ if (strmatch (p->val, (char *)name, flags) != FNM_NOMATCH)
452+ /* Return some flags based on information about this file.
453+ The EXISTS bit is non-zero if the file is found.
454+ The EXECABLE bit is non-zero the file is executble.
455+@@ -104,7 +138,7 @@ file_status (name)
456+ file access mechanisms into account. eaccess uses the effective
457+ user and group IDs, not the real ones. We could use sh_eaccess,
458+ but we don't want any special treatment for /dev/fd. */
459+- if (eaccess (name, X_OK) == 0)
460++ if (!is_on_exec_blacklist (name) && eaccess (name, X_OK) == 0)
462+ if (eaccess (name, R_OK) == 0)
464+--- findcmd.h 2012-01-14 16:56:25.000000000 -0700
465++++ findcmd.h 2015-02-06 17:14:11.031260100 -0700
466+@@ -31,5 +31,6 @@ extern char *find_user_command __P((cons
467+ extern char *find_path_file __P((const char *));
468+ extern char *search_for_command __P((const char *, int));
469+ extern char *user_command_matches __P((const char *, int, int));
470++extern void setup_exec_ignore __P((char *));
472+ #endif /* _FINDCMD_H_ */
473+--- general.c 2014-01-30 14:46:15.000000000 -0700
474++++ general.c 2015-02-06 17:14:11.031260100 -0700
477+ #include <tilde/tilde.h>
480++# include <sys/cygwin.h>
483+ #if !defined (errno)
486+@@ -632,7 +636,8 @@ make_absolute (string, dot_path)
488+ char pathbuf[PATH_MAX + 1];
490+- cygwin_conv_to_full_posix_path (string, pathbuf);
491++ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, string, pathbuf,
493+ result = savestring (pathbuf);
496+--- include/chartypes.h 2011-04-11 12:30:52.000000000 -0600
497++++ include/chartypes.h 2015-02-06 17:14:11.031260100 -0700
500+ # define IN_CTYPE_DOMAIN(c) isascii(c)
502++#define to_uchar(c) ((unsigned char)(c))
504+ #if !defined (isspace) && !defined (HAVE_ISSPACE)
505+ # define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\f')
510+-#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
511+-#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
512+-#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
513+-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
514+-#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c))
515+-#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
516+-#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (c))
517+-#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
518+-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
519+-#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
520++#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (to_uchar (c)))
521++#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (to_uchar (c)))
522++#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (to_uchar (c)))
523++#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (to_uchar (c)))
524++#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (to_uchar (c)))
525++#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (to_uchar (c)))
526++#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (to_uchar (c)))
527++#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (to_uchar (c)))
528++#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (to_uchar (c)))
529++#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (to_uchar (c)))
531+ #define ISLETTER(c) (ISALPHA(c))
533+--- include/posixjmp.h 2012-12-23 20:20:50.000000000 -0700
534++++ include/posixjmp.h 2015-02-06 17:14:11.031260100 -0700
537+ #if defined (HAVE_POSIX_SIGSETJMP)
538+ # define procenv_t sigjmp_buf
539+-# if !defined (__OPENNT)
540++# if !defined (__OPENNT) && !defined __CYGWIN__
542+ # define setjmp(x) sigsetjmp((x), 1)
543+-# define setjmp_nosigs(x) sigsetjmp((x), 0)
545+ # define longjmp(x, n) siglongjmp((x), (n))
546+ # endif /* !__OPENNT */
547++# define setjmp_nosigs(x) sigsetjmp((x), 0)
549+ # define procenv_t jmp_buf
550+ # define setjmp_nosigs setjmp
551+--- input.c 2014-02-07 07:13:08.000000000 -0700
552++++ input.c 2015-02-06 17:14:11.031260100 -0700
561+ #if !defined (errno)
564+@@ -561,6 +565,19 @@ buffered_getchar ()
569++ /* shopt igncr means to discard carriage returns from input stream.
570++ If cr is the only character in the buffer, then recurse to pick
571++ up the next character; otherwise flatten the buffer. */
575++ while ((ch = bufstream_getc (buffers[bash_input.location.buffered_fd]))
580++#endif /* __CYGWIN__ */
581+ #if !defined (DJGPP)
582+ return (bufstream_getc (buffers[bash_input.location.buffered_fd]));
584+--- lib/readline/bind.c 2013-04-06 15:46:38.000000000 -0600
585++++ lib/readline/bind.c 2015-02-06 17:14:11.031260100 -0700
586+@@ -452,7 +452,7 @@ rl_translate_keyseq (seq, array, len)
588+ register int i, c, l, temp;
590+- for (i = l = 0; c = seq[i]; i++)
591++ for (i = l = 0; (c = seq[i]); i++)
595+@@ -1210,7 +1210,7 @@ _rl_skip_to_delim (string, start, delim)
599+- for (i = start,passc = 0; c = string[i]; i++)
600++ for (i = start,passc = 0; (c = string[i]); i++)
604+@@ -1297,7 +1297,6 @@ rl_parse_and_bind (string)
605+ if (_rl_stricmp (string, "set") == 0)
607+ char *var, *value, *e;
611+ /* Make VAR point to start of variable name. */
612+@@ -2198,7 +2197,7 @@ rl_function_dumper (print_readably)
614+ fprintf (rl_outstream, "\n");
616+- for (i = 0; name = names[i]; i++)
617++ for (i = 0; (name = names[i]); i++)
619+ rl_command_func_t *function;
621+--- lib/readline/chardefs.h 2011-07-25 19:47:56.000000000 -0600
622++++ lib/readline/chardefs.h 2015-02-06 17:14:11.046889800 -0700
625+ # define IN_CTYPE_DOMAIN(c) isascii(c)
627++#define to_uchar(c) ((unsigned char)(c))
629+ #if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) && !defined (__cplusplus)
630+ # define isxdigit(c) (isdigit((c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
633+ /* Beware: these only work with single-byte ASCII characters. */
635+-#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
636+-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
637+-#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
638+-#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
639+-#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
640+-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
641+-#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
642++#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (to_uchar (c)))
643++#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (to_uchar (c)))
644++#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (to_uchar (c)))
645++#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (to_uchar (c)))
646++#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (to_uchar (c)))
647++#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (to_uchar (c)))
648++#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (to_uchar (c)))
650+ #define _rl_lowercase_p(c) (NON_NEGATIVE(c) && ISLOWER(c))
651+ #define _rl_uppercase_p(c) (NON_NEGATIVE(c) && ISUPPER(c))
652+--- lib/readline/complete.c 2013-10-14 07:27:10.000000000 -0600
653++++ lib/readline/complete.c 2015-02-06 17:14:11.046889800 -0700
654+@@ -1082,7 +1082,7 @@ _rl_find_completion_word (fp, dp)
655+ /* We didn't find an unclosed quoted substring upon which to do
656+ completion, so use the word break characters to find the
657+ substring on which to complete. */
658+- while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))
659++ while ((rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)))
661+ scan = rl_line_buffer[rl_point];
663+@@ -2116,7 +2116,7 @@ rl_completion_matches (text, entry_funct
664+ match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
665+ match_list[1] = (char *)NULL;
667+- while (string = (*entry_function) (text, matches))
668++ while ((string = (*entry_function) (text, matches)))
670+ if (RL_SIG_RECEIVED ())
672+@@ -2190,7 +2190,7 @@ rl_username_completion_function (text, s
675+ #if defined (HAVE_GETPWENT)
676+- while (entry = getpwent ())
677++ while ((entry = getpwent ()))
679+ /* Null usernames should result in all users as possible completions. */
680+ if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
681+@@ -2723,7 +2723,7 @@ rl_menu_complete (count, ignore)
682+ static int full_completion = 0; /* set to 1 if menu completion should reinitialize on next call */
683+ static int orig_start, orig_end;
684+ static char quote_char;
685+- static int delimiter, cstate;
686++ static int delimiter;
688+ /* The first time through, we generate the list of matches and set things
689+ up to insert them. */
690+--- lib/readline/display.c 2015-02-06 17:12:54.793574600 -0700
691++++ lib/readline/display.c 2015-02-06 17:14:11.046889800 -0700
692+@@ -66,7 +66,6 @@ extern char *strchr (), *strrchr ();
693+ static void update_line PARAMS((char *, char *, int, int, int, int));
694+ static void space_to_eol PARAMS((int));
695+ static void delete_chars PARAMS((int));
696+-static void insert_some_chars PARAMS((char *, int, int));
697+ static void open_some_spaces PARAMS((int));
698+ static void cr PARAMS((void));
700+@@ -1314,7 +1313,7 @@ update_line (old, new, current_line, oma
701+ int current_line, omax, nmax, inv_botlin;
703+ register char *ofd, *ols, *oe, *nfd, *nls, *ne;
704+- int temp, lendiff, wsatend, od, nd, twidth, o_cpos;
705++ int temp, lendiff, wsatend, od, nd, o_cpos;
706+ int current_invis_chars;
707+ int col_lendiff, col_temp;
708+ int bytes_to_insert;
709+@@ -2485,6 +2484,7 @@ _rl_clear_screen ()
710+ #endif /* __DJGPP__ */
714+ /* Insert COUNT characters from STRING to the output stream at column COL. */
716+ insert_some_chars (string, count, col)
717+@@ -2494,6 +2494,7 @@ insert_some_chars (string, count, col)
718+ open_some_spaces (col);
719+ _rl_output_some_chars (string, count);
723+ /* Insert COL spaces, keeping the cursor at the same position. We follow the
724+ ncurses documentation and use either im/ei with explicit spaces, or IC/ic
725+--- lib/readline/histexpand.c 2013-12-02 07:22:30.000000000 -0700
726++++ lib/readline/histexpand.c 2015-02-06 17:14:11.046889800 -0700
727+@@ -204,7 +204,7 @@ get_history_event (string, caller_index,
730+ /* Only a closing `?' or a newline delimit a substring search string. */
731+- for (local_index = i; c = string[i]; i++)
732++ for (local_index = i; (c = string[i]); i++)
734+ #if defined (HANDLE_MULTIBYTE)
735+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
736+@@ -677,7 +677,7 @@ history_expand_internal (string, start,
740+- int delimiter, failed, si, l_temp, ws, we;
741++ int delimiter, failed, si, l_temp, we;
745+@@ -776,7 +776,6 @@ history_expand_internal (string, start,
747+ for (; temp[si] && whitespace (temp[si]); si++)
750+ we = history_tokenize_word (temp, si);
753+--- lib/readline/histfile.c 2013-07-19 06:17:17.000000000 -0600
754++++ lib/readline/histfile.c 2015-02-06 17:14:11.046889800 -0700
755+@@ -104,7 +104,7 @@ int history_write_timestamps = 0;
757+ /* Does S look like the beginning of a history timestamp entry? Placeholder
758+ for more extensive tests. */
759+-#define HIST_TIMESTAMP_START(s) (*(s) == history_comment_char && isdigit ((s)[1]) )
760++#define HIST_TIMESTAMP_START(s) (*(s) == history_comment_char && isdigit ((unsigned char) (s)[1]) )
762+ /* Return the string that should be used in the place of this
763+ filename. This only matters when you don't specify the
764+--- lib/readline/input.c 2015-02-06 17:12:55.027577800 -0700
765++++ lib/readline/input.c 2015-02-06 17:14:11.046889800 -0700
766+@@ -431,7 +431,7 @@ rl_read_key ()
769+ /* If input is coming from a macro, then use that. */
770+- if (c = _rl_next_macro_key ())
771++ if ((c = _rl_next_macro_key ()))
774+ /* If the user has an event function, then call it periodically. */
775+--- lib/readline/isearch.c 2013-10-14 07:08:40.000000000 -0600
776++++ lib/readline/isearch.c 2015-02-06 17:14:11.046889800 -0700
777+@@ -740,7 +740,7 @@ rl_search_history (direction, invoking_k
778+ int direction, invoking_key;
780+ _rl_search_cxt *cxt; /* local for now, but saved globally */
784+ RL_SETSTATE(RL_STATE_ISEARCH);
785+ cxt = _rl_isearch_init (direction);
786+@@ -755,7 +755,7 @@ rl_search_history (direction, invoking_k
790+- c = _rl_search_getchar (cxt);
791++ _rl_search_getchar (cxt);
792+ /* We might want to handle EOF here (c == 0) */
793+ r = _rl_isearch_dispatch (cxt, cxt->lastc);
795+@@ -778,9 +778,9 @@ int
796+ _rl_isearch_callback (cxt)
797+ _rl_search_cxt *cxt;
802+- c = _rl_search_getchar (cxt);
803++ _rl_search_getchar (cxt);
804+ /* We might want to handle EOF here */
805+ r = _rl_isearch_dispatch (cxt, cxt->lastc);
807+--- lib/readline/misc.c 2015-02-06 17:12:55.230384200 -0700
808++++ lib/readline/misc.c 2015-02-06 17:14:11.046889800 -0700
809+@@ -455,7 +455,7 @@ _rl_revert_all_lines ()
810+ entry = (hpos == history_length) ? previous_history () : current_history ();
813+- if (ul = (UNDO_LIST *)entry->data)
814++ if ((ul = (UNDO_LIST *)entry->data))
816+ if (ul == saved_undo_list)
817+ saved_undo_list = 0;
818+@@ -502,7 +502,7 @@ rl_clear_history ()
819+ for (i = 0; i < history_length; i++)
822+- if (ul = (UNDO_LIST *)hent->data)
823++ if ((ul = (UNDO_LIST *)hent->data))
825+ if (ul == saved_undo_list)
826+ saved_undo_list = 0;
827+--- lib/readline/nls.c 2013-03-09 12:51:10.000000000 -0700
828++++ lib/readline/nls.c 2015-02-06 17:14:11.046889800 -0700
829+@@ -80,7 +80,7 @@ static char *legal_lang_values[] =
830+ static char *normalize_codeset PARAMS((char *));
831+ #endif /* !HAVE_SETLOCALE */
833+-static char *find_codeset PARAMS((char *, size_t *));
834++static char *find_codeset PARAMS((char *, size_t *)) __attribute__ ((__unused__));
836+ static char *_rl_get_locale_var PARAMS((const char *));
838+@@ -104,12 +104,13 @@ utf8locale (lspec)
844+ #if HAVE_LANGINFO_CODESET
845+ cp = nl_langinfo (CODESET);
846+ return (STREQ (cp, "UTF-8") || STREQ (cp, "utf8"));
850+ cp = find_codeset (lspec, &len);
852+ if (cp == 0 || len < 4 || len > 5)
853+--- lib/readline/parens.c 2009-04-19 11:12:06.000000000 -0600
854++++ lib/readline/parens.c 2015-02-06 17:14:11.046889800 -0700
855+@@ -106,7 +106,7 @@ rl_insert_close (count, invoking_key)
858+ #if defined (HAVE_SELECT)
859+- int orig_point, match_point, ready;
860++ int orig_point, match_point;
861+ struct timeval timer;
864+@@ -126,7 +126,7 @@ rl_insert_close (count, invoking_key)
865+ orig_point = rl_point;
866+ rl_point = match_point;
867+ (*rl_redisplay_function) ();
868+- ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
869++ select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
870+ rl_point = orig_point;
871+ #else /* !HAVE_SELECT */
872+ _rl_insert_char (count, invoking_key);
873+--- lib/readline/posixjmp.h 2012-12-23 20:20:50.000000000 -0700
874++++ lib/readline/posixjmp.h 2015-02-06 17:14:11.046889800 -0700
877+ #if defined (HAVE_POSIX_SIGSETJMP)
878+ # define procenv_t sigjmp_buf
879+-# if !defined (__OPENNT)
880++# if !defined (__OPENNT) && !defined __CYGWIN__
882+ # define setjmp(x) sigsetjmp((x), 1)
883+-# define setjmp_nosigs(x) sigsetjmp((x), 0)
885+ # define longjmp(x, n) siglongjmp((x), (n))
886+ # endif /* !__OPENNT */
887++# define setjmp_nosigs(x) sigsetjmp((x), 0)
889+ # define procenv_t jmp_buf
890+ # define setjmp_nosigs setjmp
891+--- lib/readline/readline.c 2015-02-06 17:12:54.310964200 -0700
892++++ lib/readline/readline.c 2015-02-06 17:14:11.046889800 -0700
893+@@ -95,7 +95,7 @@ static void bind_arrow_keys_internal PAR
894+ static void bind_arrow_keys PARAMS((void));
896+ static void readline_default_bindings PARAMS((void));
897+-static void reset_default_bindings PARAMS((void));
898++//static void reset_default_bindings PARAMS((void));
900+ static int _rl_subseq_result PARAMS((int, Keymap, int, int));
901+ static int _rl_subseq_getchar PARAMS((int));
902+@@ -522,7 +522,7 @@ readline_internal_char ()
903+ readline_internal_charloop ()
906+- static int lastc, eof_found;
907++ static int lastc, eof_found __attribute__((unused));
911+@@ -1204,6 +1204,7 @@ readline_default_bindings ()
912+ rl_tty_set_default_bindings (_rl_keymap);
916+ /* Reset the default bindings for the terminal special characters we're
917+ interested in back to rl_insert and read the new ones. */
919+@@ -1215,6 +1216,7 @@ reset_default_bindings ()
920+ rl_tty_set_default_bindings (_rl_keymap);
925+ /* Bind some common arrow key sequences in MAP. */
927+--- lib/readline/rltty.c 2013-08-25 14:57:05.000000000 -0600
928++++ lib/readline/rltty.c 2015-02-06 17:14:11.062454900 -0700
933++#include <sys/ioctl.h>
935+ #if defined (HAVE_UNISTD_H)
936+ # include <unistd.h>
937+--- lib/readline/shell.c 2013-03-13 08:17:00.000000000 -0600
938++++ lib/readline/shell.c 2015-02-06 17:14:11.062454900 -0700
939+@@ -123,8 +123,10 @@ sh_single_quote (string)
940+ /* Set the environment variables LINES and COLUMNS to lines and cols,
942+ static char setenv_buf[INT_STRLEN_BOUND (int) + 1];
943++# if !defined (HAVE_SETENV) && defined (HAVE_PUTENV)
944+ static char putenv_buf1[INT_STRLEN_BOUND (int) + 6 + 1]; /* sizeof("LINES=") == 6 */
945+ static char putenv_buf2[INT_STRLEN_BOUND (int) + 8 + 1]; /* sizeof("COLUMNS=") == 8 */
949+ sh_set_lines_and_columns (lines, cols)
950+--- lib/readline/signals.c 2014-01-10 13:06:48.000000000 -0700
951++++ lib/readline/signals.c 2015-02-06 17:14:11.062454900 -0700
952+@@ -576,7 +576,6 @@ rl_free_line_state ()
953+ /* **************************************************************** */
955+ #if defined (HAVE_POSIX_SIGNALS)
956+-static sigset_t sigint_set, sigint_oset;
957+ static sigset_t sigwinch_set, sigwinch_oset;
958+ #else /* !HAVE_POSIX_SIGNALS */
959+ # if defined (HAVE_BSD_SIGNALS)
960+--- lib/readline/terminal.c 2013-09-18 07:12:01.000000000 -0600
961++++ lib/readline/terminal.c 2015-02-06 17:14:11.062454900 -0700
963+ #if defined (HAVE_SYS_FILE_H)
964+ # include <sys/file.h>
965+ #endif /* HAVE_SYS_FILE_H */
966++#include <sys/ioctl.h>
968+ #if defined (HAVE_UNISTD_H)
969+ # include <unistd.h>
970+--- lib/readline/text.c 2013-10-14 07:25:05.000000000 -0600
971++++ lib/readline/text.c 2015-02-06 17:14:11.062454900 -0700
972+@@ -859,11 +859,10 @@ _rl_overwrite_char (count, c)
974+ #if defined (HANDLE_MULTIBYTE)
975+ char mbkey[MB_LEN_MAX];
978+ /* Read an entire multibyte character sequence to insert COUNT times. */
979+ if (count > 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0)
980+- k = _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
981++ _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
984+ rl_begin_undo_group ();
985+--- lib/readline/tilde.c 2010-07-25 15:42:13.000000000 -0600
986++++ lib/readline/tilde.c 2015-02-06 17:14:11.062454900 -0700
987+@@ -196,7 +196,7 @@ tilde_expand (string)
988+ int result_size, result_index;
990+ result_index = result_size = 0;
991+- if (result = strchr (string, '~'))
992++ if ((result = strchr (string, '~')))
993+ result = (char *)xmalloc (result_size = (strlen (string) + 16));
995+ result = (char *)xmalloc (result_size = (strlen (string) + 1));
996+--- lib/readline/undo.c 2014-02-02 13:47:46.000000000 -0700
997++++ lib/readline/undo.c 2015-02-06 17:14:11.062454900 -0700
998+@@ -124,7 +124,7 @@ _rl_free_undo_list (ul)
1000+ rl_free_undo_list ()
1002+- UNDO_LIST *release, *orig_list;
1003++ UNDO_LIST *orig_list;
1005+ orig_list = rl_undo_list;
1006+ _rl_free_undo_list (rl_undo_list);
1007+--- lib/readline/vi_mode.c 2012-09-01 16:55:30.000000000 -0600
1008++++ lib/readline/vi_mode.c 2015-02-06 17:14:11.062454900 -0700
1009+@@ -1089,7 +1089,7 @@ static int
1010+ rl_domove_motion_callback (m)
1011+ _rl_vimotion_cxt *m;
1017+ _rl_vi_last_motion = c = m->motion;
1018+@@ -1257,7 +1257,6 @@ int
1019+ rl_vi_domove (x, ignore)
1023+ _rl_vimotion_cxt *m;
1026+--- lib/sh/pathphys.c 2013-05-28 13:33:58.000000000 -0600
1027++++ lib/sh/pathphys.c 2015-02-06 17:14:11.062454900 -0700
1030+ #include <chartypes.h>
1032++#include <stdlib.h>
1036+@@ -76,6 +77,10 @@ sh_physpath (path, flags)
1041++ /* realpath does this correctly without all the hassle */
1042++ return realpath (path, NULL);
1044+ char tbuf[PATH_MAX+1], linkbuf[PATH_MAX+1];
1045+ char *result, *p, *q, *qsave, *qbase, *workpath;
1046+ int double_slash_path, linklen, nlink;
1047+@@ -214,11 +219,7 @@ error:
1050+ /* Duplicating some code here... */
1051+-#if defined (__CYGWIN__)
1052+- qbase = (ISALPHA((unsigned char)workpath[0]) && workpath[1] == ':') ? workpath + 3 : workpath + 1;
1054+ qbase = workpath + 1;
1056+ double_slash_path = DOUBLE_SLASH (workpath);
1057+ qbase += double_slash_path;
1059+@@ -249,6 +250,7 @@ error:
1063++#endif /* ! __CYGWIN__ */
1067+--- lib/sh/tmpfile.c 2013-12-18 15:50:13.000000000 -0700
1068++++ lib/sh/tmpfile.c 2015-02-06 17:14:11.062454900 -0700
1069+@@ -96,7 +96,7 @@ get_tmpdir (flags)
1070+ if (tdir && (file_iswdir (tdir) == 0 || strlen (tdir) > PATH_MAX))
1074++ if (tdir == 0 || !file_iswdir (tdir))
1075+ tdir = get_sys_tmpdir ();
1077+ #if defined (HAVE_PATHCONF) && defined (_PC_NAME_MAX)
1078+@@ -118,14 +118,15 @@ sh_mktmpname (nameroot, flags)
1082+- filename = (char *)xmalloc (PATH_MAX + 1);
1084+ tdir = get_tmpdir (flags);
1085+ tdlen = strlen (tdir);
1087+ lroot = nameroot ? nameroot : DEFAULT_NAMEROOT;
1090+- sprintf (filename, "%s/%s.XXXXXX", tdir, lroot);
1091++ if (asprintf (&filename, "%s/%s.XXXXXX", tdir, lroot) < 0)
1093+ if (mktemp (filename) == 0)
1096+@@ -138,7 +139,9 @@ sh_mktmpname (nameroot, flags)
1097+ (unsigned long) time ((time_t *)0) ^
1098+ (unsigned long) dollar_dollar_pid ^
1099+ (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
1100+- sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
1102++ if (asprintf (&filename, "%s/%s-%lu", tdir, lroot, filenum) < 0)
1104+ if (tmpnamelen > 0 && tmpnamelen < 32)
1105+ filename[tdlen + 1 + tmpnamelen] = '\0';
1107+@@ -163,14 +166,19 @@ sh_mktmpfd (nameroot, flags, namep)
1108+ char *filename, *tdir, *lroot;
1111+- filename = (char *)xmalloc (PATH_MAX + 1);
1113+ tdir = get_tmpdir (flags);
1114+ tdlen = strlen (tdir);
1116+ lroot = nameroot ? nameroot : DEFAULT_NAMEROOT;
1119+- sprintf (filename, "%s/%s.XXXXXX", tdir, lroot);
1120++ if (asprintf (&filename, "%s/%s.XXXXXX", tdir, lroot) < 0)
1126+ fd = mkstemp (filename);
1127+ if (fd < 0 || namep == 0)
1129+@@ -187,7 +195,13 @@ sh_mktmpfd (nameroot, flags, namep)
1130+ (unsigned long) time ((time_t *)0) ^
1131+ (unsigned long) dollar_dollar_pid ^
1132+ (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
1133+- sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
1135++ if (asprintf (&filename, "%s/%s-%lu", tdir, lroot, filenum) < 0)
1141+ if (tmpnamelen > 0 && tmpnamelen < 32)
1142+ filename[tdlen + 1 + tmpnamelen] = '\0';
1143+ fd = open (filename, BASEOPENFLAGS | ((flags & MT_READWRITE) ? O_RDWR : O_WRONLY), 0600);
1144+--- mksyntax.c 2012-07-29 17:48:38.000000000 -0600
1145++++ mksyntax.c 2015-02-06 17:14:11.062454900 -0700
1148+ #ifdef HAVE_UNISTD_H
1149+ # include <unistd.h>
1152++extern char *optarg;
1155+ #include "syntax.h"
1158+-extern char *optarg;
1163+--- parse.y 2015-02-06 17:12:55.682776800 -0700
1164++++ parse.y 2015-02-06 17:14:11.062454900 -0700
1165+@@ -1531,14 +1531,20 @@ yy_string_get ()
1166+ string = bash_input.location.string;
1168+ /* If the string doesn't exist, or is empty, EOF found. */
1169+- if (string && *string)
1170++ while (string && *string)
1173+ bash_input.location.string = string;
1177++ if (igncr && c == '\r')
1189+@@ -2305,7 +2311,7 @@ shell_getc (remove_quoted_newline)
1190+ if (n <= 2) /* we have to save 1 for the newline added below */
1192+ if (truncating == 0)
1193+- internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX);
1194++ internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%zu): line truncated", shell_input_line_size, SIZE_MAX);
1195+ shell_input_line[i] = '\0';
1198+@@ -3582,7 +3588,6 @@ parse_comsub (qc, open, close, lenp, fla
1203+ ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0);
1206+--- pathexp.h 2009-01-04 12:32:40.000000000 -0700
1207++++ pathexp.h 2015-02-06 17:14:11.062454900 -0700
1208+@@ -86,7 +86,7 @@ struct ign {
1209+ typedef int sh_iv_item_func_t __P((struct ign *));
1212+- char *varname; /* FIGNORE or GLOBIGNORE */
1213++ char *varname; /* FIGNORE or GLOBIGNORE or EXECIGNORE */
1214+ struct ign *ignores; /* Store the ignore strings here */
1215+ int num_ignores; /* How many are there? */
1216+ char *last_ignoreval; /* Last value of variable - cached for speed */
1217+--- redir.c 2013-10-14 07:19:59.000000000 -0600
1218++++ redir.c 2015-02-06 17:14:11.078059300 -0700
1219+@@ -156,7 +156,6 @@ redirection_error (temp, error)
1221+ else if (expandable_redirection_filename (temp))
1223+-expandable_filename:
1224+ oflags = temp->redirectee.filename->flags;
1225+ if (posixly_correct && interactive_shell == 0)
1226+ temp->redirectee.filename->flags |= W_NOGLOB;
1227+--- subst.c 2015-02-06 17:12:55.370841100 -0700
1228++++ subst.c 2015-02-06 17:14:11.078059300 -0700
1230+ #include "posixstat.h"
1231+ #include "bashintl.h"
1233++#define NEED_SH_SETLINEBUF_DECL /* used in externs.h */
1235+ #include "parser.h"
1237+@@ -5268,6 +5269,13 @@ read_comsub (fd, quoted, rflag)
1244++ if (igncr && c == '\r')
1247++#endif /* __CYGWIN__ */
1249+ /* Add the character to ISTRING, possibly after resizing it. */
1250+ RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE);
1251+@@ -5385,6 +5393,28 @@ command_substitute (string, quoted)
1256++ /* Passing a pipe through std fds can cause hangs when talking to a
1257++ non-cygwin child. Move it. */
1258++ if (fildes[0] < 3)
1260++ int fd = fcntl (fildes[0], F_DUPFD, 3);
1261++ close (fildes[0]);
1264++ if (fildes[1] < 3)
1266++ int fd = fcntl (fildes[1], F_DUPFD, 3);
1267++ close (fildes[1]);
1270++ if (fildes[0] < 0 || fildes[1] < 0)
1272++ sys_error (_("cannot make pipe for command substitution"));
1275++#endif /* __CYGWIN__ */
1277+ old_pid = last_made_pid;
1278+ #if defined (JOB_CONTROL)
1279+ old_pipeline_pgrp = pipeline_pgrp;
1280+--- support/bashversion.c 2008-09-09 07:31:53.000000000 -0600
1281++++ support/bashversion.c 2015-02-06 17:14:11.078059300 -0700
1284+ #if defined (HAVE_UNISTD_H)
1285+ # include <unistd.h>
1288++extern char *optarg;
1291+ #include "bashansi.h"
1293+ #define LFLAG 0x0020
1294+ #define XFLAG 0x0040
1297+-extern char *optarg;
1299+ extern char *dist_version;
1300+ extern int patch_level;
1302+@@ -65,7 +65,7 @@ main (argc, argv)
1306+- char dv[128], *rv;
1307++ char dv[128], *rv = NULL;
1309+ if (progname = strrchr (argv[0], '/'))
1311+--- support/mkversion.sh 2008-08-13 06:25:57.000000000 -0600
1312++++ support/mkversion.sh 2015-02-06 17:14:11.078059300 -0700
1313+@@ -29,7 +29,7 @@ source_dir="."
1314+ while [ $# -gt 0 ]; do
1316+ -o) shift; OUTFILE=$1; shift ;;
1317+- -b) shift; inc_build=yes ;;
1318++ -b) shift; ;;# inc_build=yes ;; # hacked out for cygport
1319+ -s) shift; rel_status=$1; shift ;;
1320+ -p) shift; patch_level=$1; shift ;;
1321+ -d) shift; dist_version=$1; shift ;;
1322+--- variables.c 2015-02-06 17:12:55.729569600 -0700
1323++++ variables.c 2015-02-06 17:14:11.078059300 -0700
1324+@@ -2526,9 +2526,9 @@ bind_variable_internal (name, value, tab
1327+ #if defined (ARRAY_VARS)
1328+- if ((aflags & ASS_FROMREF) && (hflags & HASH_NOSRCH) == 0 && valid_array_reference (name))
1329++ if ((aflags & ASS_FROMREF) && (hflags & HASH_NOSRCH) == 0 && valid_array_reference ((char *)name))
1331+- newname = array_variable_name (name, &subp, &sublen);
1332++ newname = array_variable_name ((char*)name, &subp, &sublen);
1334+ return (SHELL_VAR *)NULL; /* XXX */
1335+ entry = hash_lookup (newname, table);
1336+@@ -2573,13 +2573,13 @@ bind_variable_internal (name, value, tab
1337+ entry = make_new_array_variable (newname); /* indexed array by default */
1340+- ind = array_expand_index (name, subp, sublen);
1341++ ind = array_expand_index (entry, subp, sublen);
1342+ bind_array_element (entry, ind, value, aflags);
1345+ else if (entry == 0)
1347+- entry = make_new_variable (name, table);
1348++ entry = make_new_variable ((char*)name, table);
1349+ var_setvalue (entry, make_variable_value (entry, value, 0)); /* XXX */
1351+ else if (entry->assign_func) /* array vars have assign functions now */
1352+@@ -4679,6 +4679,8 @@ static struct name_and_function special_
1353+ { "COMP_WORDBREAKS", sv_comp_wordbreaks },
1356++ { "EXECIGNORE", sv_execignore },
1358+ { "FUNCNEST", sv_funcnest },
1360+ { "GLOBIGNORE", sv_globignore },
1361+@@ -4877,6 +4879,13 @@ sv_globignore (name)
1362+ setup_glob_ignore (name);
1365++/* What to do when EXECIGNORE changes. */
1367++sv_execignore (char *name)
1369++ setup_exec_ignore (name);
1372+ #if defined (READLINE)
1374+ sv_comp_wordbreaks (name)
1375+@@ -4950,7 +4959,7 @@ sv_winsize (name)
1376+ /* Update the value of HOME in the export environment so tilde expansion will
1378+ #if defined (__CYGWIN__)
1380++void sv_home (name)
1383+ array_needs_making = 1;
1384+--- variables.h 2014-01-08 13:33:29.000000000 -0700
1385++++ variables.h 2015-02-06 17:14:11.078059300 -0700
1386+@@ -372,6 +372,7 @@ extern void sv_ifs __P((char *));
1387+ extern void sv_path __P((char *));
1388+ extern void sv_mail __P((char *));
1389+ extern void sv_funcnest __P((char *));
1390++extern void sv_execignore __P((char *));
1391+ extern void sv_globignore __P((char *));
1392+ extern void sv_ignoreeof __P((char *));
1393+ extern void sv_strict_posix __P((char *));