tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
bash: fix cygwin build
David McFarland
8 years ago
af165175
18125e6f
+616
-1396
3 changed files
expand all
collapse all
unified
split
pkgs
shells
bash
4.4.nix
cygwin-bash-4.3.33-1.src.patch
cygwin-bash-4.4.11-2.src.patch
+9
-3
pkgs/shells/bash/4.4.nix
reviewed
···
23
23
in
24
24
import ./bash-4.4-patches.nix patch;
25
25
26
26
-
inherit (stdenv.lib) optional optionals;
26
26
+
inherit (stdenv.lib) optional optionals optionalString;
27
27
in
28
28
29
29
stdenv.mkDerivation rec {
···
52
52
53
53
patchFlags = "-p0";
54
54
55
55
-
patches = upstreamPatches
56
56
-
++ optional hostPlatform.isCygwin ./cygwin-bash-4.3.33-1.src.patch;
55
55
+
patches = upstreamPatches;
56
56
+
57
57
+
postPatch = optionalString hostPlatform.isCygwin "patch -p2 < ${./cygwin-bash-4.4.11-2.src.patch}";
57
58
58
59
configureFlags = [
59
60
(if interactive then "--with-installed-readline" else "--disable-readline")
···
78
79
# Bash randomly fails to build because of a recursive invocation to
79
80
# build `version.h'.
80
81
enableParallelBuilding = false;
82
82
+
83
83
+
makeFlags = optional hostPlatform.isCygwin [
84
84
+
"LOCAL_LDFLAGS=-Wl,--export-all,--out-implib,libbash.dll.a"
85
85
+
"SHOBJ_LIBS=-lbash"
86
86
+
];
81
87
82
88
postInstall = ''
83
89
ln -s bash "$out/bin/sh"
-1393
pkgs/shells/bash/cygwin-bash-4.3.33-1.src.patch
reviewed
···
1
1
-
--- bashline.c 2015-02-06 17:12:55.823275600 -0700
2
2
-
+++ bashline.c 2015-02-06 17:14:11.000103800 -0700
3
3
-
@@ -71,6 +71,16 @@
4
4
-
# include "pcomplete.h"
5
5
-
#endif
6
6
-
7
7
-
+#if __CYGWIN__
8
8
-
+# ifdef __x86_64__
9
9
-
+# define IMP(x) __imp_##x
10
10
-
+# else
11
11
-
+# define IMP(x) _imp__##x
12
12
-
+# endif
13
13
-
+#else
14
14
-
+# define IMP(x) x
15
15
-
+#endif
16
16
-
+
17
17
-
/* These should agree with the defines for emacs_mode and vi_mode in
18
18
-
rldefs.h, even though that's not a public readline header file. */
19
19
-
#ifndef EMACS_EDITING_MODE
20
20
-
@@ -264,6 +274,11 @@ int no_empty_command_completion;
21
21
-
are the only possible matches, even if FIGNORE says to. */
22
22
-
int force_fignore = 1;
23
23
-
24
24
-
+#if __CYGWIN__
25
25
-
+/* If set, shorten "foo.exe" to "foo" when they are the same file. */
26
26
-
+int completion_strip_exe;
27
27
-
+#endif /* __CYGWIN__ */
28
28
-
+
29
29
-
/* Perform spelling correction on directory names during word completion */
30
30
-
int dircomplete_spelling = 0;
31
31
-
32
32
-
@@ -491,11 +506,12 @@ initialize_readline ()
33
33
-
kseq[0] = CTRL('J');
34
34
-
kseq[1] = '\0';
35
35
-
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
36
36
-
- if (func == rl_vi_editing_mode)
37
37
-
+ extern rl_command_func_t *IMP(rl_vi_editing_mode);
38
38
-
+ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
39
39
-
rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap);
40
40
-
kseq[0] = CTRL('M');
41
41
-
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
42
42
-
- if (func == rl_vi_editing_mode)
43
43
-
+ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
44
44
-
rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap);
45
45
-
#if defined (VI_MODE)
46
46
-
rl_unbind_key_in_map (CTRL('E'), vi_movement_keymap);
47
47
-
@@ -514,7 +530,8 @@ initialize_readline ()
48
48
-
kseq[0] = '~';
49
49
-
kseq[1] = '\0';
50
50
-
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
51
51
-
- if (func == 0 || func == rl_tilde_expand)
52
52
-
+ extern rl_command_func_t *IMP(rl_tilde_expand);
53
53
-
+ if (func == 0 || func == rl_tilde_expand || func == IMP(rl_tilde_expand))
54
54
-
rl_bind_keyseq_in_map (kseq, bash_complete_username, emacs_meta_keymap);
55
55
-
56
56
-
rl_bind_key_if_unbound_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap);
57
57
-
@@ -537,7 +554,8 @@ initialize_readline ()
58
58
-
kseq[0] = TAB;
59
59
-
kseq[1] = '\0';
60
60
-
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
61
61
-
- if (func == 0 || func == rl_tab_insert)
62
62
-
+ extern rl_command_func_t *IMP(rl_tab_insert);
63
63
-
+ if (func == 0 || func == rl_tab_insert || func == IMP(rl_tab_insert))
64
64
-
rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap);
65
65
-
66
66
-
/* Tell the completer that we want a crack first. */
67
67
-
@@ -2109,6 +2127,21 @@ globword:
68
68
-
69
69
-
if (match && executable_completion ((searching_path ? val : cval), searching_path))
70
70
-
{
71
71
-
+#if __CYGWIN__
72
72
-
+ if (completion_strip_exe)
73
73
-
+ {
74
74
-
+ size_t val_len = strlen (val);
75
75
-
+ char *candidate;
76
76
-
+ if (val_len > 4 && !strcasecmp (&val[val_len - 4], ".exe")
77
77
-
+ && (candidate = strdup (val)))
78
78
-
+ {
79
79
-
+ candidate[val_len - 4] = '\0';
80
80
-
+ if (same_file (val, candidate, NULL, NULL))
81
81
-
+ temp[strlen (temp) - 4] = '\0';
82
82
-
+ free (candidate);
83
83
-
+ }
84
84
-
+ }
85
85
-
+#endif
86
86
-
if (cval != val)
87
87
-
free (cval);
88
88
-
free (val);
89
89
-
@@ -2844,6 +2877,17 @@ test_for_directory (name)
90
90
-
int r;
91
91
-
92
92
-
fn = bash_tilde_expand (name, 0);
93
93
-
+#if __CYGWIN__
94
94
-
+ /* stat("//server") can only be successful as a directory, but takes
95
95
-
+ a several-second timeout to fail. It is much faster to assume
96
96
-
+ that //server is a valid name than it is to wait for the stat,
97
97
-
+ even though it gives false positives on bad names. */
98
98
-
+ if (fn[0] == '/' && fn[1] == '/' && ! strchr (&fn[2], '/'))
99
99
-
+ {
100
100
-
+ free (fn);
101
101
-
+ return 1;
102
102
-
+ }
103
103
-
+#endif /* __CYGWIN__ */
104
104
-
r = file_isdir (fn);
105
105
-
free (fn);
106
106
-
107
107
-
--- builtins/evalstring.c 2015-02-06 17:12:55.682776800 -0700
108
108
-
+++ builtins/evalstring.c 2015-02-06 17:14:11.015662800 -0700
109
109
-
@@ -195,7 +195,7 @@ parse_and_execute (string, from_file, fl
110
110
-
int code, lreset;
111
111
-
volatile int should_jump_to_top_level, last_result;
112
112
-
COMMAND *volatile command;
113
113
-
- volatile sigset_t pe_sigmask;
114
114
-
+ sigset_t pe_sigmask;
115
115
-
116
116
-
parse_prologue (string, flags, PE_TAG);
117
117
-
118
118
-
@@ -451,7 +451,7 @@ parse_string (string, from_file, flags,
119
119
-
volatile int should_jump_to_top_level;
120
120
-
COMMAND *volatile command, *oglobal;
121
121
-
char *ostring;
122
122
-
- volatile sigset_t ps_sigmask;
123
123
-
+ sigset_t ps_sigmask;
124
124
-
125
125
-
parse_prologue (string, flags, PS_TAG);
126
126
-
127
127
-
--- builtins/set.def 2013-04-19 05:20:34.000000000 -0600
128
128
-
+++ builtins/set.def 2015-02-06 17:14:11.015662800 -0700
129
129
-
@@ -56,6 +56,13 @@ extern int dont_save_function_defs;
130
130
-
#if defined (READLINE)
131
131
-
extern int no_line_editing;
132
132
-
#endif /* READLINE */
133
133
-
+#if __CYGWIN__
134
134
-
+extern int igncr;
135
135
-
+static int set_minus_o_option_maybe (int, const char *, int);
136
136
-
+# define INTERACTIVE_ONLY ,1
137
137
-
+#else /* ! __CYGWIN__ */
138
138
-
+# define INTERACTIVE_ONLY
139
139
-
+#endif
140
140
-
141
141
-
$BUILTIN set
142
142
-
$FUNCTION set_builtin
143
143
-
@@ -92,6 +99,9 @@ Options:
144
144
-
#if defined (HISTORY)
145
145
-
history enable command history
146
146
-
#endif
147
147
-
+#if __CYGWIN__
148
148
-
+ igncr on cygwin, ignore \r in line endings
149
149
-
+#endif
150
150
-
ignoreeof the shell will not exit upon reading EOF
151
151
-
interactive-comments
152
152
-
allow comments to appear in interactive commands
153
153
-
@@ -188,29 +198,41 @@ const struct {
154
154
-
int *variable;
155
155
-
setopt_set_func_t *set_func;
156
156
-
setopt_get_func_t *get_func;
157
157
-
+#if __CYGWIN__
158
158
-
+ /* Cygwin users have taken to exporting SHELLOPTS for the
159
159
-
+ cygwin-specific igncr. As a result, we need to make sure
160
160
-
+ SHELLOPTS parsing does not turn on interactive options when
161
161
-
+ exported from an interactive shell, but parsed in a
162
162
-
+ non-interactive setting, since some interactive options violate
163
163
-
+ POSIX /bin/sh rules. */
164
164
-
+ int interactive_only;
165
165
-
+#endif /* __CYGWIN__ */
166
166
-
} o_options[] = {
167
167
-
{ "allexport", 'a', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
168
168
-
#if defined (BRACE_EXPANSION)
169
169
-
{ "braceexpand",'B', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
170
170
-
#endif
171
171
-
#if defined (READLINE)
172
172
-
- { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
173
173
-
+ { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY},
174
174
-
#endif
175
175
-
{ "errexit", 'e', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
176
176
-
{ "errtrace", 'E', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
177
177
-
{ "functrace", 'T', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
178
178
-
{ "hashall", 'h', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
179
179
-
#if defined (BANG_HISTORY)
180
180
-
- { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
181
181
-
+ { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
182
182
-
#endif /* BANG_HISTORY */
183
183
-
#if defined (HISTORY)
184
184
-
- { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL },
185
185
-
+ { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
186
186
-
+#endif
187
187
-
+#if __CYGWIN__
188
188
-
+ { "igncr", '\0', &igncr, NULL, (setopt_get_func_t *)NULL },
189
189
-
#endif
190
190
-
{ "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
191
191
-
{ "interactive-comments", '\0', &interactive_comments, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
192
192
-
{ "keyword", 'k', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
193
193
-
#if defined (JOB_CONTROL)
194
194
-
- { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
195
195
-
+ { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
196
196
-
#endif
197
197
-
{ "noclobber", 'C', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
198
198
-
{ "noexec", 'n', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
199
199
-
@@ -229,7 +251,7 @@ const struct {
200
200
-
{ "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
201
201
-
{ "verbose", 'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
202
202
-
#if defined (READLINE)
203
203
-
- { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
204
204
-
+ { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY},
205
205
-
#endif
206
206
-
{ "xtrace", 'x', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
207
207
-
{(char *)NULL, 0 , (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
208
208
-
@@ -416,6 +438,15 @@ int
209
209
-
set_minus_o_option (on_or_off, option_name)
210
210
-
int on_or_off;
211
211
-
char *option_name;
212
212
-
+#if __CYGWIN__
213
213
-
+{
214
214
-
+ /* See cygwin comments above. */
215
215
-
+ return set_minus_o_option_maybe (on_or_off, option_name, 0);
216
216
-
+}
217
217
-
+static int
218
218
-
+set_minus_o_option_maybe (int on_or_off, const char *option_name,
219
219
-
+ int avoid_interactive)
220
220
-
+#endif /* __CYGWIN__ */
221
221
-
{
222
222
-
register int i;
223
223
-
224
224
-
@@ -423,6 +454,10 @@ set_minus_o_option (on_or_off, option_na
225
225
-
{
226
226
-
if (STREQ (option_name, o_options[i].name))
227
227
-
{
228
228
-
+#if __CYGWIN__
229
229
-
+ if (o_options[i].interactive_only && avoid_interactive)
230
230
-
+ return EXECUTION_SUCCESS;
231
231
-
+#endif /* __CYGWIN__ */
232
232
-
if (o_options[i].letter == 0)
233
233
-
{
234
234
-
SET_BINARY_O_OPTION_VALUE (i, on_or_off, option_name);
235
235
-
@@ -548,7 +583,11 @@ parse_shellopts (value)
236
236
-
vptr = 0;
237
237
-
while (vname = extract_colon_unit (value, &vptr))
238
238
-
{
239
239
-
+#if __CYGWIN__
240
240
-
+ set_minus_o_option_maybe (FLAG_ON, vname, !interactive_shell);
241
241
-
+#else /* !__CYGWIN__ */
242
242
-
set_minus_o_option (FLAG_ON, vname);
243
243
-
+#endif
244
244
-
free (vname);
245
245
-
}
246
246
-
}
247
247
-
--- builtins/shopt.def 2013-02-27 07:43:20.000000000 -0700
248
248
-
+++ builtins/shopt.def 2015-02-06 17:14:11.015662800 -0700
249
249
-
@@ -91,6 +91,11 @@ extern int glob_star;
250
250
-
extern int glob_asciirange;
251
251
-
extern int lastpipe_opt;
252
252
-
253
253
-
+#if __CYGWIN__
254
254
-
+extern int completion_strip_exe;
255
255
-
+#endif
256
256
-
+
257
257
-
+
258
258
-
#if defined (EXTENDED_GLOB)
259
259
-
extern int extended_glob;
260
260
-
#endif
261
261
-
@@ -161,6 +166,9 @@ static struct {
262
262
-
{ "compat40", &shopt_compat40, set_compatibility_level },
263
263
-
{ "compat41", &shopt_compat41, set_compatibility_level },
264
264
-
{ "compat42", &shopt_compat41, set_compatibility_level },
265
265
-
+#if __CYGWIN__
266
266
-
+ { "completion_strip_exe", &completion_strip_exe, NULL },
267
267
-
+#endif
268
268
-
#if defined (READLINE)
269
269
-
{ "complete_fullquote", &complete_fullquote, (shopt_set_func_t *)NULL},
270
270
-
{ "direxpand", &dircomplete_expand, shopt_set_complete_direxpand },
271
271
-
--- config-top.h 2012-08-18 18:51:30.000000000 -0600
272
272
-
+++ config-top.h 2015-02-06 17:14:11.015662800 -0700
273
273
-
@@ -80,10 +80,10 @@
274
274
-
#define KSH_COMPATIBLE_SELECT
275
275
-
276
276
-
/* System-wide .bashrc file for interactive shells. */
277
277
-
-/* #define SYS_BASHRC "/etc/bash.bashrc" */
278
278
-
+#define SYS_BASHRC "/etc/bash.bashrc"
279
279
-
280
280
-
/* System-wide .bash_logout for login shells. */
281
281
-
-/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
282
282
-
+#define SYS_BASH_LOGOUT "/etc/bash.bash_logout"
283
283
-
284
284
-
/* Define this to make non-interactive shells begun with argv[0][0] == '-'
285
285
-
run the startup files when not in posix mode. */
286
286
-
@@ -93,7 +93,7 @@
287
287
-
sshd and source the .bashrc if so (like the rshd behavior). This checks
288
288
-
for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment,
289
289
-
which can be fooled under certain not-uncommon circumstances. */
290
290
-
-/* #define SSH_SOURCE_BASHRC */
291
291
-
+#define SSH_SOURCE_BASHRC
292
292
-
293
293
-
/* Define if you want the case-capitalizing operators (~[~]) and the
294
294
-
`capcase' variable attribute (declare -c). */
295
295
-
--- doc/Makefile.in 2013-10-30 14:18:12.000000000 -0600
296
296
-
+++ doc/Makefile.in 2015-02-06 17:14:11.015662800 -0700
297
297
-
@@ -176,7 +176,7 @@ bashref.html: $(BASHREF_FILES) $(HSUSER)
298
298
-
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
299
299
-
300
300
-
bash.info: bashref.info
301
301
-
- ${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \
302
302
-
+ ${SHELL} ${INFOPOST} < bashref.info > $@ ; \
303
303
-
304
304
-
bash.txt: bash.1
305
305
-
bash.ps: bash.1
306
306
-
@@ -237,9 +237,9 @@ install: info installdirs bash.info
307
307
-
-$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext}
308
308
-
-$(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir)
309
309
-
# uncomment the next lines to install the builtins man page
310
310
-
-# sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
311
311
-
-# -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
312
312
-
-# -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
313
313
-
+ sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
314
314
-
+ -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
315
315
-
+ -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
316
316
-
-if test -f bash.info; then d=.; else d=$(srcdir); fi; \
317
317
-
$(INSTALL_DATA) $$d/bash.info $(DESTDIR)$(infodir)/bash.info
318
318
-
# run install-info if it is present to update the info directory
319
319
-
--- doc/bash.1 2014-02-06 07:03:52.000000000 -0700
320
320
-
+++ doc/bash.1 2015-02-06 17:14:11.015662800 -0700
321
321
-
@@ -1658,6 +1658,14 @@ subsequently reset.
322
322
-
Expands to the effective user ID of the current user, initialized at
323
323
-
shell startup. This variable is readonly.
324
324
-
.TP
325
325
-
+.B EXECIGNORE
326
326
-
+A colon-separated list of extended glob (see \fBPattern Matching\fP)
327
327
-
+patterns. Files with full paths matching one of these patterns are
328
328
-
+not considered executable for the purposes of completion and PATH
329
329
-
+searching, but the \fB[\fP, \fB[[\fP, and \fBtest\fP builtins are not
330
330
-
+affected. Use this variable to deal with systems that set the
331
331
-
+executable bit on files that are not actually executable.
332
332
-
+.TP
333
333
-
.B FUNCNAME
334
334
-
An array variable containing the names of all shell functions
335
335
-
currently in the execution call stack.
336
336
-
@@ -3308,6 +3316,10 @@ the character
337
337
-
.B ``.''
338
338
-
at the start of a name or immediately following a slash
339
339
-
must be matched explicitly, unless the shell option
340
340
-
+.B completion_strip_exe
341
341
-
+If set, whenever bash sees `foo.exe' during completion, it checks if
342
342
-
+`foo' is the same file and strips the suffix.
343
343
-
+.TP 8
344
344
-
.B dotglob
345
345
-
is set.
346
346
-
When matching a pathname, the slash character must always be
347
347
-
--- doc/bashref.texi 2014-02-22 11:20:36.000000000 -0700
348
348
-
+++ doc/bashref.texi 2015-02-06 17:14:11.015662800 -0700
349
349
-
@@ -4992,6 +4992,10 @@ filenames.
350
350
-
This variable is set by default, which is the default Bash behavior in
351
351
-
versions through 4.2.
352
352
-
353
353
-
+@item completion_strip_exe
354
354
-
+If set, whenever bash sees `foo.exe' during completion, it checks if
355
355
-
+`foo' is the same file and strips the suffix.
356
356
-
+
357
357
-
@item direxpand
358
358
-
If set, Bash
359
359
-
replaces directory names with the results of word expansion when performing
360
360
-
@@ -5578,6 +5582,14 @@ Similar to @code{BASH_ENV}; used when th
361
361
-
The numeric effective user id of the current user. This variable
362
362
-
is readonly.
363
363
-
364
364
-
+@item EXECIGNORE
365
365
-
+A colon-separated list of extended glob ((@pxref{Pattern Matching})
366
366
-
+patterns. Files with full paths matching one of these patterns are
367
367
-
+not considered executable for the purposes of completion and PATH
368
368
-
+searching, but the @code{[}, @code{[[}, and @code{test} builtins are
369
369
-
+not affected. Use this variable to deal with systems that set the
370
370
-
+executable bit on files that are not actually executable.
371
371
-
+
372
372
-
@item FCEDIT
373
373
-
The editor used as a default by the @option{-e} option to the @code{fc}
374
374
-
builtin command.
375
375
-
--- doc/builtins.1 2012-02-21 12:32:05.000000000 -0700
376
376
-
+++ doc/builtins.1 2015-02-06 17:14:11.031260100 -0700
377
377
-
@@ -19,6 +19,6 @@ shift, shopt, source, suspend, test, tim
378
378
-
ulimit, umask, unalias, unset, wait \- bash built-in commands, see \fBbash\fR(1)
379
379
-
.SH BASH BUILTIN COMMANDS
380
380
-
.nr zZ 1
381
381
-
-.so bash.1
382
382
-
+.so man1/bash.1
383
383
-
.SH SEE ALSO
384
384
-
bash(1), sh(1)
385
385
-
--- execute_cmd.c 2015-02-06 17:12:55.261573700 -0700
386
386
-
+++ execute_cmd.c 2015-02-06 17:14:11.031260100 -0700
387
387
-
@@ -58,6 +58,7 @@ extern int errno;
388
388
-
#endif
389
389
-
390
390
-
#define NEED_FPURGE_DECL
391
391
-
+#define NEED_SH_SETLINEBUF_DECL /* used in externs.h */
392
392
-
393
393
-
#include "bashansi.h"
394
394
-
#include "bashintl.h"
395
395
-
--- expr.c 2014-01-03 06:55:00.000000000 -0700
396
396
-
+++ expr.c 2015-02-06 17:14:11.031260100 -0700
397
397
-
@@ -83,6 +83,7 @@
398
398
-
399
399
-
#include "shell.h"
400
400
-
#include "typemax.h" /* INTMAX_MAX, INTMAX_MIN */
401
401
-
+#define exp2 exp2_
402
402
-
403
403
-
/* Because of the $((...)) construct, expressions may include newlines.
404
404
-
Here is a macro which accepts newlines, tabs and spaces as whitespace. */
405
405
-
--- findcmd.c 2012-10-15 05:45:04.000000000 -0600
406
406
-
+++ findcmd.c 2015-02-06 17:14:11.031260100 -0700
407
407
-
@@ -48,6 +48,8 @@
408
408
-
extern int errno;
409
409
-
#endif
410
410
-
411
411
-
+#include <glob/strmatch.h>
412
412
-
+
413
413
-
extern int posixly_correct;
414
414
-
extern int last_command_exit_value;
415
415
-
416
416
-
@@ -77,6 +79,38 @@ int check_hashed_filenames;
417
417
-
containing the file of interest. */
418
418
-
int dot_found_in_search = 0;
419
419
-
420
420
-
+static struct ignorevar execignore =
421
421
-
+{
422
422
-
+ "EXECIGNORE",
423
423
-
+ (struct ign *)0,
424
424
-
+ 0,
425
425
-
+ (char *)0,
426
426
-
+ (sh_iv_item_func_t *)0,
427
427
-
+};
428
428
-
+
429
429
-
+void
430
430
-
+setup_exec_ignore (char *varname)
431
431
-
+{
432
432
-
+ setup_ignore_patterns (&execignore);
433
433
-
+}
434
434
-
+
435
435
-
+/* Return whether we should never consider file executable
436
436
-
+ * even if the system tells us it is. */
437
437
-
+static int
438
438
-
+is_on_exec_blacklist (char *name)
439
439
-
+{
440
440
-
+ struct ign *p;
441
441
-
+ int flags = FNM_EXTMATCH | FNM_CASEFOLD;
442
442
-
+
443
443
-
+ for (p = execignore.ignores; p && p->val; p++)
444
444
-
+ {
445
445
-
+ if (strmatch (p->val, (char *)name, flags) != FNM_NOMATCH)
446
446
-
+ return (1);
447
447
-
+ }
448
448
-
+
449
449
-
+ return (0);
450
450
-
+}
451
451
-
+
452
452
-
/* Return some flags based on information about this file.
453
453
-
The EXISTS bit is non-zero if the file is found.
454
454
-
The EXECABLE bit is non-zero the file is executble.
455
455
-
@@ -104,7 +138,7 @@ file_status (name)
456
456
-
file access mechanisms into account. eaccess uses the effective
457
457
-
user and group IDs, not the real ones. We could use sh_eaccess,
458
458
-
but we don't want any special treatment for /dev/fd. */
459
459
-
- if (eaccess (name, X_OK) == 0)
460
460
-
+ if (!is_on_exec_blacklist (name) && eaccess (name, X_OK) == 0)
461
461
-
r |= FS_EXECABLE;
462
462
-
if (eaccess (name, R_OK) == 0)
463
463
-
r |= FS_READABLE;
464
464
-
--- findcmd.h 2012-01-14 16:56:25.000000000 -0700
465
465
-
+++ findcmd.h 2015-02-06 17:14:11.031260100 -0700
466
466
-
@@ -31,5 +31,6 @@ extern char *find_user_command __P((cons
467
467
-
extern char *find_path_file __P((const char *));
468
468
-
extern char *search_for_command __P((const char *, int));
469
469
-
extern char *user_command_matches __P((const char *, int, int));
470
470
-
+extern void setup_exec_ignore __P((char *));
471
471
-
472
472
-
#endif /* _FINDCMD_H_ */
473
473
-
--- general.c 2014-01-30 14:46:15.000000000 -0700
474
474
-
+++ general.c 2015-02-06 17:14:11.031260100 -0700
475
475
-
@@ -44,6 +44,10 @@
476
476
-
477
477
-
#include <tilde/tilde.h>
478
478
-
479
479
-
+#ifdef __CYGWIN__
480
480
-
+# include <sys/cygwin.h>
481
481
-
+#endif
482
482
-
+
483
483
-
#if !defined (errno)
484
484
-
extern int errno;
485
485
-
#endif /* !errno */
486
486
-
@@ -632,7 +636,8 @@ make_absolute (string, dot_path)
487
487
-
{
488
488
-
char pathbuf[PATH_MAX + 1];
489
489
-
490
490
-
- cygwin_conv_to_full_posix_path (string, pathbuf);
491
491
-
+ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, string, pathbuf,
492
492
-
+ sizeof pathbuf);
493
493
-
result = savestring (pathbuf);
494
494
-
}
495
495
-
#else
496
496
-
--- include/chartypes.h 2011-04-11 12:30:52.000000000 -0600
497
497
-
+++ include/chartypes.h 2015-02-06 17:14:11.031260100 -0700
498
498
-
@@ -40,6 +40,7 @@
499
499
-
#else
500
500
-
# define IN_CTYPE_DOMAIN(c) isascii(c)
501
501
-
#endif
502
502
-
+#define to_uchar(c) ((unsigned char)(c))
503
503
-
504
504
-
#if !defined (isspace) && !defined (HAVE_ISSPACE)
505
505
-
# define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\f')
506
506
-
@@ -67,16 +68,16 @@
507
507
-
508
508
-
#undef ISPRINT
509
509
-
510
510
-
-#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
511
511
-
-#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
512
512
-
-#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
513
513
-
-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
514
514
-
-#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c))
515
515
-
-#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
516
516
-
-#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (c))
517
517
-
-#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
518
518
-
-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
519
519
-
-#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
520
520
-
+#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (to_uchar (c)))
521
521
-
+#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (to_uchar (c)))
522
522
-
+#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (to_uchar (c)))
523
523
-
+#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (to_uchar (c)))
524
524
-
+#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (to_uchar (c)))
525
525
-
+#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (to_uchar (c)))
526
526
-
+#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (to_uchar (c)))
527
527
-
+#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (to_uchar (c)))
528
528
-
+#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (to_uchar (c)))
529
529
-
+#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (to_uchar (c)))
530
530
-
531
531
-
#define ISLETTER(c) (ISALPHA(c))
532
532
-
533
533
-
--- include/posixjmp.h 2012-12-23 20:20:50.000000000 -0700
534
534
-
+++ include/posixjmp.h 2015-02-06 17:14:11.031260100 -0700
535
535
-
@@ -27,13 +27,13 @@
536
536
-
537
537
-
#if defined (HAVE_POSIX_SIGSETJMP)
538
538
-
# define procenv_t sigjmp_buf
539
539
-
-# if !defined (__OPENNT)
540
540
-
+# if !defined (__OPENNT) && !defined __CYGWIN__
541
541
-
# undef setjmp
542
542
-
# define setjmp(x) sigsetjmp((x), 1)
543
543
-
-# define setjmp_nosigs(x) sigsetjmp((x), 0)
544
544
-
# undef longjmp
545
545
-
# define longjmp(x, n) siglongjmp((x), (n))
546
546
-
# endif /* !__OPENNT */
547
547
-
+# define setjmp_nosigs(x) sigsetjmp((x), 0)
548
548
-
#else
549
549
-
# define procenv_t jmp_buf
550
550
-
# define setjmp_nosigs setjmp
551
551
-
--- input.c 2014-02-07 07:13:08.000000000 -0700
552
552
-
+++ input.c 2015-02-06 17:14:11.031260100 -0700
553
553
-
@@ -44,6 +44,10 @@
554
554
-
#include "quit.h"
555
555
-
#include "trap.h"
556
556
-
557
557
-
+#if __CYGWIN__
558
558
-
+int igncr;
559
559
-
+#endif
560
560
-
+
561
561
-
#if !defined (errno)
562
562
-
extern int errno;
563
563
-
#endif /* !errno */
564
564
-
@@ -561,6 +565,19 @@ buffered_getchar ()
565
565
-
{
566
566
-
CHECK_TERMSIG;
567
567
-
568
568
-
+#if __CYGWIN__
569
569
-
+ /* shopt igncr means to discard carriage returns from input stream.
570
570
-
+ If cr is the only character in the buffer, then recurse to pick
571
571
-
+ up the next character; otherwise flatten the buffer. */
572
572
-
+ if (igncr)
573
573
-
+ {
574
574
-
+ int ch;
575
575
-
+ while ((ch = bufstream_getc (buffers[bash_input.location.buffered_fd]))
576
576
-
+ == '\r')
577
577
-
+ ;
578
578
-
+ return ch;
579
579
-
+ }
580
580
-
+#endif /* __CYGWIN__ */
581
581
-
#if !defined (DJGPP)
582
582
-
return (bufstream_getc (buffers[bash_input.location.buffered_fd]));
583
583
-
#else
584
584
-
--- lib/readline/bind.c 2013-04-06 15:46:38.000000000 -0600
585
585
-
+++ lib/readline/bind.c 2015-02-06 17:14:11.031260100 -0700
586
586
-
@@ -452,7 +452,7 @@ rl_translate_keyseq (seq, array, len)
587
587
-
{
588
588
-
register int i, c, l, temp;
589
589
-
590
590
-
- for (i = l = 0; c = seq[i]; i++)
591
591
-
+ for (i = l = 0; (c = seq[i]); i++)
592
592
-
{
593
593
-
if (c == '\\')
594
594
-
{
595
595
-
@@ -1210,7 +1210,7 @@ _rl_skip_to_delim (string, start, delim)
596
596
-
{
597
597
-
int i, c, passc;
598
598
-
599
599
-
- for (i = start,passc = 0; c = string[i]; i++)
600
600
-
+ for (i = start,passc = 0; (c = string[i]); i++)
601
601
-
{
602
602
-
if (passc)
603
603
-
{
604
604
-
@@ -1297,7 +1297,6 @@ rl_parse_and_bind (string)
605
605
-
if (_rl_stricmp (string, "set") == 0)
606
606
-
{
607
607
-
char *var, *value, *e;
608
608
-
- int s;
609
609
-
610
610
-
var = string + i;
611
611
-
/* Make VAR point to start of variable name. */
612
612
-
@@ -2198,7 +2197,7 @@ rl_function_dumper (print_readably)
613
613
-
614
614
-
fprintf (rl_outstream, "\n");
615
615
-
616
616
-
- for (i = 0; name = names[i]; i++)
617
617
-
+ for (i = 0; (name = names[i]); i++)
618
618
-
{
619
619
-
rl_command_func_t *function;
620
620
-
char **invokers;
621
621
-
--- lib/readline/chardefs.h 2011-07-25 19:47:56.000000000 -0600
622
622
-
+++ lib/readline/chardefs.h 2015-02-06 17:14:11.046889800 -0700
623
623
-
@@ -71,6 +71,7 @@
624
624
-
#else
625
625
-
# define IN_CTYPE_DOMAIN(c) isascii(c)
626
626
-
#endif
627
627
-
+#define to_uchar(c) ((unsigned char)(c))
628
628
-
629
629
-
#if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) && !defined (__cplusplus)
630
630
-
# define isxdigit(c) (isdigit((c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
631
631
-
@@ -87,13 +88,13 @@
632
632
-
633
633
-
/* Beware: these only work with single-byte ASCII characters. */
634
634
-
635
635
-
-#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
636
636
-
-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
637
637
-
-#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
638
638
-
-#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
639
639
-
-#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
640
640
-
-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
641
641
-
-#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
642
642
-
+#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (to_uchar (c)))
643
643
-
+#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (to_uchar (c)))
644
644
-
+#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (to_uchar (c)))
645
645
-
+#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (to_uchar (c)))
646
646
-
+#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (to_uchar (c)))
647
647
-
+#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (to_uchar (c)))
648
648
-
+#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (to_uchar (c)))
649
649
-
650
650
-
#define _rl_lowercase_p(c) (NON_NEGATIVE(c) && ISLOWER(c))
651
651
-
#define _rl_uppercase_p(c) (NON_NEGATIVE(c) && ISUPPER(c))
652
652
-
--- lib/readline/complete.c 2013-10-14 07:27:10.000000000 -0600
653
653
-
+++ lib/readline/complete.c 2015-02-06 17:14:11.046889800 -0700
654
654
-
@@ -1082,7 +1082,7 @@ _rl_find_completion_word (fp, dp)
655
655
-
/* We didn't find an unclosed quoted substring upon which to do
656
656
-
completion, so use the word break characters to find the
657
657
-
substring on which to complete. */
658
658
-
- while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))
659
659
-
+ while ((rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)))
660
660
-
{
661
661
-
scan = rl_line_buffer[rl_point];
662
662
-
663
663
-
@@ -2116,7 +2116,7 @@ rl_completion_matches (text, entry_funct
664
664
-
match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
665
665
-
match_list[1] = (char *)NULL;
666
666
-
667
667
-
- while (string = (*entry_function) (text, matches))
668
668
-
+ while ((string = (*entry_function) (text, matches)))
669
669
-
{
670
670
-
if (RL_SIG_RECEIVED ())
671
671
-
{
672
672
-
@@ -2190,7 +2190,7 @@ rl_username_completion_function (text, s
673
673
-
}
674
674
-
675
675
-
#if defined (HAVE_GETPWENT)
676
676
-
- while (entry = getpwent ())
677
677
-
+ while ((entry = getpwent ()))
678
678
-
{
679
679
-
/* Null usernames should result in all users as possible completions. */
680
680
-
if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
681
681
-
@@ -2723,7 +2723,7 @@ rl_menu_complete (count, ignore)
682
682
-
static int full_completion = 0; /* set to 1 if menu completion should reinitialize on next call */
683
683
-
static int orig_start, orig_end;
684
684
-
static char quote_char;
685
685
-
- static int delimiter, cstate;
686
686
-
+ static int delimiter;
687
687
-
688
688
-
/* The first time through, we generate the list of matches and set things
689
689
-
up to insert them. */
690
690
-
--- lib/readline/display.c 2015-02-06 17:12:54.793574600 -0700
691
691
-
+++ lib/readline/display.c 2015-02-06 17:14:11.046889800 -0700
692
692
-
@@ -66,7 +66,6 @@ extern char *strchr (), *strrchr ();
693
693
-
static void update_line PARAMS((char *, char *, int, int, int, int));
694
694
-
static void space_to_eol PARAMS((int));
695
695
-
static void delete_chars PARAMS((int));
696
696
-
-static void insert_some_chars PARAMS((char *, int, int));
697
697
-
static void open_some_spaces PARAMS((int));
698
698
-
static void cr PARAMS((void));
699
699
-
700
700
-
@@ -1314,7 +1313,7 @@ update_line (old, new, current_line, oma
701
701
-
int current_line, omax, nmax, inv_botlin;
702
702
-
{
703
703
-
register char *ofd, *ols, *oe, *nfd, *nls, *ne;
704
704
-
- int temp, lendiff, wsatend, od, nd, twidth, o_cpos;
705
705
-
+ int temp, lendiff, wsatend, od, nd, o_cpos;
706
706
-
int current_invis_chars;
707
707
-
int col_lendiff, col_temp;
708
708
-
int bytes_to_insert;
709
709
-
@@ -2485,6 +2484,7 @@ _rl_clear_screen ()
710
710
-
#endif /* __DJGPP__ */
711
711
-
}
712
712
-
713
713
-
+#if 0
714
714
-
/* Insert COUNT characters from STRING to the output stream at column COL. */
715
715
-
static void
716
716
-
insert_some_chars (string, count, col)
717
717
-
@@ -2494,6 +2494,7 @@ insert_some_chars (string, count, col)
718
718
-
open_some_spaces (col);
719
719
-
_rl_output_some_chars (string, count);
720
720
-
}
721
721
-
+#endif
722
722
-
723
723
-
/* Insert COL spaces, keeping the cursor at the same position. We follow the
724
724
-
ncurses documentation and use either im/ei with explicit spaces, or IC/ic
725
725
-
--- lib/readline/histexpand.c 2013-12-02 07:22:30.000000000 -0700
726
726
-
+++ lib/readline/histexpand.c 2015-02-06 17:14:11.046889800 -0700
727
727
-
@@ -204,7 +204,7 @@ get_history_event (string, caller_index,
728
728
-
}
729
729
-
730
730
-
/* Only a closing `?' or a newline delimit a substring search string. */
731
731
-
- for (local_index = i; c = string[i]; i++)
732
732
-
+ for (local_index = i; (c = string[i]); i++)
733
733
-
{
734
734
-
#if defined (HANDLE_MULTIBYTE)
735
735
-
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
736
736
-
@@ -677,7 +677,7 @@ history_expand_internal (string, start,
737
737
-
case 's':
738
738
-
{
739
739
-
char *new_event;
740
740
-
- int delimiter, failed, si, l_temp, ws, we;
741
741
-
+ int delimiter, failed, si, l_temp, we;
742
742
-
743
743
-
if (c == 's')
744
744
-
{
745
745
-
@@ -776,7 +776,6 @@ history_expand_internal (string, start,
746
746
-
{
747
747
-
for (; temp[si] && whitespace (temp[si]); si++)
748
748
-
;
749
749
-
- ws = si;
750
750
-
we = history_tokenize_word (temp, si);
751
751
-
}
752
752
-
753
753
-
--- lib/readline/histfile.c 2013-07-19 06:17:17.000000000 -0600
754
754
-
+++ lib/readline/histfile.c 2015-02-06 17:14:11.046889800 -0700
755
755
-
@@ -104,7 +104,7 @@ int history_write_timestamps = 0;
756
756
-
757
757
-
/* Does S look like the beginning of a history timestamp entry? Placeholder
758
758
-
for more extensive tests. */
759
759
-
-#define HIST_TIMESTAMP_START(s) (*(s) == history_comment_char && isdigit ((s)[1]) )
760
760
-
+#define HIST_TIMESTAMP_START(s) (*(s) == history_comment_char && isdigit ((unsigned char) (s)[1]) )
761
761
-
762
762
-
/* Return the string that should be used in the place of this
763
763
-
filename. This only matters when you don't specify the
764
764
-
--- lib/readline/input.c 2015-02-06 17:12:55.027577800 -0700
765
765
-
+++ lib/readline/input.c 2015-02-06 17:14:11.046889800 -0700
766
766
-
@@ -431,7 +431,7 @@ rl_read_key ()
767
767
-
else
768
768
-
{
769
769
-
/* If input is coming from a macro, then use that. */
770
770
-
- if (c = _rl_next_macro_key ())
771
771
-
+ if ((c = _rl_next_macro_key ()))
772
772
-
return (c);
773
773
-
774
774
-
/* If the user has an event function, then call it periodically. */
775
775
-
--- lib/readline/isearch.c 2013-10-14 07:08:40.000000000 -0600
776
776
-
+++ lib/readline/isearch.c 2015-02-06 17:14:11.046889800 -0700
777
777
-
@@ -740,7 +740,7 @@ rl_search_history (direction, invoking_k
778
778
-
int direction, invoking_key;
779
779
-
{
780
780
-
_rl_search_cxt *cxt; /* local for now, but saved globally */
781
781
-
- int c, r;
782
782
-
+ int r;
783
783
-
784
784
-
RL_SETSTATE(RL_STATE_ISEARCH);
785
785
-
cxt = _rl_isearch_init (direction);
786
786
-
@@ -755,7 +755,7 @@ rl_search_history (direction, invoking_k
787
787
-
r = -1;
788
788
-
for (;;)
789
789
-
{
790
790
-
- c = _rl_search_getchar (cxt);
791
791
-
+ _rl_search_getchar (cxt);
792
792
-
/* We might want to handle EOF here (c == 0) */
793
793
-
r = _rl_isearch_dispatch (cxt, cxt->lastc);
794
794
-
if (r <= 0)
795
795
-
@@ -778,9 +778,9 @@ int
796
796
-
_rl_isearch_callback (cxt)
797
797
-
_rl_search_cxt *cxt;
798
798
-
{
799
799
-
- int c, r;
800
800
-
+ int r;
801
801
-
802
802
-
- c = _rl_search_getchar (cxt);
803
803
-
+ _rl_search_getchar (cxt);
804
804
-
/* We might want to handle EOF here */
805
805
-
r = _rl_isearch_dispatch (cxt, cxt->lastc);
806
806
-
807
807
-
--- lib/readline/misc.c 2015-02-06 17:12:55.230384200 -0700
808
808
-
+++ lib/readline/misc.c 2015-02-06 17:14:11.046889800 -0700
809
809
-
@@ -455,7 +455,7 @@ _rl_revert_all_lines ()
810
810
-
entry = (hpos == history_length) ? previous_history () : current_history ();
811
811
-
while (entry)
812
812
-
{
813
813
-
- if (ul = (UNDO_LIST *)entry->data)
814
814
-
+ if ((ul = (UNDO_LIST *)entry->data))
815
815
-
{
816
816
-
if (ul == saved_undo_list)
817
817
-
saved_undo_list = 0;
818
818
-
@@ -502,7 +502,7 @@ rl_clear_history ()
819
819
-
for (i = 0; i < history_length; i++)
820
820
-
{
821
821
-
hent = hlist[i];
822
822
-
- if (ul = (UNDO_LIST *)hent->data)
823
823
-
+ if ((ul = (UNDO_LIST *)hent->data))
824
824
-
{
825
825
-
if (ul == saved_undo_list)
826
826
-
saved_undo_list = 0;
827
827
-
--- lib/readline/nls.c 2013-03-09 12:51:10.000000000 -0700
828
828
-
+++ lib/readline/nls.c 2015-02-06 17:14:11.046889800 -0700
829
829
-
@@ -80,7 +80,7 @@ static char *legal_lang_values[] =
830
830
-
static char *normalize_codeset PARAMS((char *));
831
831
-
#endif /* !HAVE_SETLOCALE */
832
832
-
833
833
-
-static char *find_codeset PARAMS((char *, size_t *));
834
834
-
+static char *find_codeset PARAMS((char *, size_t *)) __attribute__ ((__unused__));
835
835
-
836
836
-
static char *_rl_get_locale_var PARAMS((const char *));
837
837
-
838
838
-
@@ -104,12 +104,13 @@ utf8locale (lspec)
839
839
-
char *lspec;
840
840
-
{
841
841
-
char *cp;
842
842
-
- size_t len;
843
843
-
844
844
-
#if HAVE_LANGINFO_CODESET
845
845
-
cp = nl_langinfo (CODESET);
846
846
-
return (STREQ (cp, "UTF-8") || STREQ (cp, "utf8"));
847
847
-
#else
848
848
-
+ size_t len;
849
849
-
+
850
850
-
cp = find_codeset (lspec, &len);
851
851
-
852
852
-
if (cp == 0 || len < 4 || len > 5)
853
853
-
--- lib/readline/parens.c 2009-04-19 11:12:06.000000000 -0600
854
854
-
+++ lib/readline/parens.c 2015-02-06 17:14:11.046889800 -0700
855
855
-
@@ -106,7 +106,7 @@ rl_insert_close (count, invoking_key)
856
856
-
else
857
857
-
{
858
858
-
#if defined (HAVE_SELECT)
859
859
-
- int orig_point, match_point, ready;
860
860
-
+ int orig_point, match_point;
861
861
-
struct timeval timer;
862
862
-
fd_set readfds;
863
863
-
864
864
-
@@ -126,7 +126,7 @@ rl_insert_close (count, invoking_key)
865
865
-
orig_point = rl_point;
866
866
-
rl_point = match_point;
867
867
-
(*rl_redisplay_function) ();
868
868
-
- ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
869
869
-
+ select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
870
870
-
rl_point = orig_point;
871
871
-
#else /* !HAVE_SELECT */
872
872
-
_rl_insert_char (count, invoking_key);
873
873
-
--- lib/readline/posixjmp.h 2012-12-23 20:20:50.000000000 -0700
874
874
-
+++ lib/readline/posixjmp.h 2015-02-06 17:14:11.046889800 -0700
875
875
-
@@ -27,13 +27,13 @@
876
876
-
877
877
-
#if defined (HAVE_POSIX_SIGSETJMP)
878
878
-
# define procenv_t sigjmp_buf
879
879
-
-# if !defined (__OPENNT)
880
880
-
+# if !defined (__OPENNT) && !defined __CYGWIN__
881
881
-
# undef setjmp
882
882
-
# define setjmp(x) sigsetjmp((x), 1)
883
883
-
-# define setjmp_nosigs(x) sigsetjmp((x), 0)
884
884
-
# undef longjmp
885
885
-
# define longjmp(x, n) siglongjmp((x), (n))
886
886
-
# endif /* !__OPENNT */
887
887
-
+# define setjmp_nosigs(x) sigsetjmp((x), 0)
888
888
-
#else
889
889
-
# define procenv_t jmp_buf
890
890
-
# define setjmp_nosigs setjmp
891
891
-
--- lib/readline/readline.c 2015-02-06 17:12:54.310964200 -0700
892
892
-
+++ lib/readline/readline.c 2015-02-06 17:14:11.046889800 -0700
893
893
-
@@ -95,7 +95,7 @@ static void bind_arrow_keys_internal PAR
894
894
-
static void bind_arrow_keys PARAMS((void));
895
895
-
896
896
-
static void readline_default_bindings PARAMS((void));
897
897
-
-static void reset_default_bindings PARAMS((void));
898
898
-
+//static void reset_default_bindings PARAMS((void));
899
899
-
900
900
-
static int _rl_subseq_result PARAMS((int, Keymap, int, int));
901
901
-
static int _rl_subseq_getchar PARAMS((int));
902
902
-
@@ -522,7 +522,7 @@ readline_internal_char ()
903
903
-
readline_internal_charloop ()
904
904
-
#endif
905
905
-
{
906
906
-
- static int lastc, eof_found;
907
907
-
+ static int lastc, eof_found __attribute__((unused));
908
908
-
int c, code, lk;
909
909
-
910
910
-
lastc = -1;
911
911
-
@@ -1204,6 +1204,7 @@ readline_default_bindings ()
912
912
-
rl_tty_set_default_bindings (_rl_keymap);
913
913
-
}
914
914
-
915
915
-
+#if 0
916
916
-
/* Reset the default bindings for the terminal special characters we're
917
917
-
interested in back to rl_insert and read the new ones. */
918
918
-
static void
919
919
-
@@ -1215,6 +1216,7 @@ reset_default_bindings ()
920
920
-
rl_tty_set_default_bindings (_rl_keymap);
921
921
-
}
922
922
-
}
923
923
-
+#endif
924
924
-
925
925
-
/* Bind some common arrow key sequences in MAP. */
926
926
-
static void
927
927
-
--- lib/readline/rltty.c 2013-08-25 14:57:05.000000000 -0600
928
928
-
+++ lib/readline/rltty.c 2015-02-06 17:14:11.062454900 -0700
929
929
-
@@ -30,6 +30,7 @@
930
930
-
#include <signal.h>
931
931
-
#include <errno.h>
932
932
-
#include <stdio.h>
933
933
-
+#include <sys/ioctl.h>
934
934
-
935
935
-
#if defined (HAVE_UNISTD_H)
936
936
-
# include <unistd.h>
937
937
-
--- lib/readline/shell.c 2013-03-13 08:17:00.000000000 -0600
938
938
-
+++ lib/readline/shell.c 2015-02-06 17:14:11.062454900 -0700
939
939
-
@@ -123,8 +123,10 @@ sh_single_quote (string)
940
940
-
/* Set the environment variables LINES and COLUMNS to lines and cols,
941
941
-
respectively. */
942
942
-
static char setenv_buf[INT_STRLEN_BOUND (int) + 1];
943
943
-
+# if !defined (HAVE_SETENV) && defined (HAVE_PUTENV)
944
944
-
static char putenv_buf1[INT_STRLEN_BOUND (int) + 6 + 1]; /* sizeof("LINES=") == 6 */
945
945
-
static char putenv_buf2[INT_STRLEN_BOUND (int) + 8 + 1]; /* sizeof("COLUMNS=") == 8 */
946
946
-
+# endif
947
947
-
948
948
-
void
949
949
-
sh_set_lines_and_columns (lines, cols)
950
950
-
--- lib/readline/signals.c 2014-01-10 13:06:48.000000000 -0700
951
951
-
+++ lib/readline/signals.c 2015-02-06 17:14:11.062454900 -0700
952
952
-
@@ -576,7 +576,6 @@ rl_free_line_state ()
953
953
-
/* **************************************************************** */
954
954
-
955
955
-
#if defined (HAVE_POSIX_SIGNALS)
956
956
-
-static sigset_t sigint_set, sigint_oset;
957
957
-
static sigset_t sigwinch_set, sigwinch_oset;
958
958
-
#else /* !HAVE_POSIX_SIGNALS */
959
959
-
# if defined (HAVE_BSD_SIGNALS)
960
960
-
--- lib/readline/terminal.c 2013-09-18 07:12:01.000000000 -0600
961
961
-
+++ lib/readline/terminal.c 2015-02-06 17:14:11.062454900 -0700
962
962
-
@@ -31,6 +31,7 @@
963
963
-
#if defined (HAVE_SYS_FILE_H)
964
964
-
# include <sys/file.h>
965
965
-
#endif /* HAVE_SYS_FILE_H */
966
966
-
+#include <sys/ioctl.h>
967
967
-
968
968
-
#if defined (HAVE_UNISTD_H)
969
969
-
# include <unistd.h>
970
970
-
--- lib/readline/text.c 2013-10-14 07:25:05.000000000 -0600
971
971
-
+++ lib/readline/text.c 2015-02-06 17:14:11.062454900 -0700
972
972
-
@@ -859,11 +859,10 @@ _rl_overwrite_char (count, c)
973
973
-
int i;
974
974
-
#if defined (HANDLE_MULTIBYTE)
975
975
-
char mbkey[MB_LEN_MAX];
976
976
-
- int k;
977
977
-
978
978
-
/* Read an entire multibyte character sequence to insert COUNT times. */
979
979
-
if (count > 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0)
980
980
-
- k = _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
981
981
-
+ _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
982
982
-
#endif
983
983
-
984
984
-
rl_begin_undo_group ();
985
985
-
--- lib/readline/tilde.c 2010-07-25 15:42:13.000000000 -0600
986
986
-
+++ lib/readline/tilde.c 2015-02-06 17:14:11.062454900 -0700
987
987
-
@@ -196,7 +196,7 @@ tilde_expand (string)
988
988
-
int result_size, result_index;
989
989
-
990
990
-
result_index = result_size = 0;
991
991
-
- if (result = strchr (string, '~'))
992
992
-
+ if ((result = strchr (string, '~')))
993
993
-
result = (char *)xmalloc (result_size = (strlen (string) + 16));
994
994
-
else
995
995
-
result = (char *)xmalloc (result_size = (strlen (string) + 1));
996
996
-
--- lib/readline/undo.c 2014-02-02 13:47:46.000000000 -0700
997
997
-
+++ lib/readline/undo.c 2015-02-06 17:14:11.062454900 -0700
998
998
-
@@ -124,7 +124,7 @@ _rl_free_undo_list (ul)
999
999
-
void
1000
1000
-
rl_free_undo_list ()
1001
1001
-
{
1002
1002
-
- UNDO_LIST *release, *orig_list;
1003
1003
-
+ UNDO_LIST *orig_list;
1004
1004
-
1005
1005
-
orig_list = rl_undo_list;
1006
1006
-
_rl_free_undo_list (rl_undo_list);
1007
1007
-
--- lib/readline/vi_mode.c 2012-09-01 16:55:30.000000000 -0600
1008
1008
-
+++ lib/readline/vi_mode.c 2015-02-06 17:14:11.062454900 -0700
1009
1009
-
@@ -1089,7 +1089,7 @@ static int
1010
1010
-
rl_domove_motion_callback (m)
1011
1011
-
_rl_vimotion_cxt *m;
1012
1012
-
{
1013
1013
-
- int c, save, r;
1014
1014
-
+ int c, r;
1015
1015
-
int old_end;
1016
1016
-
1017
1017
-
_rl_vi_last_motion = c = m->motion;
1018
1018
-
@@ -1257,7 +1257,6 @@ int
1019
1019
-
rl_vi_domove (x, ignore)
1020
1020
-
int x, *ignore;
1021
1021
-
{
1022
1022
-
- int r;
1023
1023
-
_rl_vimotion_cxt *m;
1024
1024
-
1025
1025
-
m = _rl_vimvcxt;
1026
1026
-
--- lib/sh/pathphys.c 2013-05-28 13:33:58.000000000 -0600
1027
1027
-
+++ lib/sh/pathphys.c 2015-02-06 17:14:11.062454900 -0700
1028
1028
-
@@ -35,6 +35,7 @@
1029
1029
-
#include <stdio.h>
1030
1030
-
#include <chartypes.h>
1031
1031
-
#include <errno.h>
1032
1032
-
+#include <stdlib.h>
1033
1033
-
1034
1034
-
#include "shell.h"
1035
1035
-
1036
1036
-
@@ -76,6 +77,10 @@ sh_physpath (path, flags)
1037
1037
-
char *path;
1038
1038
-
int flags;
1039
1039
-
{
1040
1040
-
+#if __CYGWIN__
1041
1041
-
+ /* realpath does this correctly without all the hassle */
1042
1042
-
+ return realpath (path, NULL);
1043
1043
-
+#else
1044
1044
-
char tbuf[PATH_MAX+1], linkbuf[PATH_MAX+1];
1045
1045
-
char *result, *p, *q, *qsave, *qbase, *workpath;
1046
1046
-
int double_slash_path, linklen, nlink;
1047
1047
-
@@ -214,11 +219,7 @@ error:
1048
1048
-
{
1049
1049
-
q = result;
1050
1050
-
/* Duplicating some code here... */
1051
1051
-
-#if defined (__CYGWIN__)
1052
1052
-
- qbase = (ISALPHA((unsigned char)workpath[0]) && workpath[1] == ':') ? workpath + 3 : workpath + 1;
1053
1053
-
-#else
1054
1054
-
qbase = workpath + 1;
1055
1055
-
-#endif
1056
1056
-
double_slash_path = DOUBLE_SLASH (workpath);
1057
1057
-
qbase += double_slash_path;
1058
1058
-
1059
1059
-
@@ -249,6 +250,7 @@ error:
1060
1060
-
}
1061
1061
-
1062
1062
-
return (result);
1063
1063
-
+#endif /* ! __CYGWIN__ */
1064
1064
-
}
1065
1065
-
1066
1066
-
char *
1067
1067
-
--- lib/sh/tmpfile.c 2013-12-18 15:50:13.000000000 -0700
1068
1068
-
+++ lib/sh/tmpfile.c 2015-02-06 17:14:11.062454900 -0700
1069
1069
-
@@ -96,7 +96,7 @@ get_tmpdir (flags)
1070
1070
-
if (tdir && (file_iswdir (tdir) == 0 || strlen (tdir) > PATH_MAX))
1071
1071
-
tdir = 0;
1072
1072
-
1073
1073
-
- if (tdir == 0)
1074
1074
-
+ if (tdir == 0 || !file_iswdir (tdir))
1075
1075
-
tdir = get_sys_tmpdir ();
1076
1076
-
1077
1077
-
#if defined (HAVE_PATHCONF) && defined (_PC_NAME_MAX)
1078
1078
-
@@ -118,14 +118,15 @@ sh_mktmpname (nameroot, flags)
1079
1079
-
struct stat sb;
1080
1080
-
int r, tdlen;
1081
1081
-
1082
1082
-
- filename = (char *)xmalloc (PATH_MAX + 1);
1083
1083
-
+ filename = NULL;
1084
1084
-
tdir = get_tmpdir (flags);
1085
1085
-
tdlen = strlen (tdir);
1086
1086
-
1087
1087
-
lroot = nameroot ? nameroot : DEFAULT_NAMEROOT;
1088
1088
-
1089
1089
-
#ifdef USE_MKTEMP
1090
1090
-
- sprintf (filename, "%s/%s.XXXXXX", tdir, lroot);
1091
1091
-
+ if (asprintf (&filename, "%s/%s.XXXXXX", tdir, lroot) < 0)
1092
1092
-
+ return NULL;
1093
1093
-
if (mktemp (filename) == 0)
1094
1094
-
{
1095
1095
-
free (filename);
1096
1096
-
@@ -138,7 +139,9 @@ sh_mktmpname (nameroot, flags)
1097
1097
-
(unsigned long) time ((time_t *)0) ^
1098
1098
-
(unsigned long) dollar_dollar_pid ^
1099
1099
-
(unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
1100
1100
-
- sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
1101
1101
-
+ free (filename);
1102
1102
-
+ if (asprintf (&filename, "%s/%s-%lu", tdir, lroot, filenum) < 0)
1103
1103
-
+ return NULL;
1104
1104
-
if (tmpnamelen > 0 && tmpnamelen < 32)
1105
1105
-
filename[tdlen + 1 + tmpnamelen] = '\0';
1106
1106
-
# ifdef HAVE_LSTAT
1107
1107
-
@@ -163,14 +166,19 @@ sh_mktmpfd (nameroot, flags, namep)
1108
1108
-
char *filename, *tdir, *lroot;
1109
1109
-
int fd, tdlen;
1110
1110
-
1111
1111
-
- filename = (char *)xmalloc (PATH_MAX + 1);
1112
1112
-
+ filename = NULL;
1113
1113
-
tdir = get_tmpdir (flags);
1114
1114
-
tdlen = strlen (tdir);
1115
1115
-
1116
1116
-
lroot = nameroot ? nameroot : DEFAULT_NAMEROOT;
1117
1117
-
1118
1118
-
#ifdef USE_MKSTEMP
1119
1119
-
- sprintf (filename, "%s/%s.XXXXXX", tdir, lroot);
1120
1120
-
+ if (asprintf (&filename, "%s/%s.XXXXXX", tdir, lroot) < 0)
1121
1121
-
+ {
1122
1122
-
+ if (namep)
1123
1123
-
+ *namep = NULL;
1124
1124
-
+ return -1;
1125
1125
-
+ }
1126
1126
-
fd = mkstemp (filename);
1127
1127
-
if (fd < 0 || namep == 0)
1128
1128
-
{
1129
1129
-
@@ -187,7 +195,13 @@ sh_mktmpfd (nameroot, flags, namep)
1130
1130
-
(unsigned long) time ((time_t *)0) ^
1131
1131
-
(unsigned long) dollar_dollar_pid ^
1132
1132
-
(unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
1133
1133
-
- sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
1134
1134
-
+ free (filename);
1135
1135
-
+ if (asprintf (&filename, "%s/%s-%lu", tdir, lroot, filenum) < 0)
1136
1136
-
+ {
1137
1137
-
+ if (namep)
1138
1138
-
+ *namep = NULL;
1139
1139
-
+ return -1;
1140
1140
-
+ }
1141
1141
-
if (tmpnamelen > 0 && tmpnamelen < 32)
1142
1142
-
filename[tdlen + 1 + tmpnamelen] = '\0';
1143
1143
-
fd = open (filename, BASEOPENFLAGS | ((flags & MT_READWRITE) ? O_RDWR : O_WRONLY), 0600);
1144
1144
-
--- mksyntax.c 2012-07-29 17:48:38.000000000 -0600
1145
1145
-
+++ mksyntax.c 2015-02-06 17:14:11.062454900 -0700
1146
1146
-
@@ -29,13 +29,13 @@
1147
1147
-
1148
1148
-
#ifdef HAVE_UNISTD_H
1149
1149
-
# include <unistd.h>
1150
1150
-
+#else
1151
1151
-
+extern int optind;
1152
1152
-
+extern char *optarg;
1153
1153
-
#endif
1154
1154
-
1155
1155
-
#include "syntax.h"
1156
1156
-
1157
1157
-
-extern int optind;
1158
1158
-
-extern char *optarg;
1159
1159
-
-
1160
1160
-
#ifndef errno
1161
1161
-
extern int errno;
1162
1162
-
#endif
1163
1163
-
--- parse.y 2015-02-06 17:12:55.682776800 -0700
1164
1164
-
+++ parse.y 2015-02-06 17:14:11.062454900 -0700
1165
1165
-
@@ -1531,14 +1531,20 @@ yy_string_get ()
1166
1166
-
string = bash_input.location.string;
1167
1167
-
1168
1168
-
/* If the string doesn't exist, or is empty, EOF found. */
1169
1169
-
- if (string && *string)
1170
1170
-
+ while (string && *string)
1171
1171
-
{
1172
1172
-
c = *string++;
1173
1173
-
bash_input.location.string = string;
1174
1174
-
+#if __CYGWIN__
1175
1175
-
+ {
1176
1176
-
+ extern int igncr;
1177
1177
-
+ if (igncr && c == '\r')
1178
1178
-
+ continue;
1179
1179
-
+ }
1180
1180
-
+#endif
1181
1181
-
return (c);
1182
1182
-
}
1183
1183
-
- else
1184
1184
-
- return (EOF);
1185
1185
-
+ return (EOF);
1186
1186
-
}
1187
1187
-
1188
1188
-
static int
1189
1189
-
@@ -2305,7 +2311,7 @@ shell_getc (remove_quoted_newline)
1190
1190
-
if (n <= 2) /* we have to save 1 for the newline added below */
1191
1191
-
{
1192
1192
-
if (truncating == 0)
1193
1193
-
- internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX);
1194
1194
-
+ internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%zu): line truncated", shell_input_line_size, SIZE_MAX);
1195
1195
-
shell_input_line[i] = '\0';
1196
1196
-
truncating = 1;
1197
1197
-
}
1198
1198
-
@@ -3582,7 +3588,6 @@ parse_comsub (qc, open, close, lenp, fla
1199
1199
-
1200
1200
-
while (count)
1201
1201
-
{
1202
1202
-
-comsub_readchar:
1203
1203
-
ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0);
1204
1204
-
1205
1205
-
if (ch == EOF)
1206
1206
-
--- pathexp.h 2009-01-04 12:32:40.000000000 -0700
1207
1207
-
+++ pathexp.h 2015-02-06 17:14:11.062454900 -0700
1208
1208
-
@@ -86,7 +86,7 @@ struct ign {
1209
1209
-
typedef int sh_iv_item_func_t __P((struct ign *));
1210
1210
-
1211
1211
-
struct ignorevar {
1212
1212
-
- char *varname; /* FIGNORE or GLOBIGNORE */
1213
1213
-
+ char *varname; /* FIGNORE or GLOBIGNORE or EXECIGNORE */
1214
1214
-
struct ign *ignores; /* Store the ignore strings here */
1215
1215
-
int num_ignores; /* How many are there? */
1216
1216
-
char *last_ignoreval; /* Last value of variable - cached for speed */
1217
1217
-
--- redir.c 2013-10-14 07:19:59.000000000 -0600
1218
1218
-
+++ redir.c 2015-02-06 17:14:11.078059300 -0700
1219
1219
-
@@ -156,7 +156,6 @@ redirection_error (temp, error)
1220
1220
-
#endif
1221
1221
-
else if (expandable_redirection_filename (temp))
1222
1222
-
{
1223
1223
-
-expandable_filename:
1224
1224
-
oflags = temp->redirectee.filename->flags;
1225
1225
-
if (posixly_correct && interactive_shell == 0)
1226
1226
-
temp->redirectee.filename->flags |= W_NOGLOB;
1227
1227
-
--- subst.c 2015-02-06 17:12:55.370841100 -0700
1228
1228
-
+++ subst.c 2015-02-06 17:14:11.078059300 -0700
1229
1229
-
@@ -41,6 +41,7 @@
1230
1230
-
#include "posixstat.h"
1231
1231
-
#include "bashintl.h"
1232
1232
-
1233
1233
-
+#define NEED_SH_SETLINEBUF_DECL /* used in externs.h */
1234
1234
-
#include "shell.h"
1235
1235
-
#include "parser.h"
1236
1236
-
#include "flags.h"
1237
1237
-
@@ -5268,6 +5269,13 @@ read_comsub (fd, quoted, rflag)
1238
1238
-
#endif
1239
1239
-
continue;
1240
1240
-
}
1241
1241
-
+#if __CYGWIN__
1242
1242
-
+ {
1243
1243
-
+ extern int igncr;
1244
1244
-
+ if (igncr && c == '\r')
1245
1245
-
+ continue;
1246
1246
-
+ }
1247
1247
-
+#endif /* __CYGWIN__ */
1248
1248
-
1249
1249
-
/* Add the character to ISTRING, possibly after resizing it. */
1250
1250
-
RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE);
1251
1251
-
@@ -5385,6 +5393,28 @@ command_substitute (string, quoted)
1252
1252
-
goto error_exit;
1253
1253
-
}
1254
1254
-
1255
1255
-
+#if __CYGWIN__
1256
1256
-
+ /* Passing a pipe through std fds can cause hangs when talking to a
1257
1257
-
+ non-cygwin child. Move it. */
1258
1258
-
+ if (fildes[0] < 3)
1259
1259
-
+ {
1260
1260
-
+ int fd = fcntl (fildes[0], F_DUPFD, 3);
1261
1261
-
+ close (fildes[0]);
1262
1262
-
+ fildes[0] = fd;
1263
1263
-
+ }
1264
1264
-
+ if (fildes[1] < 3)
1265
1265
-
+ {
1266
1266
-
+ int fd = fcntl (fildes[1], F_DUPFD, 3);
1267
1267
-
+ close (fildes[1]);
1268
1268
-
+ fildes[1] = fd;
1269
1269
-
+ }
1270
1270
-
+ if (fildes[0] < 0 || fildes[1] < 0)
1271
1271
-
+ {
1272
1272
-
+ sys_error (_("cannot make pipe for command substitution"));
1273
1273
-
+ goto error_exit;
1274
1274
-
+ }
1275
1275
-
+#endif /* __CYGWIN__ */
1276
1276
-
+
1277
1277
-
old_pid = last_made_pid;
1278
1278
-
#if defined (JOB_CONTROL)
1279
1279
-
old_pipeline_pgrp = pipeline_pgrp;
1280
1280
-
--- support/bashversion.c 2008-09-09 07:31:53.000000000 -0600
1281
1281
-
+++ support/bashversion.c 2015-02-06 17:14:11.078059300 -0700
1282
1282
-
@@ -26,6 +26,9 @@
1283
1283
-
1284
1284
-
#if defined (HAVE_UNISTD_H)
1285
1285
-
# include <unistd.h>
1286
1286
-
+#else
1287
1287
-
+extern int optind;
1288
1288
-
+extern char *optarg;
1289
1289
-
#endif
1290
1290
-
1291
1291
-
#include "bashansi.h"
1292
1292
-
@@ -41,9 +44,6 @@
1293
1293
-
#define LFLAG 0x0020
1294
1294
-
#define XFLAG 0x0040
1295
1295
-
1296
1296
-
-extern int optind;
1297
1297
-
-extern char *optarg;
1298
1298
-
-
1299
1299
-
extern char *dist_version;
1300
1300
-
extern int patch_level;
1301
1301
-
1302
1302
-
@@ -65,7 +65,7 @@ main (argc, argv)
1303
1303
-
char **argv;
1304
1304
-
{
1305
1305
-
int opt, oflags;
1306
1306
-
- char dv[128], *rv;
1307
1307
-
+ char dv[128], *rv = NULL;
1308
1308
-
1309
1309
-
if (progname = strrchr (argv[0], '/'))
1310
1310
-
progname++;
1311
1311
-
--- support/mkversion.sh 2008-08-13 06:25:57.000000000 -0600
1312
1312
-
+++ support/mkversion.sh 2015-02-06 17:14:11.078059300 -0700
1313
1313
-
@@ -29,7 +29,7 @@ source_dir="."
1314
1314
-
while [ $# -gt 0 ]; do
1315
1315
-
case "$1" in
1316
1316
-
-o) shift; OUTFILE=$1; shift ;;
1317
1317
-
- -b) shift; inc_build=yes ;;
1318
1318
-
+ -b) shift; ;;# inc_build=yes ;; # hacked out for cygport
1319
1319
-
-s) shift; rel_status=$1; shift ;;
1320
1320
-
-p) shift; patch_level=$1; shift ;;
1321
1321
-
-d) shift; dist_version=$1; shift ;;
1322
1322
-
--- variables.c 2015-02-06 17:12:55.729569600 -0700
1323
1323
-
+++ variables.c 2015-02-06 17:14:11.078059300 -0700
1324
1324
-
@@ -2526,9 +2526,9 @@ bind_variable_internal (name, value, tab
1325
1325
-
1326
1326
-
newname = 0;
1327
1327
-
#if defined (ARRAY_VARS)
1328
1328
-
- if ((aflags & ASS_FROMREF) && (hflags & HASH_NOSRCH) == 0 && valid_array_reference (name))
1329
1329
-
+ if ((aflags & ASS_FROMREF) && (hflags & HASH_NOSRCH) == 0 && valid_array_reference ((char *)name))
1330
1330
-
{
1331
1331
-
- newname = array_variable_name (name, &subp, &sublen);
1332
1332
-
+ newname = array_variable_name ((char*)name, &subp, &sublen);
1333
1333
-
if (newname == 0)
1334
1334
-
return (SHELL_VAR *)NULL; /* XXX */
1335
1335
-
entry = hash_lookup (newname, table);
1336
1336
-
@@ -2573,13 +2573,13 @@ bind_variable_internal (name, value, tab
1337
1337
-
entry = make_new_array_variable (newname); /* indexed array by default */
1338
1338
-
if (entry == 0)
1339
1339
-
return entry;
1340
1340
-
- ind = array_expand_index (name, subp, sublen);
1341
1341
-
+ ind = array_expand_index (entry, subp, sublen);
1342
1342
-
bind_array_element (entry, ind, value, aflags);
1343
1343
-
}
1344
1344
-
#endif
1345
1345
-
else if (entry == 0)
1346
1346
-
{
1347
1347
-
- entry = make_new_variable (name, table);
1348
1348
-
+ entry = make_new_variable ((char*)name, table);
1349
1349
-
var_setvalue (entry, make_variable_value (entry, value, 0)); /* XXX */
1350
1350
-
}
1351
1351
-
else if (entry->assign_func) /* array vars have assign functions now */
1352
1352
-
@@ -4679,6 +4679,8 @@ static struct name_and_function special_
1353
1353
-
{ "COMP_WORDBREAKS", sv_comp_wordbreaks },
1354
1354
-
#endif
1355
1355
-
1356
1356
-
+ { "EXECIGNORE", sv_execignore },
1357
1357
-
+
1358
1358
-
{ "FUNCNEST", sv_funcnest },
1359
1359
-
1360
1360
-
{ "GLOBIGNORE", sv_globignore },
1361
1361
-
@@ -4877,6 +4879,13 @@ sv_globignore (name)
1362
1362
-
setup_glob_ignore (name);
1363
1363
-
}
1364
1364
-
1365
1365
-
+/* What to do when EXECIGNORE changes. */
1366
1366
-
+void
1367
1367
-
+sv_execignore (char *name)
1368
1368
-
+{
1369
1369
-
+ setup_exec_ignore (name);
1370
1370
-
+}
1371
1371
-
+
1372
1372
-
#if defined (READLINE)
1373
1373
-
void
1374
1374
-
sv_comp_wordbreaks (name)
1375
1375
-
@@ -4950,7 +4959,7 @@ sv_winsize (name)
1376
1376
-
/* Update the value of HOME in the export environment so tilde expansion will
1377
1377
-
work on cygwin. */
1378
1378
-
#if defined (__CYGWIN__)
1379
1379
-
-sv_home (name)
1380
1380
-
+void sv_home (name)
1381
1381
-
char *name;
1382
1382
-
{
1383
1383
-
array_needs_making = 1;
1384
1384
-
--- variables.h 2014-01-08 13:33:29.000000000 -0700
1385
1385
-
+++ variables.h 2015-02-06 17:14:11.078059300 -0700
1386
1386
-
@@ -372,6 +372,7 @@ extern void sv_ifs __P((char *));
1387
1387
-
extern void sv_path __P((char *));
1388
1388
-
extern void sv_mail __P((char *));
1389
1389
-
extern void sv_funcnest __P((char *));
1390
1390
-
+extern void sv_execignore __P((char *));
1391
1391
-
extern void sv_globignore __P((char *));
1392
1392
-
extern void sv_ignoreeof __P((char *));
1393
1393
-
extern void sv_strict_posix __P((char *));
+607
pkgs/shells/bash/cygwin-bash-4.4.11-2.src.patch
reviewed
···
1
1
+
--- origsrc/bash-4.4/bashline.c 2017-01-23 13:28:06.955247200 -0600
2
2
+
+++ src/bash-4.4/bashline.c 2017-01-23 13:55:07.992877600 -0600
3
3
+
@@ -76,6 +76,16 @@
4
4
+
# include "pcomplete.h"
5
5
+
#endif
6
6
+
7
7
+
+#if __CYGWIN__
8
8
+
+# ifdef __x86_64__
9
9
+
+# define IMP(x) __imp_##x
10
10
+
+# else
11
11
+
+# define IMP(x) _imp__##x
12
12
+
+# endif
13
13
+
+#else
14
14
+
+# define IMP(x) x
15
15
+
+#endif
16
16
+
+
17
17
+
/* These should agree with the defines for emacs_mode and vi_mode in
18
18
+
rldefs.h, even though that's not a public readline header file. */
19
19
+
#ifndef EMACS_EDITING_MODE
20
20
+
@@ -271,6 +281,11 @@ int no_empty_command_completion;
21
21
+
are the only possible matches, even if FIGNORE says to. */
22
22
+
int force_fignore = 1;
23
23
+
24
24
+
+#if __CYGWIN__
25
25
+
+/* If set, shorten "foo.exe" to "foo" when they are the same file. */
26
26
+
+int completion_strip_exe;
27
27
+
+#endif /* __CYGWIN__ */
28
28
+
+
29
29
+
/* Perform spelling correction on directory names during word completion */
30
30
+
int dircomplete_spelling = 0;
31
31
+
32
32
+
@@ -498,11 +513,12 @@ initialize_readline ()
33
33
+
kseq[0] = CTRL('J');
34
34
+
kseq[1] = '\0';
35
35
+
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
36
36
+
- if (func == rl_vi_editing_mode)
37
37
+
+ extern rl_command_func_t *IMP(rl_vi_editing_mode);
38
38
+
+ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
39
39
+
rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap);
40
40
+
kseq[0] = CTRL('M');
41
41
+
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
42
42
+
- if (func == rl_vi_editing_mode)
43
43
+
+ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
44
44
+
rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap);
45
45
+
#if defined (VI_MODE)
46
46
+
rl_unbind_key_in_map (CTRL('E'), vi_movement_keymap);
47
47
+
@@ -521,7 +537,8 @@ initialize_readline ()
48
48
+
kseq[0] = '~';
49
49
+
kseq[1] = '\0';
50
50
+
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
51
51
+
- if (func == 0 || func == rl_tilde_expand)
52
52
+
+ extern rl_command_func_t *IMP(rl_tilde_expand);
53
53
+
+ if (func == 0 || func == rl_tilde_expand || func == IMP(rl_tilde_expand))
54
54
+
rl_bind_keyseq_in_map (kseq, bash_complete_username, emacs_meta_keymap);
55
55
+
56
56
+
rl_bind_key_if_unbound_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap);
57
57
+
@@ -544,7 +561,8 @@ initialize_readline ()
58
58
+
kseq[0] = TAB;
59
59
+
kseq[1] = '\0';
60
60
+
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
61
61
+
- if (func == 0 || func == rl_tab_insert)
62
62
+
+ extern rl_command_func_t *IMP(rl_tab_insert);
63
63
+
+ if (func == 0 || func == rl_tab_insert || func == IMP(rl_tab_insert))
64
64
+
rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap);
65
65
+
66
66
+
/* Tell the completer that we want a crack first. */
67
67
+
@@ -2194,6 +2212,21 @@ globword:
68
68
+
69
69
+
if (match && executable_completion ((searching_path ? val : cval), searching_path))
70
70
+
{
71
71
+
+#if __CYGWIN__
72
72
+
+ if (completion_strip_exe)
73
73
+
+ {
74
74
+
+ size_t val_len = strlen (val);
75
75
+
+ char *candidate;
76
76
+
+ if (val_len > 4 && !strcasecmp (&val[val_len - 4], ".exe")
77
77
+
+ && (candidate = strdup (val)))
78
78
+
+ {
79
79
+
+ candidate[val_len - 4] = '\0';
80
80
+
+ if (same_file (val, candidate, NULL, NULL))
81
81
+
+ temp[strlen (temp) - 4] = '\0';
82
82
+
+ free (candidate);
83
83
+
+ }
84
84
+
+ }
85
85
+
+#endif
86
86
+
if (cval != val)
87
87
+
free (cval);
88
88
+
free (val);
89
89
+
@@ -2929,6 +2962,17 @@ test_for_directory (name)
90
90
+
int r;
91
91
+
92
92
+
fn = bash_tilde_expand (name, 0);
93
93
+
+#if __CYGWIN
94
94
+
+ /* stat("//server") can only be successful as a directory, but can take
95
95
+
+ seconds to time out on failure. It is much faster to assume that
96
96
+
+ "//server" is a valid name than it is to wait for a stat, even if it
97
97
+
+ gives false positives on bad names. */
98
98
+
+ if (fn[0] == '/' && fn[1] == '/' && ! strchr (&fn[2], '/'))
99
99
+
+ {
100
100
+
+ free (fn);
101
101
+
+ return 1;
102
102
+
+ }
103
103
+
+#endif
104
104
+
r = file_isdir (fn);
105
105
+
free (fn);
106
106
+
107
107
+
--- origsrc/bash-4.4/builtins/read.def 2017-01-23 13:28:07.017686500 -0600
108
108
+
+++ src/bash-4.4/builtins/read.def 2017-01-23 13:55:07.992877600 -0600
109
109
+
@@ -85,7 +85,6 @@ $END
110
110
+
111
111
+
#ifdef __CYGWIN__
112
112
+
# include <fcntl.h>
113
113
+
-# include <io.h>
114
114
+
#endif
115
115
+
116
116
+
#include "../bashintl.h"
117
117
+
@@ -530,10 +529,6 @@ read_builtin (list)
118
118
+
fflush (stderr);
119
119
+
}
120
120
+
121
121
+
-#if defined (__CYGWIN__) && defined (O_TEXT)
122
122
+
- setmode (0, O_TEXT);
123
123
+
-#endif
124
124
+
-
125
125
+
ps2 = 0;
126
126
+
for (print_ps2 = eof = retval = 0;;)
127
127
+
{
128
128
+
@@ -664,6 +659,14 @@ read_builtin (list)
129
129
+
if (c == '\0' && delim != '\0')
130
130
+
continue; /* skip NUL bytes in input */
131
131
+
132
132
+
+#ifdef __CYGWIN__
133
133
+
+ {
134
134
+
+ extern igncr;
135
135
+
+ if (igncr && c == '\r' && delim != '\r')
136
136
+
+ continue; /* skip carriage return */
137
137
+
+ }
138
138
+
+#endif
139
139
+
+
140
140
+
if ((skip_ctlesc == 0 && c == CTLESC) || (skip_ctlnul == 0 && c == CTLNUL))
141
141
+
{
142
142
+
saw_escape++;
143
143
+
--- origsrc/bash-4.4/builtins/set.def 2016-06-02 19:10:10.000000000 -0500
144
144
+
+++ src/bash-4.4/builtins/set.def 2017-01-23 13:55:07.992877600 -0600
145
145
+
@@ -56,6 +56,13 @@ extern int dont_save_function_defs;
146
146
+
#if defined (READLINE)
147
147
+
extern int no_line_editing;
148
148
+
#endif /* READLINE */
149
149
+
+#ifdef __CYGWIN__
150
150
+
+extern int igncr;
151
151
+
+static int set_minus_o_option_maybe (int, const char *, int);
152
152
+
+# define INTERACTIVE_ONLY ,1
153
153
+
+#else
154
154
+
+# define INTERACTIVE_ONLY
155
155
+
+#endif
156
156
+
157
157
+
$BUILTIN set
158
158
+
$FUNCTION set_builtin
159
159
+
@@ -92,6 +99,9 @@ Options:
160
160
+
#if defined (HISTORY)
161
161
+
history enable command history
162
162
+
#endif
163
163
+
+#ifdef __CYGWIN__
164
164
+
+ igncr on Cygwin, ignore \r in line endings
165
165
+
+#endif
166
166
+
ignoreeof the shell will not exit upon reading EOF
167
167
+
interactive-comments
168
168
+
allow comments to appear in interactive commands
169
169
+
@@ -192,29 +202,39 @@ const struct {
170
170
+
int *variable;
171
171
+
setopt_set_func_t *set_func;
172
172
+
setopt_get_func_t *get_func;
173
173
+
+#ifdef __CYGWIN__
174
174
+
+ /* Cygwin users have taken to exporting SHELLOPTS for the cygwin-specific
175
175
+
+ igncr. As a result, we want to ensure SHELLOPTS parsing does not turn
176
176
+
+ on interactive options when exported from an interactive shell, but
177
177
+
+ parse in a non-interactive setting, so as not to break POSIX /bin/sh */
178
178
+
+ int interactive_only;
179
179
+
+#endif
180
180
+
} o_options[] = {
181
181
+
{ "allexport", 'a', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
182
182
+
#if defined (BRACE_EXPANSION)
183
183
+
{ "braceexpand",'B', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
184
184
+
#endif
185
185
+
#if defined (READLINE)
186
186
+
- { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
187
187
+
+ { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY },
188
188
+
#endif
189
189
+
{ "errexit", 'e', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
190
190
+
{ "errtrace", 'E', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
191
191
+
{ "functrace", 'T', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
192
192
+
{ "hashall", 'h', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
193
193
+
#if defined (BANG_HISTORY)
194
194
+
- { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
195
195
+
+ { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY },
196
196
+
#endif /* BANG_HISTORY */
197
197
+
#if defined (HISTORY)
198
198
+
- { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL },
199
199
+
+ { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL INTERACTIVE_ONLY },
200
200
+
+#endif
201
201
+
+#ifdef __CYGWIN__
202
202
+
+ { "igncr", '\0', &igncr, NULL, (setopt_get_func_t *)NULL },
203
203
+
#endif
204
204
+
{ "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
205
205
+
{ "interactive-comments", '\0', &interactive_comments, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
206
206
+
{ "keyword", 'k', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
207
207
+
#if defined (JOB_CONTROL)
208
208
+
- { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
209
209
+
+ { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY },
210
210
+
#endif
211
211
+
{ "noclobber", 'C', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
212
212
+
{ "noexec", 'n', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
213
213
+
@@ -233,7 +253,7 @@ const struct {
214
214
+
{ "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
215
215
+
{ "verbose", 'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
216
216
+
#if defined (READLINE)
217
217
+
- { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
218
218
+
+ { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY },
219
219
+
#endif
220
220
+
{ "xtrace", 'x', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
221
221
+
{(char *)NULL, 0 , (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
222
222
+
@@ -455,6 +475,15 @@ int
223
223
+
set_minus_o_option (on_or_off, option_name)
224
224
+
int on_or_off;
225
225
+
char *option_name;
226
226
+
+#ifdef __CYGWIN__
227
227
+
+{
228
228
+
+ /* See Cygwin comments above. */
229
229
+
+ return set_minus_o_option_maybe (on_or_off, option_name, 0);
230
230
+
+}
231
231
+
+static int
232
232
+
+set_minus_o_option_maybe (int on_or_off, const char *option_name,
233
233
+
+ int avoid_interactive)
234
234
+
+#endif /* __CYGWIN__ */
235
235
+
{
236
236
+
register int i;
237
237
+
238
238
+
@@ -462,6 +491,10 @@ set_minus_o_option (on_or_off, option_na
239
239
+
{
240
240
+
if (STREQ (option_name, o_options[i].name))
241
241
+
{
242
242
+
+#ifdef __CYGWIN__
243
243
+
+ if (o_options[i].interactive_only && avoid_interactive)
244
244
+
+ return EXECUTION_SUCCESS;
245
245
+
+#endif
246
246
+
if (o_options[i].letter == 0)
247
247
+
{
248
248
+
previous_option_value = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name);
249
249
+
@@ -588,7 +621,11 @@ parse_shellopts (value)
250
250
+
vptr = 0;
251
251
+
while (vname = extract_colon_unit (value, &vptr))
252
252
+
{
253
253
+
+#ifdef __CYGWIN__
254
254
+
+ set_minus_o_option_maybe (FLAG_ON, vname, !interactive_shell);
255
255
+
+#else
256
256
+
set_minus_o_option (FLAG_ON, vname);
257
257
+
+#endif
258
258
+
free (vname);
259
259
+
}
260
260
+
}
261
261
+
--- origsrc/bash-4.4/builtins/shopt.def 2016-05-06 14:00:02.000000000 -0500
262
262
+
+++ src/bash-4.4/builtins/shopt.def 2017-01-23 13:55:07.992877600 -0600
263
263
+
@@ -92,6 +92,10 @@ extern int glob_asciirange;
264
264
+
extern int lastpipe_opt;
265
265
+
extern int inherit_errexit;
266
266
+
267
267
+
+#ifdef __CYGWIN__
268
268
+
+extern int completion_strip_exe;
269
269
+
+#endif
270
270
+
+
271
271
+
#if defined (EXTENDED_GLOB)
272
272
+
extern int extended_glob;
273
273
+
#endif
274
274
+
@@ -169,6 +173,9 @@ static struct {
275
275
+
{ "compat41", &shopt_compat41, set_compatibility_level },
276
276
+
{ "compat42", &shopt_compat42, set_compatibility_level },
277
277
+
{ "compat43", &shopt_compat43, set_compatibility_level },
278
278
+
+#ifdef __CYGWIN__
279
279
+
+ { "completion_strip_exe", &completion_strip_exe, NULL },
280
280
+
+#endif
281
281
+
#if defined (READLINE)
282
282
+
{ "complete_fullquote", &complete_fullquote, (shopt_set_func_t *)NULL},
283
283
+
{ "direxpand", &dircomplete_expand, shopt_set_complete_direxpand },
284
284
+
--- origsrc/bash-4.4/config-top.h 2016-05-19 13:34:02.000000000 -0500
285
285
+
+++ src/bash-4.4/config-top.h 2017-01-23 13:55:07.992877600 -0600
286
286
+
@@ -87,10 +87,10 @@
287
287
+
#define DEFAULT_BASHRC "~/.bashrc"
288
288
+
289
289
+
/* System-wide .bashrc file for interactive shells. */
290
290
+
-/* #define SYS_BASHRC "/etc/bash.bashrc" */
291
291
+
+#define SYS_BASHRC "/etc/bash.bashrc"
292
292
+
293
293
+
/* System-wide .bash_logout for login shells. */
294
294
+
-/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
295
295
+
+#define SYS_BASH_LOGOUT "/etc/bash.bash_logout"
296
296
+
297
297
+
/* Define this to make non-interactive shells begun with argv[0][0] == '-'
298
298
+
run the startup files when not in posix mode. */
299
299
+
@@ -100,7 +100,7 @@
300
300
+
sshd and source the .bashrc if so (like the rshd behavior). This checks
301
301
+
for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment,
302
302
+
which can be fooled under certain not-uncommon circumstances. */
303
303
+
-/* #define SSH_SOURCE_BASHRC */
304
304
+
+#define SSH_SOURCE_BASHRC
305
305
+
306
306
+
/* Define if you want the case-capitalizing operators (~[~]) and the
307
307
+
`capcase' variable attribute (declare -c). */
308
308
+
--- origsrc/bash-4.4/doc/Makefile.in 2015-12-06 18:55:56.000000000 -0600
309
309
+
+++ src/bash-4.4/doc/Makefile.in 2017-01-23 13:55:07.992877600 -0600
310
310
+
@@ -189,7 +189,7 @@ bashref.html: $(BASHREF_FILES) $(HSUSER)
311
311
+
$(MAKEINFO) --html --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
312
312
+
313
313
+
bash.info: bashref.info
314
314
+
- ${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \
315
315
+
+ ${SHELL} ${INFOPOST} < bashref.info > $@ ; \
316
316
+
317
317
+
bash.txt: bash.1
318
318
+
bash.ps: bash.1
319
319
+
@@ -252,9 +252,9 @@ install: info installdirs
320
320
+
-$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext}
321
321
+
-$(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir)
322
322
+
# uncomment the next lines to install the builtins man page
323
323
+
-# sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
324
324
+
-# -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
325
325
+
-# -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
326
326
+
+ sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
327
327
+
+ -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
328
328
+
+ -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
329
329
+
-if test -f bash.info; then d=.; else d=$(srcdir); fi; \
330
330
+
$(INSTALL_DATA) $$d/bash.info $(DESTDIR)$(infodir)/bash.info
331
331
+
# run install-info if it is present to update the info directory
332
332
+
--- origsrc/bash-4.4/doc/bash.1 2016-08-26 08:45:17.000000000 -0500
333
333
+
+++ src/bash-4.4/doc/bash.1 2017-01-23 13:55:08.008447700 -0600
334
334
+
@@ -9607,6 +9607,10 @@ filenames.
335
335
+
This variable is set by default, which is the default bash behavior in
336
336
+
versions through 4.2.
337
337
+
.TP 8
338
338
+
+.B completion_strip_exe
339
339
+
+If set, whenever bash sees \fIfoo.exe\fP during completion, it checks if
340
340
+
+\fIfoo\fP is the same file and strips the suffix.
341
341
+
+.TP 8
342
342
+
.B direxpand
343
343
+
If set,
344
344
+
.B bash
345
345
+
--- origsrc/bash-4.4/doc/bashref.texi 2016-09-07 16:13:36.000000000 -0500
346
346
+
+++ src/bash-4.4/doc/bashref.texi 2017-01-23 13:55:08.008447700 -0600
347
347
+
@@ -5123,6 +5123,10 @@ filenames.
348
348
+
This variable is set by default, which is the default Bash behavior in
349
349
+
versions through 4.2.
350
350
+
351
351
+
+@item completion_strip_exe
352
352
+
+If set, whenever bash sees @file{foo.exe} during completion, it checks if
353
353
+
+@file{foo} is the same file and strips the suffix.
354
354
+
+
355
355
+
@item direxpand
356
356
+
If set, Bash
357
357
+
replaces directory names with the results of word expansion when performing
358
358
+
--- origsrc/bash-4.4/doc/builtins.1 2012-02-21 13:32:05.000000000 -0600
359
359
+
+++ src/bash-4.4/doc/builtins.1 2017-01-23 13:55:08.008447700 -0600
360
360
+
@@ -19,6 +19,6 @@ shift, shopt, source, suspend, test, tim
361
361
+
ulimit, umask, unalias, unset, wait \- bash built-in commands, see \fBbash\fR(1)
362
362
+
.SH BASH BUILTIN COMMANDS
363
363
+
.nr zZ 1
364
364
+
-.so bash.1
365
365
+
+.so man1/bash.1
366
366
+
.SH SEE ALSO
367
367
+
bash(1), sh(1)
368
368
+
--- origsrc/bash-4.4/general.c 2016-08-11 10:16:56.000000000 -0500
369
369
+
+++ src/bash-4.4/general.c 2017-01-23 13:55:08.008447700 -0600
370
370
+
@@ -48,6 +48,10 @@
371
371
+
372
372
+
#include <tilde/tilde.h>
373
373
+
374
374
+
+#ifdef __CYGWIN__
375
375
+
+# include <sys/cygwin.h>
376
376
+
+#endif
377
377
+
+
378
378
+
#if !defined (errno)
379
379
+
extern int errno;
380
380
+
#endif /* !errno */
381
381
+
@@ -718,7 +722,8 @@ make_absolute (string, dot_path)
382
382
+
{
383
383
+
char pathbuf[PATH_MAX + 1];
384
384
+
385
385
+
- cygwin_conv_to_full_posix_path (string, pathbuf);
386
386
+
+ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, string, pathbuf,
387
387
+
+ sizeof pathbuf);
388
388
+
result = savestring (pathbuf);
389
389
+
}
390
390
+
#else
391
391
+
--- origsrc/bash-4.4/input.c 2015-09-24 18:49:23.000000000 -0500
392
392
+
+++ src/bash-4.4/input.c 2017-01-23 13:55:08.008447700 -0600
393
393
+
@@ -44,6 +44,10 @@
394
394
+
#include "quit.h"
395
395
+
#include "trap.h"
396
396
+
397
397
+
+#ifdef __CYGWIN__
398
398
+
+int igncr;
399
399
+
+#endif
400
400
+
+
401
401
+
#if !defined (errno)
402
402
+
extern int errno;
403
403
+
#endif /* !errno */
404
404
+
@@ -561,6 +565,19 @@ buffered_getchar ()
405
405
+
{
406
406
+
CHECK_TERMSIG;
407
407
+
408
408
+
+#ifdef __CYGWIN__
409
409
+
+ /* shopt igncr discards carriage returns from the input stream.
410
410
+
+ If cr is the only character left in the buffer, recurse to pick
411
411
+
+ up the next byte; otherwise flatten the buffer. */
412
412
+
+ if (igncr)
413
413
+
+ {
414
414
+
+ int ch;
415
415
+
+ while ((ch = bufstream_getc (buffers[bash_input.location.buffered_fd]))
416
416
+
+ == '\r')
417
417
+
+ ;
418
418
+
+ return ch;
419
419
+
+ }
420
420
+
+#endif
421
421
+
#if !defined (DJGPP)
422
422
+
return (bufstream_getc (buffers[bash_input.location.buffered_fd]));
423
423
+
#else
424
424
+
--- origsrc/bash-4.4/lib/sh/pathphys.c 2013-05-28 14:33:58.000000000 -0500
425
425
+
+++ src/bash-4.4/lib/sh/pathphys.c 2017-01-23 13:55:08.008447700 -0600
426
426
+
@@ -35,6 +35,7 @@
427
427
+
#include <stdio.h>
428
428
+
#include <chartypes.h>
429
429
+
#include <errno.h>
430
430
+
+#include <stdlib.h>
431
431
+
432
432
+
#include "shell.h"
433
433
+
434
434
+
@@ -76,6 +77,9 @@ sh_physpath (path, flags)
435
435
+
char *path;
436
436
+
int flags;
437
437
+
{
438
438
+
+#ifdef __CYGWIN__
439
439
+
+ return realpath (path, NULL);
440
440
+
+#endif
441
441
+
char tbuf[PATH_MAX+1], linkbuf[PATH_MAX+1];
442
442
+
char *result, *p, *q, *qsave, *qbase, *workpath;
443
443
+
int double_slash_path, linklen, nlink;
444
444
+
@@ -214,11 +218,7 @@ error:
445
445
+
{
446
446
+
q = result;
447
447
+
/* Duplicating some code here... */
448
448
+
-#if defined (__CYGWIN__)
449
449
+
- qbase = (ISALPHA((unsigned char)workpath[0]) && workpath[1] == ':') ? workpath + 3 : workpath + 1;
450
450
+
-#else
451
451
+
qbase = workpath + 1;
452
452
+
-#endif
453
453
+
double_slash_path = DOUBLE_SLASH (workpath);
454
454
+
qbase += double_slash_path;
455
455
+
456
456
+
--- origsrc/bash-4.4/lib/sh/tmpfile.c 2016-08-11 10:05:58.000000000 -0500
457
457
+
+++ src/bash-4.4/lib/sh/tmpfile.c 2017-01-23 13:55:08.008447700 -0600
458
458
+
@@ -101,7 +101,7 @@ get_tmpdir (flags)
459
459
+
if (tdir && (file_iswdir (tdir) == 0 || strlen (tdir) > PATH_MAX))
460
460
+
tdir = 0;
461
461
+
462
462
+
- if (tdir == 0)
463
463
+
+ if (tdir == 0 || !file_iswdir (tdir))
464
464
+
tdir = get_sys_tmpdir ();
465
465
+
466
466
+
#if defined (HAVE_PATHCONF) && defined (_PC_NAME_MAX)
467
467
+
--- origsrc/bash-4.4/mksyntax.c 2012-07-29 18:48:38.000000000 -0500
468
468
+
+++ src/bash-4.4/mksyntax.c 2017-01-23 13:55:08.008447700 -0600
469
469
+
@@ -29,13 +29,13 @@
470
470
+
471
471
+
#ifdef HAVE_UNISTD_H
472
472
+
# include <unistd.h>
473
473
+
+#else
474
474
+
+extern int optind;
475
475
+
+extern char *optarg;
476
476
+
#endif
477
477
+
478
478
+
#include "syntax.h"
479
479
+
480
480
+
-extern int optind;
481
481
+
-extern char *optarg;
482
482
+
-
483
483
+
#ifndef errno
484
484
+
extern int errno;
485
485
+
#endif
486
486
+
--- origsrc/bash-4.4/parse.y 2016-09-11 10:31:46.000000000 -0500
487
487
+
+++ src/bash-4.4/parse.y 2017-01-23 13:55:08.008447700 -0600
488
488
+
@@ -1539,14 +1539,20 @@ yy_string_get ()
489
489
+
string = bash_input.location.string;
490
490
+
491
491
+
/* If the string doesn't exist, or is empty, EOF found. */
492
492
+
- if (string && *string)
493
493
+
+ while (string && *string)
494
494
+
{
495
495
+
c = *string++;
496
496
+
bash_input.location.string = string;
497
497
+
+#ifdef __CYGWIN__
498
498
+
+ {
499
499
+
+ extern int igncr;
500
500
+
+ if (igncr && c == '\r')
501
501
+
+ continue;
502
502
+
+ }
503
503
+
+#endif
504
504
+
return (c);
505
505
+
}
506
506
+
- else
507
507
+
- return (EOF);
508
508
+
+ return (EOF);
509
509
+
}
510
510
+
511
511
+
static int
512
512
+
--- origsrc/bash-4.4/subst.c 2017-01-23 13:28:06.955247200 -0600
513
513
+
+++ src/bash-4.4/subst.c 2017-01-23 13:55:08.008447700 -0600
514
514
+
@@ -43,6 +43,7 @@
515
515
+
#include "posixstat.h"
516
516
+
#include "bashintl.h"
517
517
+
518
518
+
+#define NEED_SH_SETLINEBUF_DECL
519
519
+
#include "shell.h"
520
520
+
#include "parser.h"
521
521
+
#include "flags.h"
522
522
+
@@ -5964,6 +5965,13 @@ read_comsub (fd, quoted, rflag)
523
523
+
#endif
524
524
+
continue;
525
525
+
}
526
526
+
+#ifdef __CYGWIN__
527
527
+
+ {
528
528
+
+ extern int igncr;
529
529
+
+ if (igncr && c == '\r')
530
530
+
+ continue;
531
531
+
+ }
532
532
+
+#endif
533
533
+
534
534
+
/* Add the character to ISTRING, possibly after resizing it. */
535
535
+
RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE);
536
536
+
@@ -6088,6 +6096,28 @@ command_substitute (string, quoted)
537
537
+
goto error_exit;
538
538
+
}
539
539
+
540
540
+
+#ifdef __CYGWIN__
541
541
+
+ /* Passing a pipe through std fds can cause hangs when talking to a
542
542
+
+ non-cygwin child. Move it. */
543
543
+
+ if (fildes[0] < 3)
544
544
+
+ {
545
545
+
+ int fd = fcntl (fildes[0], F_DUPFD, 3);
546
546
+
+ close (fildes[0]);
547
547
+
+ fildes[0] = fd;
548
548
+
+ }
549
549
+
+ if (fildes[1] < 3)
550
550
+
+ {
551
551
+
+ int fd = fcntl (fildes[1], F_DUPFD, 3);
552
552
+
+ close (fildes[1]);
553
553
+
+ fildes[1] = fd;
554
554
+
+ }
555
555
+
+ if (fildes[0] < 0 || fildes[1] < 0)
556
556
+
+ {
557
557
+
+ sys_error (_("cannot make pipe for command substitution"));
558
558
+
+ goto error_exit;
559
559
+
+ }
560
560
+
+#endif /* __CYGWIN__ */
561
561
+
+
562
562
+
old_pid = last_made_pid;
563
563
+
#if defined (JOB_CONTROL)
564
564
+
old_pipeline_pgrp = pipeline_pgrp;
565
565
+
--- origsrc/bash-4.4/support/bashversion.c 2008-09-09 08:31:53.000000000 -0500
566
566
+
+++ src/bash-4.4/support/bashversion.c 2017-01-23 13:55:08.024037200 -0600
567
567
+
@@ -26,6 +26,9 @@
568
568
+
569
569
+
#if defined (HAVE_UNISTD_H)
570
570
+
# include <unistd.h>
571
571
+
+#else
572
572
+
+extern int optind;
573
573
+
+extern char *optarg;
574
574
+
#endif
575
575
+
576
576
+
#include "bashansi.h"
577
577
+
@@ -41,9 +44,6 @@
578
578
+
#define LFLAG 0x0020
579
579
+
#define XFLAG 0x0040
580
580
+
581
581
+
-extern int optind;
582
582
+
-extern char *optarg;
583
583
+
-
584
584
+
extern char *dist_version;
585
585
+
extern int patch_level;
586
586
+
587
587
+
--- origsrc/bash-4.4/support/mkversion.sh 2008-08-13 07:25:57.000000000 -0500
588
588
+
+++ src/bash-4.4/support/mkversion.sh 2017-01-23 13:55:08.024037200 -0600
589
589
+
@@ -29,7 +29,7 @@ source_dir="."
590
590
+
while [ $# -gt 0 ]; do
591
591
+
case "$1" in
592
592
+
-o) shift; OUTFILE=$1; shift ;;
593
593
+
- -b) shift; inc_build=yes ;;
594
594
+
+ -b) shift; ;; # inc_build=yes ;; # hacked out for cygport
595
595
+
-s) shift; rel_status=$1; shift ;;
596
596
+
-p) shift; patch_level=$1; shift ;;
597
597
+
-d) shift; dist_version=$1; shift ;;
598
598
+
--- origsrc/bash-4.4/variables.c 2016-06-15 15:05:52.000000000 -0500
599
599
+
+++ src/bash-4.4/variables.c 2017-01-23 13:55:08.024037200 -0600
600
600
+
@@ -5239,6 +5239,7 @@ sv_winsize (name)
601
601
+
/* Update the value of HOME in the export environment so tilde expansion will
602
602
+
work on cygwin. */
603
603
+
#if defined (__CYGWIN__)
604
604
+
+void
605
605
+
sv_home (name)
606
606
+
char *name;
607
607
+
{