]> git.ipfire.org Git - thirdparty/bash.git/blob - CHANGES-4.4
commit bash-20150626 snapshot
[thirdparty/bash.git] / CHANGES-4.4
1 This document details the changes between this version, bash-4.4-alpha, and
2 the previous version, bash-4.3-release.
3
4 1. Changes to Bash
5
6 a. A bug that caused pipelines to be corrupted while running the DEBUG trap
7 was fixed.
8
9 b. A bug that accidentally omitted the `-R' unary operator from `test' was
10 fixed.
11
12 c. A bug that could cause the shell to not restore the terminal's process
13 group on shell exit was fixed.
14
15 d. Several changes were made to programmable completion to accommodate
16 assumptions made by the bash-completion package.
17
18 e. Bash no longer inhibits C-style escape processing ($'...') while performing
19 pattern substitution word expansions.
20
21 f. Fixed a bug that caused `return' executed from a trap handler to use the
22 wrong return status when one was not supplied as an argument.
23
24 g. In Posix mode, defining a function with the same name as a special
25 builtin is now an error, fatal only when the shell is not interactive.
26
27 h. Fixed a bug that caused compound array assignments to discard unset or null
28 variables used as subscripts, thereby making it appear as if the index was
29 not present.
30
31 i. Fixed a bug that caused extended glob patterns to incorrectly match
32 filenames with a leading `.'.
33
34 j. Fixed a bug involving sign extension when reallocating the input line
35 after a history expansion, causing segmentation faults.
36
37 k. Bash now does a better job at identifying syntax errors during word
38 completion and tailoring completion appropriately.
39
40 l. Bash now uses the current locale's decimal point in comamnd timing output.
41
42 m. Fixed a bug that caused segmentation faults while reading here documents if
43 PS2 contains a command substitution.
44
45 n. There are several changes to how $@ is expanded when unquoted but in a
46 context where word splitting is not performed (e.g., on the rhs of an
47 assignment or in a conditional command).
48
49 o. Bash now quotes command hash table entries that contain shell metacharacters
50 when displaying hash table contents.
51
52 p. Fixed a potential file descriptor leak when dup2() fails while performing a
53 redirection.
54
55 q. Fixed a bug that caused directory names evaluated during word completion to
56 be dequoted twice.
57
58 r. Fixed several bugs which could result in indirect variable expansion and
59 namerefs creating variables with invalid names or referencing variables
60 set to the empty string.
61
62 s. Fixed a bug that caused bash to not expand $0 in word expansions where it
63 should.
64
65 t. Fixed a bug that caused bash to perform process substitution if <(
66 appeared inside an arithmetic context.
67
68 u. Fixed a bug in extglob pattern parsing that caused slashes in the pattern
69 to be confused as directory names.
70
71 v. Fixed several bugs with treatment of invisible variables (variables with
72 attributes that are unset because they have never been assigned values).
73
74 w. Fixed a bug that caused the `read' builtin to not clean up readline's
75 state when using the -e and -t options together and the read timed out.
76
77 x. Fixed a bug that caused the shell to exit with the wrong (but non-zero)
78 value if a command was not found or was not executable.
79
80 y. Fixed a bug that caused the `time' reserved word to not be recognized as
81 such in all contexts where it should have been.
82
83 z. Fixed a bug that caused the shell to close process subsitution file
84 descriptors when executing a script without the `#!' leading line.
85
86 aa. Fixed a typo that caused the `compat42' shell option to set the wrong
87 compatibility level.
88
89 bb. The shell now handles process substitution commands with embedded
90 parentheses the same way as it does when parsing command substitution.
91
92 cc. Fixed a bug that caused nested pipelines and the `lastpipe' shell option
93 to produce core dumps.
94
95 dd. Fixed a bug that caused patterns containing `*' to match pathnames in cases
96 where slashes must be matched explicitly.
97
98 ee. Fixed a problem with patterns containing `:' in colon-separated variables
99 lik GLOBIGNORE.
100
101 ff. Fixed a bug that caused indirect variable expansion using indexed arrays to
102 always use index 0.
103
104 gg. Fixed a parsing problem that caused quoted newlines immediately following a
105 command substitution to be mishandled in certain cases.
106
107 hh. Fixed a potential buffer overflow on systems without locale_charset or the
108 bash replacement.
109
110 ii. Fixed a bug that caused background processes to modify the terminal's
111 process group under certain circumstances.
112
113 jj. Asynchronous commands now always set $? to 0 and are not affected by
114 whether or not the command's exit status is being inverted.
115
116 kk. Fixed a problem that caused a line ending with an escaped newline and
117 containingh a prior `eval' to be incorrectly parsed.
118
119 ll. Fixed an issue with programmable completion and `!' in extglob patterns
120 used as arguments to `compgen -X'.
121
122 mm. Word completion now treats the two-character token `>|' as requiring
123 filename expansion.
124
125 nn. Bash no longer expands tildes in $PATH elements while in Posix mode.
126
127 oo. Fixed a bug that caused bash to not clean up readline's state, including
128 the terminal settings, if it received a fatal signal while in a readline()
129 call (including `read -e' and `read -s').
130
131 pp. Fixed bug that caused importing shell functions from the environment to
132 execute additional commands following the function.
133
134 qq. Fixed a bug that caused the parser to return a lookahead character pushed
135 back by a previous call, even when on another line.
136
137 rr. Fixed a bug that caused many here-documents or many nested case statements
138 to overflow an internal stack.
139
140 ss. Changed the way bash encodes exported functions for inclusion in the
141 environment to avoid name collisions with valid variable names and to
142 indicate that they are exported functions.
143
144 tt. Fixed a bug that could result in an invalid memory access when processing
145 a here document delimited by end of file or end of string.
146
147 uu. Fixed a bug that could cause an invalid memory access if a command was run
148 before initializing the job control framework.
149
150 vv. When in Posix mode, bash prints shell function definitions as Posix
151 specifies them, without the leading `function' keyword.
152
153 ww. The variable attribute display builtins no longer display variables with
154 invalid names that were imported from the environment.
155
156 xx. Fixed a bug that could allow `break' or `continue' executed from shell
157 functions to affect loops running outside of the function.
158
159 yy. Fixed a bug that could cause a restricted shell to attempt to import shell
160 functions from the environment.
161
162 zz. The shell now allows double-quoted identifiers in arithmetic expressions.
163
164 aaa. Fixed a bug that could allow scalar variables subscripted using [@] in
165 word expansions to be incorrectly quoted.
166
167 bbb. The shell now makes sure to ignore SIGTSTP/SIGTTIN/SIGTTOU in child
168 processes if they were ignored at shell startup, even if job control is
169 in effect.
170
171 ccc. Fixed a bug that could cause $* to be split on spaces when IFS is set to
172 the empty string.
173
174 ddd. Posix says that expanding $* in a pattern context where the expansion is
175 double-quoted should not treat $* as if it were double quoted.
176
177 eee. Bash now restores getopts' internal state between calls to getopts even if
178 a shell function declares a local copy of OPTIND.
179
180 fff. Fixed a bug that could cause `history -r' or `history -n' to read identical
181 lines from the history file more than once.
182
183 ggg. The commands executed by `bind -x' now redisplay at most the final line
184 of a multi-line prompt, and those commands may return 124 to indicate that
185 the entire prompt should be redrawn.
186
187 hhh. Fixed a bug that could cause `mapfile' to create variables with invalid
188 names.
189
190 iii. The shell only goes into debugging mode when --debugger is supplied if
191 the debugger initialization file is present.
192
193 jjj. Fixed a bug that disallowed an assignment to (implicit) subscript 0 of an
194 existing array in a declare command that set the readonly attribute.
195
196 kkk. Fixed a bug that inadvertently allowed assignments to FUNCNAME to disable
197 its special status.
198
199 lll. Appending to an existing array variable using the compound assignment
200 syntax (var+=(aaa)) should not affect assignments to existing subscripts
201 appearing in the compound assignment.
202
203 mmm. Fixed a bug that could cause the shell to crash when a variable with a
204 null value was passed in the temporary environment and the variable's
205 attributes are modified using `declare' while performing a redirection.
206
207 nnn. Fixed a bug in printf so that a missing precision specifier after a `.'
208 is treated as 0.
209
210 ooo. Fixed a bug that attempted to use the internal command timing to time
211 pipeline components if the pipeline elements are separated by newlines.
212
213 ppp. Fixed a bug that caused `declare -al foo=(ONE TWO THREE)' to not lowercase
214 the values on assignment.
215
216 qqq. Bash does a better job of determining whether or not files are executable
217 when running on Windows, since the X_OK flag to access(2) is not supported.
218
219 rrr. Fixed a bug that caused some of the shell's internal traps (e.g., ERR) to
220 be interrupted (and leave incorrect state) by pending SIGINTs.
221
222 sss. Fixed a bug in the bash interface to history expansion to avoid attempting
223 expansion if the history expansion character occurs in a command
224 substitution.
225
226 ttt. Fixed a bug that caused the select command to crash if the REPLY variable
227 ends up empty (e.g., if it's made readonly)
228
229 uuu. Bash handles backslash-quoting of multibyte characters better when quoting
230 output that is intended to be reused.
231
232 vvv. System-specific changes for: Windows, Cygwin.
233
234 www. Fixes for upper and lower-casing multibyte characters, some locales have
235 characters whose upper and lowercase versions have different numbers of
236 bytes.
237
238 xxx. Fixed a bug that caused the ERR trap in a shell function to have the
239 right value for $LINENO.
240
241 yyy. Fixed a bug that resulted in incorrect quoting of regexps for the =~
242 operator when an open brace appears without a close brace.
243
244 zzz. Fixed a bug in the array unset operation that caused it to attempt to
245 parse embedded single and double quotes.
246
247 aaaa. Fixed a bug that caused $* to not expand with the first character of
248 $IFS as a separator in a context where word splitting will not take
249 place.
250
251 bbbb. Fixed two bugs that could cause the shell to dereference a null pointer
252 while attempting to print an error message from arithmetic expansion.
253
254 cccc. Fixed a bug that resulted in short-circuited evaluation when reading
255 commands from a string ending in an unquoted backslash, or when sourcing
256 a file that ends with an unquoted backslash.
257
258 dddd. Fixed a bug that resulted in the no-fork optimization not cleaning up
259 any FIFOs created by process substitution.
260
261 eeee. If the -T option is not set, allow the source builtin and shell functions
262 to set a DEBUG trap that persists after the sourced file or function
263 returns, instead of restoring the old (unset) value unconditionally.
264
265 ffff. Fixed a bug that caused redirections to not be undone on some syntax
266 errors, e.g., when parsing a command substitution.
267
268 gggg. Bash only adds asynchronous commands to the table of background pids
269 whose status it remembers, to avoid it growing too large during scripts
270 that create and reap large numbers of child processes. This means that
271 `wait' no longer works on synchronous jobs, but $? can be used to get
272 the exit status in those cases.
273
274 hhhh. Bash now checks whether or not a shell script argument is a directory
275 before trying to open it; Posix says implementations may allow open(2)
276 on a directory.
277
278 iiii. Fixed a bug that could cause the shell to set the terminal's process
279 group to a background process group when running as part of a pipeline.
280
281 jjjj. Made a few changes to strings to avoid possible potential negative effects
282 caused by malicious translations.
283
284 kkkk. Fixed a bug that caused the `unset' builtin to continue to treat its
285 arguments as functions after unsetting a function when invoked with no
286 options.
287
288 llll. Fixed a bug that would not replace empty strings using pattern
289 substitution even if the pattern matched the empty string.
290
291 mmmm. Fixed a bug with word completion that prevented some characters from
292 being backslash-quoted (backquote, dollar sign).
293
294 nnnn. Fixed a bug that prevented a command from the history re-executed by the
295 `fc' builtin from setting verbose mode.
296
297 oooo. Fixed a bug that caused the shell to not enable and disable function
298 tracing with changes to the `extdebug' shell option.
299
300 pppp. Fixed a bug that caused assignments to nameref variables pointing to
301 unset variables with attributes but no values to create variables with
302 incorrect names.
303
304 qqqq. Fixed a bug that caused `unset' on nameref variables (without -n) to
305 unset the wrong variable under certain circumstances.
306
307 rrrr. Fixed a bug that caused close braces occurring in brace expansions within
308 command substitutions to incorrectly terminate parameter expansions.
309
310 ssss. Fixed a bug that caused `command -p' to temporarily alter $PATH.
311
312 tttt. Fixed a bug that caused interactive shells compiled without job control
313 to return incorrect status values for child processes when running a
314 single command that creates enough children to use the entire PID space.
315
316 uuuu. `esac' should not be recognized as a reserved word when it appears as the
317 second or later pattern in a case statement pattern list.
318
319 vvvv. Fixed a bug that caused the completion code to read past the end of the
320 readline line buffer while skipping assignment statements to find the
321 command name.
322
323 2. Changes to Readline
324
325 a. A bug that caused vi-mode `.' to be unable to redo `c', `d', and `y'
326 commands with modifiers was fixed.
327
328 b. Fixed a bug that caused callback mode to dump core when reading a
329 multiple-key sequence (e.g., arrow keys).
330
331 c. Fixed a bug that caused the redisplay code to erase some of the line when
332 using horizontal scrolling with incremental search.
333
334 d. Readline's input handler now performs signal processing if read(2) is
335 interrupted by SIGALRM or SIGVTALRM.
336
337 e. Fixed a problem with revert-all-at-newline freeing freed memory.
338
339 f. Clarified the documentation for the history_quotes_inhibit_expansion
340 variable to note that it inhibits scanning for the history comment
341 character and that it only affects double-quoted strings.
342
343 g. Fixed an off-by-one error in the prompt printed when performing searches.
344
345 h. Use pselect(2), if available, to wait for input before calling read(2), so
346 a SIGWINCH can interrupt it, since it doesn't interrupt read(2).
347
348 i. Some memory leaks caused by signals interrupting filename completion have
349 been fixed.
350
351 j. Reading EOF twice on a non-empty line causes EOF to be returned, rather
352 than the partial line. This can cause partial lines to be executed on
353 SIGHUP, for example.
354
355 k. Fixed a bug concerning deleting multibyte characters from the search
356 string while performing an incremental search.
357
358 l. Fixed a bug with tilde expanding directory names in filename completion.
359
360 m. Fixed a bug that did not allow binding sequences beginning with a `\'.
361
362 n. Fixed a redisplay bug involving incorrect line wrapping when the prompt
363 contains a multibyte character in the last screen column.
364
365 o. Fixed a bug that caused history expansion to disregard characters that are
366 documented to delimit a history event specifier without requiring `:'.
367
368 p. Fixed a bug that could cause reading past the end of a string when reading
369 the value when binding the set of isearch terminators.
370
371 q. Fixed a bug that caused readline commands that depend on knowing which
372 key invoked them to misbehave when dispatching key sequences that are
373 prefixes of other key bindings.
374
375 r. Paren matching now works in vi insert mode.
376
377 3. New Features in Bash
378
379 a. There is now a settable configuration #define that will cause the shell
380 to exit if the shell is running setuid without the -p option and setuid
381 to the real uid fails.
382
383 b. Command and process substitutions now turn off the `-v' option when
384 executing, as other shells seem to do.
385
386 c. The default value for the `checkhash' shell option may now be set at
387 compile time with a #define.
388
389 d. The `mapfile' builtin now has a -d option to use an arbitrary character
390 as the record delimiter, and a -t option to strip the delimiter as
391 supplied with -d.
392
393 e. The maximum number of nested recursive calls to `eval' is now settable in
394 config-top.h; the default is no limit.
395
396 f. The `-p' option to declare and similar builtins will display attributes for
397 named variables even when those variables have not been assigned values
398 (which are technically unset).
399
400 g. The maximum number of nested recursive calls to `source' is now settable
401 in config-top.h; the default is no limit.
402
403 h. All builtin commands recognize the `--help' option and print a usage
404 summary.
405
406 i. Bash does not allow function names containing `/' and `=' to be exported.
407
408 j. The `ulimit' builtin has new -k (kqueues) and -P (pseudoterminals) options.
409
410 k. The shell now allows `time ; othercommand' to time null commands.
411
412 l. There is a new `--enable-function-import' configuration option to allow
413 importing shell functions from the environment; import is enabled by
414 default.
415
416 m. `printf -v var ""' will now set `var' to the empty string, as if `var=""'
417 had been executed.
418
419 n. GLOBIGNORE, the pattern substitution word expansion, and programmable
420 completion match filtering now honor the value of the `nocasematch' option.
421
422 o. There is a new ${parameter@spec} family of operators to transform the
423 value of `parameter'.
424
425 p. Bash no longer attempts to perform compound assignment if a variable on the
426 rhs of an assignment statement argument to `declare' has the form of a
427 compound assignment (e.g., w='(word)' ; declare foo=$w); compound
428 assignments are accepted if the variable was already declared as an array,
429 but with a warning.
430
431 q. The declare builtin no longer displays array variables using the compound
432 assignment syntax with quotes; that will generate warnings when re-used as
433 input, and isn't necessary.
434
435 r. Executing the rhs of && and || will no longer cause the shell to fork if
436 it's not necessary.
437
438 s. The `local' builtin takes a new argument: `-', which will cause it to save
439 and the single-letter shell options and restore their previous values at
440 function return.
441
442 t. `complete' and `compgen' have a new `-o nosort' option, which forces
443 readline to not sort the completion matches.
444
445 u. Bash now allows waiting for the most recent process substitution, since it
446 appears as $!.
447
448 v. The `unset' builtin now unsets a scalar variable if it is subscripted with
449 a `0', analogous to the ${var[0]} expansion.
450
451 w. `set -i' is no longer valid, as in other shells.
452
453 x. BASH_SUBSHELL is now updated for process substitution and group commands
454 in pipelines, and is available with the same value when running any exit
455 trap.
456
457 y. Bash now checks $INSIDE_EMACS as well as $EMACS when deciding whether or
458 not bash is being run in a GNU Emacs shell window.
459
460 z. Bash now treats SIGINT received when running a non-builtin command in a
461 loop the way it has traditionally treated running a builtin command:
462 running any trap handler and breaking out of the loop.
463
464 aa. New variable: EXECIGNORE; a colon-separate list of patterns that will
465 cause matching filenames to be ignored when searching for commands.
466
467 bb. Aliases whose value ends in a shell metacharacter now expand in a way to
468 allow them to be `pasted' to the next token, which can potentially change
469 the meaning of a command (e.g., turning `&' into `&&').
470
471 4. New Features in Readline
472
473 a. The history truncation code now uses the same error recovery mechansim as
474 the history writing code, and restores the old version of the history file
475 on error. The error recovery mechanism handles symlinked history files.
476
477 b. There is a new bindable variable, `enable-bracketed-paste', which enables
478 support for a terminal's bracketed paste mode.
479
480 c. The editing mode indicators can now be strings and are user-settable
481 (new `emacs-mode-string', `vi-cmd-mode-string' and `vi-ins-mode-string'
482 variables). Mode strings can contain invisible character sequences.
483 Setting mode strings to null strings restores the defaults.
484
485 d. Prompt expansion adds the mode string to the last line of a multi-line
486 prompt (one with embedded newlines).
487
488 e. There is a new bindable variable, `colored-completion-prefix', which, if
489 set, causes the common prefix of a set of possible completions to be
490 displayed in color.
491
492 f. There is a new bindable command `vi-yank-pop', a vi-mode version of emacs-
493 mode yank-pop.
494
495 g. The redisplay code underwent several efficiency improvements for multibyte
496 locales.
497
498 h. The insert-char function attempts to batch-insert all pending typeahead
499 that maps to self-insert, as long as it is coming from the terminal.
500
501 i. rl_callback_sigcleanup: a new application function that can clean up and
502 unset any state set by readline's callback mode. Intended to be used
503 after a signal.