9 - display_signal_list: if 0 is supplied as an argument to kill -l,
10 display a signal-out-of-range error. Fixes bug reported by
11 Martijn Dekker <martijn@inlv.org>
16 - print_heredoc_bodies: take a list of redirections, all here documents,
17 and print the here-document bodies including the ending delimiter,
19 - print_redirection_list: print the heredoc headers the first time
20 through the list of redirections so we print them in the same left-
21 to-right order they're supplied; print the bodies and delimiters with
22 print_heredoc_bodies after we print all the redirections if we're
23 not printing a list of commands (printing_connection == 0). Fix for
24 problem reported by Isabella Parakiss <izaberina@gmail.com>
25 - print_deferred_heredocs: don't print heredoc headers, since they're
26 now printed in print_redirection_list
27 - print_deferred_heredocs: use print_heredoc_bodies
32 - readarray: update usage synopsis to include -d delim. Report and
33 fix from jhankins@homewood.k12.al.us
36 - test_binop: if op[0] == '-', make sure op[1] != 0 before checking
37 op[2] or op[3]. Fixes out-of-bounds read reported by Franco
38 Costantini <franco.costantini.20@gmail.com>
41 - cond_term: if yylval.word->word[0] == '-' make sure word[1] != 0
42 before checking word[2] and calling test_unop. Fixes out-of-bounds
43 read reported by Franco Costantini <franco.costantini.20@gmail.com>
44 - make sure to check all instances of the return value of the
45 simple_command production before trying to hook redirections onto it,
46 since it can potentially return NULL.
47 Reported by Franco Costantini <franco.costantini.20@gmail.com>
52 - token_is_assignment: make sure to check that the return value from
53 assignment() finds the `=' we just added at index I to avoid false
54 positives from g=g=g=g=g=g=(). Reported by Franco Costantini
55 <franco.costantini.20@gmail.com>
60 - token_is_assignment: if we're not using the bush malloc (which has
61 guard bytes after the requested allocation size), use a new
62 buffer so we can make sure it's big enough to hold the current
63 token and at least two additional characters. Reported by
64 Franco Costantini <franco.costantini.20@gmail.com>
69 - execute_in_subshell: call without_job_control for both job control
70 and non-job-control builds to avoid waiting for last_made_pid
71 inherited from parent shell. Related to fix from 8/4 to
72 initialize_subshell. Fixes bug reported by Martijn Dekker
76 - local_builtin: allow `local --help' to work even when not executing
77 a function. Suggestion from Norm Abramovitz <norm@starkandwayne.com>
82 - bexpand: if passed a null or empty string, return a newly-allocated
83 empty string (so the return value can always be freed) instead of
85 - printstr: if passed a null string, treat it as if it were an empty
86 string so any precision or fieldwidth arguments are handled
87 correctly. Report from isabella parakiss <izaberina@gmail.com>
90 - skip_matched_pair: make the flags argument of 1 affect whether or
91 not backslash can quote characters in the string, so it affects
92 all quoting mechanisms
95 - unbind_array_element: now takes a third (flags) argument; flags&1
96 means to not expand an associative array index. This is only called
97 from a shell builtin context, which means the argument should have
98 already undergone word expansion, so it should be ok. Will still
99 be a problem for uses like "unset -v 'var[$ind]'", quoted to avoid
101 - valid_array_reference: pass second flags argument to skipsubscript;
102 still set to 0 by all callers
105 - unbind_array_element: updated prototype
108 - unset_builtin: add third argument of 1 to unbind_array_element calls
109 [TEMPORARILY DISABLED]
110 - unset_builtin: call valid_array_reference with second arg of 1 to
111 handle unmatched pairs of quotes and [/]
114 - array_reference: optimize access locality as well as sequential
115 access by adding ability to start from last-accessed element and move
116 backwards or forwards depending on the desired index. Inspired by
117 report from Tom McCurdy <tom.j.mccurdy@gmail.com> and followup from
118 Christian Franke <Christian.Franke@t-online.de>
121 - all_array_variables: include associative arrays, not just indexed
122 arrays. Reported by Grisha Levit <grishalevit@gmail.com>
125 - execute_disk_command: if we're optimizing out the fork (CMD_NO_FORK),
126 decrement the shell level so we don't end up incrementing it twice.
127 We should decrement the shell level for an implicit exec like an
128 explicit one. Reported by Stephane Chazelas
129 <stephane.chazelas@gmail.com>
132 - exec_builtin: don't bother to decrement the shell level if we are
133 already in a `(command)' subshell. Reported by Stephane Chazelas
134 <stephane.chazelas@gmail.com>
137 - macro_level: count of macro nesting level, maintained by
138 _rl_push_executing_macro and _rl_pop_executing macro
139 - _rl_with_macro_input: if current nesting level exceeds
140 MAX_MACRO_LEVEL, abort the current command line with _rl_abort_internal
141 and return to the top level. Reported by Christian Klomp
142 <christianklomp@gmail.com>
144 lib/readine/history.c
145 - add_history: if allocating the history list for the first time,
146 make sure the max history list size isn't so large that it will
147 cause allocation errors. Cap it at MAX_HISTORY_INITIAL_SIZE
148 (8192). Reported by Sean Zha <freeman_cha@hotmail.com>
151 - wait_for: if a foreground job with job control enabled is killed by a
152 SIGINT and sourcelevel != 0, act as if we received the SIGINT so the
153 file sourcing can be terminated. Reported by PePa
154 <peterkelly@passchier.net>
159 - read_comsub: only warn once for null bytes in command substitution
160 output, instead of once for every null byte
163 - array_variable_part: now takes a `flags' argument; changed all callers
165 - array_variable_name: now takes a `flags' argument; changed all callers
167 - array_variable_name: pass `flags' argument to skipsubscript instead
171 - array_variable_{name,part}: added new argument to prototypes
176 - bush_directory_completion_hook: don't bother to try and expand a
177 ${ or $( that isn't complete; expand_prompt_string will complain.
178 Fixes reports from John Passaro <john.a.passaro@gmail.com> and
179 Valentin Bajrami <valentin.bajrami@gmail.com>
181 lib/readline/history.c
182 - _hs_append_history_line: use a strategy that attempts to avoid
183 realloc copying memory to a newly-allocated block if the history
184 line we're appending to gets `too long' (currently 256 bytes).
185 We reallocate in powers of 2 starting at 512, and rely on realloc
186 not allocating a new block and copying into it if the size is the
187 same as the last call to realloc. Addresses issue raised by
188 Hubert Schmid <h.schmid@gmx.de>
191 - check_signals: new extern declaration
192 - trapped_signal_received: new extern declaration
195 - read_builtin: if one of the zread* functions returns < 0 (which
196 usually only happens in Posix mode), make sure we call check_signals()
197 before eventually calling run_pending_traps() because zread() isn't
199 - include trap.h for correct extern functions and variable declarations
202 - zread: if executing a builtin, call check_signals_and_traps() for
203 backwards compatibility. If not, call check_signals() only, because
204 we don't want to run traps during, for instance, reading command
205 substitution output. Fixes race condition bug reported by Luiz Angelo
206 Daros de Luca <luizluca@gmail.com>
211 - command_substitute: reset parse_and_execute_level to 0 in the child
212 process, since it's independent of the other parse_and_execute
213 calls. Adds command substitution inside other parse_and_execute
214 calls optimizations to suppress forks, as suggested by
215 Martijn Dekker <martijn@inlv.org>
220 - SHOBJ_STATUS: make sure it defaults to unsupported and is substituted
221 if the shobj-conf script isn't run. Fixes `make install' bug with
222 a minimal config reported by Andrew Tomazos <andrewtomazos@gmail.com>
227 - darwin: set compatibility_version for a shared build of the readline
228 library (the standalone readline distribution shares this file) to
229 $(SHLIB_MAJOR)$(SHLIB_MINOR). Recommendation from Max Horn
235 - array_first_index: new convenience define
238 - ADD_AFTER: new define, complement of ADD_BEFORE
239 - UNSET_LASTREF: now takes an array as an argument, prepping for move
240 of lastref pointer into the array struct
241 - array_insert: check whether we are adding at the beginning of the
242 array and take a fast path if so
243 - array_insert: use same strategy as array_reference to find the place
244 to insert, starting from the last-referenced element and moving
245 forward or back from there; use ADD_AFTER if moving backward
246 - array_insert: if replacing an existing element, just replace the
247 value with new->value instead of the entire element
248 - array_reference: short-circuit quickly if looking for an element
249 before the first assigned index
250 - array_reference: if we don't find the element, leave lastref pointing
251 to the closest element under the assumption we will be assigning or
252 looking for something close
253 - array_reference: take advantage of ordered indexes to short-circuit
254 when looking for element that is not set
259 - array_remove: short-circuit if asked to remove index after max
260 index or before first index
265 - internal_realloc: if we are requesting reallocation to the same size
266 as the block's current size, short-circuit and return `mem' right
267 after doing bounds check
268 - internal_realloc: if we are reducing the size of an allocation, and
269 the new size fits in the next lower bin, just keep the same block
270 and adjust the size, so we can avoid some copies
273 - set_line_mbstate: keep track of the allocated size of
274 shell_input_line_property, only request reallocation if the size
275 increases, but don't let it get too big
280 - wait_for_background_pids: make sure we wait for pid in
281 last_procsub_child since it's not found in any job -- still needs
282 more work to wait for multiple process substitutions
285 - process_substitute: if make_child fails, make sure we call
286 restore_pipeline to undo the previous save_pipeline()
291 - process_substitute,command_substitute: leave subshell_level (reflected
292 as $BUSH_SUBSHELL) intact for any exit trap instead of decrementing
293 it. Suggested by Martijn Dekker <martijn@inlv.org>
295 builtins/evalstring.c
296 - optimize_subshell_command: new function, framework for optimizing
297 out forks for command that have already forked and are executing
298 in a subshell. Not used yet
301 - readtok: if we have a post-increment or post-decrement, and the
302 previous token is not a string, check whether the previous token is
303 a number that results from a pre-increment or pre-decrement, and
304 make that an error. Report from Conrad Hoffmann <ch@bitfehler.net>
309 - BUSH_JOB_CONTROL_MISSING: convert from AC_TRY_RUN to AC_TRY_COMPILE
310 with existing set of preprocessor defines, so it can work when
311 cross-compiling. Suggested by Felix Janda <felix.janda@posteo.de>
316 - get_bushpid: BUSHPID is no longer readonly; assignments to it are
319 doc/{bush.1,bushref.texi}
320 - BUSHPID: note that assignments are ignored and unsetting BUSHPID
321 causes it to lose its special properties
326 - popd_builtin: make sure to check the normalized stack offset
327 (i.e., negatives counting back from the end of the stack) is within
328 bounds before trying to free that stack entry. Report from
329 Fernando Muñoz <fernando@null-life.com>
331 lib/readline/histfile.c
332 - chown: protect calls with HAVE_CHOWN. Fixes for MinGW{64,32} from
333 J. Peter Mugaas <jpmugaas@suddenlink.net>
335 lib/readline/colors.c
336 - S_ISDIR: add define if missing
337 - S_ISUID, S_ISGID, S_ISLNK, S_ISSOCK: don't use unless defined.
338 Fixes for MinGW{64,32} from J. Peter Mugaas <jpmugaas@suddenlink.net>
341 - current_command_line_comment: set to the most recent line in a
342 possibly multi-line command that contains a shell comment; set in
343 maybe_add_history and bush_add_history to either the current
345 - maybe_add_history: set current_command_line_comment for first line
347 - bush_add_history: chars_to_add set to "\n" if the current command line
348 is one greater than the previous line containing a comment
349 (current_command_line_comment). Fixes complaint from back in
350 January, 2016 from Dave Rutherford <dave@evilpettingzoo.com>
353 - lastref: move last-referenced pointer into each array struct, so all
354 arrays can have reference locality
357 - array_create: set lastref element to 0
358 - array_copy: if copying the lastref in array a, set the new lastref
359 in the copy to the same element
360 - IS_LASTREF, LASTREF_START, LASTREF, INVALIDATE_LASTREF, SET_LASTREF,
361 UNSET_LASTREF: change to use new array `lastref' member
364 - quote_string_for_globbing: if quoting for a regexp, make sure to
365 skip and copy a leading `^' in a bracket expression, and skip and
366 copy a subsequent `]' (after an optional `^'), so that leading
367 bracket doesn't close the bracket expression. Report from
368 Stephane Chazelas <stephane.chazelas@gmail.com>
373 - extract_delimited_string: add calls to CHECK_STRING_OVERRUN for
374 $( inside $((, nested OPENERs, nested ALT_OPENERs, and backquotes
375 - skip_to_delim: add calls to CHECK_STRING_OVERRUN for $(, ${,
377 - extract_dollar_brace_string: add calls to CHECK_STRING_OVERRUN for
379 - extract_dollar_brace_string: use skipsubscript to skip over the
380 array subscript in ${var[sub]} (non-quoted case uses string_extract,
381 which already uses skipsubscript). Tagged for bush-5.0
386 - EPOCHSECONDS: new dynamic variable, time in seconds since Unix
387 epoch; assignments are ignored. Can be used on systems where
388 strftime() doesn't support '%s'
389 - EPOCHREALTIME: new dynamic variable, time in seconds since Unix
390 epoch with microsecond granularity
392 doc/{bush.1,bushref.texi}
393 - EPOCHSECONDS documentation
394 - EPOCHREALTIME documentation
397 - decpoint: moved to locale.c, renamed locale_decpoint; changed callers
400 - locale_decpoint: extern declaration or #define if support for
401 localeconv() not there
406 - posix_memalign: add new posix-mandated interface
408 examples/loadables/rm.c
409 - rm: minimal loadable builtin, removes files and directories, only
410 handles -r and -f options. Original from Tim Ruehsen
411 <tim.ruehsen@gmx.de>, heavily rewritten for inclusion as loadable
413 examples/loadables/Makefile.in
414 - rm: add rules to build rm as one of the `other' targets
416 examples/loadables/stat.c
417 - stat: new loadable builtin that takes a filename and loads the info
418 returned by stat(2) into an associative array specified by the -A
419 argument (default STAT)
424 - BUSH_ARGV0: new dynamic variable, returns $0 on reference and sets
425 $0 on assignment. From a suggestion from Rocky Bernstein <rocky@gnu.org>
428 doc/{bush.1,bushref.texi}
429 - BUSH_ARGV0: document
434 - parse_collsym: make sure to not return an out-of-bounds read if a
435 collating symbol is unterminated. Fixes OOB read reported by
436 Jerzy Kramarz <op7ica@gmail.com>
437 - brackmatch: after incrementing p, before checking whether it's a
438 character range, check whether *p was NULL before the increment
439 and short-circuit the bracket expression if it is
442 - discard_last_procsub_child: new function, safely discards
443 last_procsub_child and sets it to NULL
446 - process_substitute: call discard_last_procsub_child instead of
447 calling discard_pipeline directly. Fixes bug reported by
448 Christian Weisgerber <naddy@mips.inka.de>
453 - EX_DISKFALLBACK: new special return status available to builtins;
454 means to attempt to execute a disk command with the same name as
457 examples/loadables/rm.c
458 - if we see the -i option, return EX_DISKFALLBACK
461 - execute_simple_command: if executing a builtin returns EX_DISKFALLBACK,
462 try running execute_disk_command instead
465 - shell_expand_line: use expand_word to expand the readline line
466 buffer, which allows us to pass flags with the word. If a numeric
467 argument is supplied, do not perform quote removal (pass
468 Q_HERE_DOCUMENT since here-doc quoting does the right thing) and
469 do not perform command or process subsitution. From a suggestion
470 by Dabrien 'Dabe' Murphy <dabe@dabe.com> based on an old bug-bush
474 - expand_word_internal: note that we have added a quoted IFS char to
475 istring by setting sentinel has_quoted_ifs. Usually we only add
476 one if we are not going to be performing word splitting, but we
477 will not perform word splitting if there's no expansion, so we need
478 to take care of that case
479 - expand_word_internal: when performing final word split, if there are
480 no expansions but has_quoted_ifs is non-zero, call remove_quoted_ifs()
481 to remove any quoted ifs characters we added while processing
482 - remove_quoted_ifs: new function, removes CTLESC chars preceding
483 (single-byte) chars in IFS. Used when we are not performing word
484 splitting. Fixes bug reported by Martijn Dekker <martijn@inlv.org>
489 - _rl_peek_macro_key: return the next character from the current
490 keyboard macro; the next character from the `next' keyboard macro,
491 if there is one, if at the end of the current macro; or 0 to
492 indicate that we are at the end of a keyboard macro sequence
494 lib/readline/rlprivate.h
495 - _rl_peek_macro_key: extern declaration
497 lib/readline/readline.c
498 - _rl_dispatch_subseq: add test for ESC at the end of a keyboard macro,
499 which should cause the keyboard timeout for ESC to kick in. The
500 previous test didn't run the timeout code if executing from a macro,
501 even if we had read the last character of the macro. Fixes bug
502 reported by Clark Wang <clarkw@vmware.com>
505 - GMATCH: allow trailing backslash in pattern to explicitly match a
506 backslash that is the last character in the string. Bug report from
507 Stephane Chazelas <stephane.chazelas@gmail.com>
512 - display_signal_list: if displaying a signal name corresponding to an
513 exit status > 128, don't display the SIG prefix at all. Old code
514 made displaying the SIG prefix dependent on JOB_CONTROL define.
515 Report and fix from Martijn Dekker <martijn@inlv.org>
518 - execute_subshell_builtin_or_function: call without_job_control even
519 if JOB_CONTROL is not defined. Similar to fix from 9/23.
520 Report from Martijn Dekker <martijn@inlv.org>
523 - execute_simple_command: free memory allocated and passed to
524 make_child in the child process if JOB_CONTROL is defined
525 - execute_command_internal: free memory allocated and passed to
526 make_child in the child process created to run a () subshell or a
527 compound command within a pipeline if JOB_CONTROL is defined
528 - execute_coproc: free memory allocated and passed to make_child in
529 the child process if JOB_CONTROL is defined
530 - execute_disk_command: free memory allocated and passed to
531 make_child in the child process if JOB_CONTROL is defined. This
532 series of fixes is the result of reports from
533 Eduardo A. Bustamante López <dualbus@gmail.com>
538 - u32toutf16: fix to prevent outputting broken surrogate pairs for
539 Japanese locales (ja_JP.UTF-8) on cygwin (which uses UTF-16 natively).
540 Report and fix from Koichi MURASE <myoga.murase@gmail.com>
543 - trap_builtin: if OP is `-' (revert), set the SIGINT signal handler
544 to sigint_sighandler if the shell is interactive and sourcing a
545 file (interactive_shell && sourcelevel) or running a trap
546 (interactive_shell && running_trap) even if it's not currently
547 interactive. Report from Martijn Dekker <martijn@inlv.org>
550 - check for and read multibyte characters in all cases, not just when
551 we are reading a specific number of characters, as long as
555 - expand_word_internal: some improvements to code that converts istring
556 into a WORD_LIST * to avoid multiple allocations and copies of
557 istring, which is already malloc'ed memory -- reduce number of malloc
561 - unary_test: make sure if we test -v array[@] or array[*] that we
562 free the return value from array_value
567 - expcond: make sure to set `noeval' before reading tokens depending on
568 the result of the conditional test, since readtok() can evaluate
569 identifiers (and recursively those containing expressions). Report
570 and fix from Koichi MURASE <myoga.murase@gmail.com>
572 builtins/evalstring.c
573 - should_suppress_fork: make sure to check for traps on EXIT and
574 ERR, since any_signals_trapped() only checks for `real' signals,
575 not the fake shell ones. Fixes bug reported by Werner Fink
577 - optimize_subshell_command: ditto
582 - reader_loop: change so that we don't reset the SIGINT handler every
583 time through the command loop in an interactive shell if the signal
584 is trapped (as the comment noted). Reported by Report from Martijn
585 Dekker <martijn@inlv.org>
588 - parameter_brace_{patsub,remove_pattern,transform,casemod}: save and
589 restore this_command_name while temporarily setting it for use in
590 error messages. Fixes use-after-free error reported by
591 Jerzy Kramarz <op7ica@gmail.com>
592 - string_extract_verbatim: make sure when we increment i by 2 due to
593 a CTLESC or CTLESC-CTLNUL that we don't read past the end of the
594 string. This can happen if the string ends with an odd number of
595 CTLESC chars. Fixes oob-read error reported by
596 Jerzy Kramarz <op7ica@gmail.com>
600 configure.ac,aclocal.m4
601 - BUSH_FUNC_SBRK: make sure sbrk actually works, instead of being just
602 a stub function like on several Linux distributions
605 - malloc_usable_size: return the maximum number of bytes available for
606 a particular memory allocation (size of block allocated for it)
611 - changes to make --enable-profiling work on Linux (-pg, no static link,
612 no -static in LDFLAGS)
615 - changes to make --enable-profiling work on Linux (take
616 ${PROFILE_FLAGS} out of BASE_CCFLAGS, add to CCFLAGS instead; add
617 BASE_LDFLAGS define that doesn't include -pg or -static; use
618 BASE_LDFLAGS in LDFLAGS; move ${PROFILE_FLAGS} and ${STATIC_LD} to
622 - changes to make profiling test suite with gprof work on Linux (set
623 GMON_OUT_PREFIX to handle multiple profiled processes per test;
624 change default filename to gmon.out from bush.gmon; look for
625 gprof output files in ${TMPDIR} instead of /tmp; handle multiple
626 profiling files starting with $GMON_OUT_PREFIX)
629 - locale_isutf8: use locale_charset() if it's available and nl_langinfo
631 - locale_isutf8: add code to parse a locale specification and determine
632 whether the encoding is UTF-8 (or utf8) in the absence of
633 nl_langinfo and locale_charset
634 - set_default_locale: make sure to set locale_utf8locale early on
635 - locale_utf8locale: set via call to locale_isutf8 wherever LANG,
636 LC_ALL, or LC_CTYPE is set
640 lib/readline/display.c
641 - rl_redisplay: handle report of potential integer overflow in
642 horizontal display mode from Mateusz Lenik <mlen@mlen.pl>
645 - mbschr: if in a UTF-8 locale (locale_utf8locale) and we are looking
646 for an ASCII character, use (essentially) strchr as a shortcut
649 - utf8_{mbstrlen,mblen,mbsmbchar,mbsnlen}: UTF-8-specific replacement
650 functions (should also be able to use utf8_mblen in subst.c:
651 string_extract_verbatim)
652 - mbsmbchar: if locale_utf8locale is true, call utf8_mbsmbchar
653 - mbsmbchar: in UTF-8 locale, use utf8_mblen instead of mbrlen (not
654 used if earlier shortcut taken)
657 - u32cconv: don't use nl_langinfo early to call u32toutf8()
658 - u32cconv: use locale_utf8locale to set utf8locale
659 - u32cconv: when initializing (u32init == 0), use locale_charset, then
660 nl_langinfo, then stub_charset to determine the charset
661 - u32cconv: even if we don't have iconv, if locale_utf8locale is non-
662 zero, return u32toutf8
667 - _rl_init_locale: new function, split off code that determines current
668 locale from _rl_init_eightbit, use it to set _rl_utf8locale
670 lib/readiline/rlprivate.h
671 - _rl_init_locale: new extern declaration
673 lib/readline/readline.c
674 - rl_initialize: if not initializing everything the first time, call
675 _rl_init_locale to check current locale and set _rl_utf8locale
678 - _rl_insert_char: optimize cases where we are inserting a single-byte
679 character in a locale with multibyte characters
680 - _rl_insert_char: check whether character is single byte if we know
681 we are in a UTF-8 locale, optimize single-byte case to avoid calls
682 to mbrtowc and memmove/memcpy
684 lib/readline/mbutil.c
685 - _rl_char_value: if we are in a UTF-8 locale (_rl_utf8locale) and the
686 current character does not have the eighth bit set ((c & 0x80) == 0),
687 return that char without bothering to call mbrtowc
688 - _rl_adjust_point: don't bother calling mbrlen if we are in a UTF-8
689 locale and the current character is not a multibyte character
690 - _rl_find_next_mbchar_internal: if we are in a UTF-8 locale, use that
691 to avoid calls to mbrtowc
693 lib/readline/display.c
694 - _rl_col_width: if in a UTF-8 locale, take advantage of that to avoid
695 calls to mbrlen and mbrtowc
696 - rl_redisplay: if in a UTF-8 locale, take advantage of that to avoid
701 lib/readline/histlib.h
702 - PATTERN_SEARCH: new flag for history search interfaces, means to
703 search for a pattern as Posix specifies
705 lib/readline/histsearch.c
706 - history_search_internal: now takes a `flags' argument instead of just
707 an `anchored' argument to accommodate PATTERN_SEARCH
708 - _hs_history_patsearch: new internal interface to use when flags
709 specify PATTERN_SEARCH
711 lib/readline/rlprivate.h
712 - SF_PATTERN: new flag for non-incremental search contexts, means to
713 treat search string as a pattern (maps to PATTERN_SEARCH)
715 lib/readline/search.c
716 - noninc_dosearch: takes an additional `flags' argument for SF_PATTERN
717 - noninc_search_from_pos: takes an additional `flags' argument for
719 - noninc_dosearch: pass flags argument through to noninc_search_from_pos
720 - _rl_nsearch_init: if we are in vi command mode, and `pchar' (key used
721 to invoke the search) is `?' or `/', add SF_PATTERN to the flags
722 to conform to Posix spec for vi-mode editing
723 - _rl_nsearch_dosearch: if cxt->sflags indicates that we should do a
724 pattern search, pass SF_PATTERN to noninc_search_from_pos
725 - rl_noninc_forward_search_again: if in vi command mode and key == `N',
726 make sure flags arg passed to noninc_dosearch includes SF_PATTERN
727 - rl_noninc_reverse_search_again: if in vi command mode and key == `n',
728 make sure flags arg passed to noninc_dosearch includes SF_PATTERN
729 - rl_history_search_internal: pass extra flags arg to noninc_search_from_pos
733 lib/readline/search.c
734 - noninc_search_from_pos: takes a new argument, a pointer to int where
735 it stores the offset of the match in the history line (if non-NULL),
737 - rl_history_search_internal: pass newcol pointer to
738 noninc_search_from_pos to avoid having to recompute the match offset
739 in the matching history entry
742 - define HAVE_FNMATCH if we have the fnmatch function (configure was
743 already checking for it)
745 lib/readline/histsearch.c
746 - _hs_history_patsearch: transform the pattern into one ending in a
747 `*' to avoid having to perform multiple match attempts from each
748 index in the history line
749 - history_search_internal: changes to handle pattern matching if
750 PATTERN_SEARCH is in the flags and HAVE_FNMATCH is defined. This
751 makes vi-mode history searching treat the user-specified search
752 string as an fnmatch pattern, as Posix requires. Fixes issue
753 reported by <jwdevel@gmail.com>
758 - shopt_enable_hostname_completion: only declare this if READLINE
759 defined, since that's the only time it's used. Reported by
760 isabella parakiss <izaberina@gmail.com>
765 - display_signal_list: make `kill -l 0' print `EXIT', modifying change
771 - expand_word_internal: when the shell encounters a backslash as the
772 last character of the string, don't try to add a '\'0' to the end
773 of the string if the string is quoted, just add a <CTLESC><\> and
774 skip to the end of string processing. Fixes oob-read error
775 reported by Jerzy Kramarz <op7ica@gmail.com>
778 - two_arguments: check argv[pos][1] before checking argv[pos][2] when
779 looking for a unary argument. Fixes oob-read error on single `-'
780 in unary operator position reported by Jerzy Kramarz
782 - ANDOR: check s[1] before checking s[2] in case s[1] == end of string.
783 Fixes oob-read error reported by Jerzy Kramarz <op7ica@gmail.com>
786 - command_substitute: now takes additional flags argument, changed one
787 caller (param_expand) to pass through PF_ASSIGNRHS flag; other callers
789 - command_substitute: pass through flags argument to read_comsub
790 - read_comsub: now takes additional new flags argument to indicate
791 whether or not the word is in a context where word splitting will
792 eventually be performed
793 - read_comsub: if we are running in a context where word splitting
794 will not take place (PF_ASSIGNRHS), we read a CTLESC, and CTLESC is
795 in $IFS, add a CTLESC to make sure it gets through a round of
801 - xparse_dolparen: since reset_parser frees the pushed string list,
802 and this is supposed to be a separate parsing context, we need to
803 save and restore pushed_string_list around the call to parse_string
804 and reset_parser. Fixes bug reported by Dan Douglas
808 - HISTEXPAND_DEFAULT: default value of history_expansion, moved here
812 - histexp_flag: new variable, this is what set -H/set -o histexpand
813 sets; history_expansion set to value of this variable; defaults to 0
814 - history_expansion: now set to HISTEXPAND_DEFAULT
817 - bush_history_reinit: if interact == 0, set history_expansion to the
818 value of histexp_flag, to allow -H option to enable history
820 - bush_history_reinit: if interact == 0, make sure
821 history_expansion_inhibited is set opposite of histexp_flag, so
822 enabling history expansion with -H invocation option turns off
823 inhibited expansion. If interactive shell, we turn it off so
824 history_expansion controls whether or not history expansion takes
825 place. In practice, this function is always called with interact == 0,
826 and -c command still doesn't perform history expansion
829 - init_interactive: make sure histexp_flag and history_expansion are
830 identical in an interactive shell; allows both -H/+H option and
831 default compilation options (HISTEXPAND_DEFAULT) to work
836 - get_word_from_string: take advantage of the fact that SEPARATORS is
837 always a (possibly local) copy of IFS, so build a local charmap of
838 separators and use it instead of the (cached and possibly stale)
839 ifs_cmap map and isifs macro. Fixes bug with -N stripping leading
840 whitespace reported by Clark Wang <clarkw@vmware.com>
845 - read_builtin: make `i' volatile, since auto variables are technically
846 undefined after a longjmp, and a timeout on SIGALRM causes one.
847 Fix suggested by Dmitry Goncharov <dgoncharov@users.sf.net>
852 - shell_getc: if we are reading input from a string, and we get the
853 ending '\0', and we are not expanding an alias, return EOF right
854 away. It might be an eval'ed string that has a syntax error.
855 Fixes bug reported by Dan Douglas <ormaaj@gmail.com>
860 - expand_word_internal: if we're expanding a quoted string containing
861 a tilde as the first character of a word, only expand the tilde if
862 we're expanding an array subscript (Q_ARRAYSUB), not if we're
863 expanding any arithmetic expression (Q_ARITH). This fixes a
864 backwards compatibility issue with expressions like ~0 reported by
865 Bize Ma <binaryzebra@gmail.com>
868 - parameter_brace_expand_indir: if the variable is not special and
869 the indirect variable is unset (!variable where variable is unset),
870 report an error. This is a slight incompatibility with previous
871 versions, which did not differentiate between indirecting an unset
872 variable and an indirect expansion resulting in an unset variable.
873 Fixes omission reported by otenba@protonmail.com
877 lib/readline/doc/{rluser.texi,readline.3},doc/bush.1
878 - do-uppercase-version: since this doesn't actually exist, replace it
879 with do-lowercase-version, with the caveat that do-lowercase-version
880 results in undefined behavior if bound to a character that's
881 already lowercase. Suggested by Branden Robinson
882 <g.branden.robinson@gmail.com>
884 lib/readline/doc/rluser.texi
885 - history-substring-search-forward: was misspelled as "substr-search";
886 ditto for search-backward
889 - history-substring-search-{backward,forward}: add documentation, text
890 straight from readline.3
893 - initialize_job_control: if the terminal's process group is valid,
894 but the shell is not the foreground process, check for terminating
895 signals (like SIGHUP, which the kernel would send if the process
896 group were orphaned) during the loop where we try to stop the shell
897 if it's not in the foreground. Not a perfect solution; the kernel
898 might not send SIGHUP
903 - initialize_job_control: only go through the SIGTTIN loop 16 times at
904 most before deciding we're in the background and probably a member of
905 an orphaned process group; set original_pgrp to the terminal's pgrp
906 (so the eventual give_terminal_to doesn't leave the terminal in the
907 wrong pgrp); and bail on job control initialization
910 - unset SHELLOPTS to avoid its options `polluting' the test
911 environment. Suggestion from Vladimir Marek
912 <Vladimir.Marek@oracle.com>
915 - use $PWD/exec8.sub to protect against someone who has a cd command
916 in his bushrc. Report from Vladimir Marek
917 <Vladimir.Marek@oracle.com>
922 - open_shell_script: call end_job_control before exiting the shell in
923 case we were run as `bush -i script' and there is a problem with
924 executing `script'. If we don't, the terminal ends up in the wrong
925 process group. Fix from Clark Wang <clarkw@vmware.com>
930 - read_comsub: if we look for a character following a `<' and it's
931 not `<' (indicating that we don't have to read a here-document),
932 make sure we push that character back and go through the loop again
933 so we note the right word start location. Fixes bug reported by
934 parasite parasite <42parasite@gmail.com>
937 - parameter_brace_expand_indir: clean up checks for unset variables to
938 minimize incompatibilities with previous versions
942 lib/readline/history.c
943 - add_history: don't update history_length until all of the updates to
944 the_history are complete, so history_length is always consistent.
945 Report and fix from Hong Cho <hong.cho@citrix.com>
948 - bush_backward_shellword: fix to work better at the end of the line,
949 with multiple trailing whitespace characters. Inspired by report
950 from Kirill Timofeev <kt97679@gmail.com>
953 - bushbug: use `^' as the sed delimiter instead of `%'; some compilers
954 use `%' in CFLAGS. Report from Vladimir Marek
955 <Vladimir.Marek@oracle.com>
960 - test_unop: make sure op[1] != 0 before testing op[2]
961 - term: make sure argv[pos][1] != 0 before testing argv[pos][2]. Fixes
962 oob-read reported by Jerzy Kramarz <op7ica@gmail.com>
967 - glob_filename: assign the return value of realloc (results, ...) to
968 a temp pointer, so if realloc returns NULL, we make sure we free
969 results. Report from Kirill Timofeev <kt97679@gmail.com>
974 - sh_backslash_quote: if FLAGS&2, backslash-quote other single-byte
975 characters that are in the current locale's <blank> character class
978 - printf_builtin: when processing the `%q' format, make sure to
979 backslash quote all <blank> characters by making sure that FLAGS
980 passed to sh_backslash_quote includes 2. Fixes issue for certain
981 iso-8859-1 locales where character 160 (octal 240, hex 0xa0) is a
982 non-breaking space. Report from Stephane Chazelas
983 <stephane.chazelas@gmail.com>
986 - sh_stat: if DEV_FD_STAT_BROKEN is defined, take /dev/fd/N and turn
987 it into a stat on file descriptor N, as if /dev/fd were not
988 available. This is the case on some old versions of SunOS. Report
989 and patch from Dmitry Goncharov <dgoncharov@users.sf.net>
992 - DEV_FD_STAT_BROKEN: add define
995 - --enable-dev-fd-stat-broken: new command-line option, defines
996 DEV_FD_STAT_BROKEN if supplied at configure time
999 - --enable-dev-fd-stat-broken: document new command-line option for
1003 - assoc_expand_once: new variable, declared here just because
1006 - assoc_expand_once: extern declaration
1007 - AV_NOEXPAND: new flag value for the array_value family of functions:
1008 means to not run associative array subscripts through word expansion
1011 - unset_builtin: call unbind_array_element with assoc_expand_once as
1012 third arg, controls whether we expand associative array subscripts
1013 (if 1, we suppress the usual expansion). With accompanying shopt,
1014 provides backwards compatible option to solve problem with quotes
1015 and other characters in associative array subscripts pointed out
1016 most recently by Mingye Wang (Arthur2e5) <arthur200126@gmail.com>
1019 - assoc_expand_once: new option, controls value of internal variable
1020 with the same name. Currently undocumented because I'm not completely
1024 - evalexp: now takes a second argument, flags. Changed all callers in
1025 multiple other files (builtins/let.def,execute_cmd.c,arrayfunc.c,
1026 subst.c,test.c,variables.c)
1029 - EXP_EXPANDED, new flag for second argument to evalexp
1032 - let_builtin: add EXP_EXPANDED to flags passed to evalexp
1035 - execute_arith_command: add EXP_EXPANDED to flags passed to evalexp,
1036 since the command string is run through expand_words_no_vars before
1040 - set expression-global variable already_expanded if flags arg to
1041 evalexp contains EXP_EXPANDED
1042 - if assoc_expand_once option set and already_expanded flag set, pass
1043 1 in flags to array_variable_part to skip over quotes and expansions
1045 - if those two variables set, pass AV_NOEXPAND as flag to
1046 get_array_value to prevent word expansions on the subscript
1049 - if flags passed to unbind_array_element includes 1, pass flag on to
1050 skipsubscript so we don't expect matched quotes or process
1051 expansions in the subscript
1052 - if flags to array_value_internal include AV_NOEXPAND, pass 1 as flag
1053 to array_variable_part to pass along to skipsubscript
1054 - if flags to array_value_internal include AV_NOEXPAND, don't call
1055 expand_assignment_string_to_string; just use the unexpanded subscript
1056 to produce the key [THIS IS A WORK IN PROGRESS]
1061 - ASS_NOEXPAND: assignment flag that inhibits expansion of associative
1065 - bind_int_variable: takes new flags arg; flags are taken from the
1066 ASS_ set of assignment flags, changed callers (bushline.c, expr.c,
1068 - bind_int_variable: if flags includes ASS_NOEXPAND, pass 1 as flag to
1069 valid_array_reference and array_variable_part to pass along to
1070 skipsubscript, so we don't try to skip over quoted strings in the
1072 - bind_int_variable: pass flags along to assign_array_element
1075 - bind_int_variable: updated extern declaration with new flags arg
1078 - expr_bind_variable: if the assoc_expand_once option is enabled, and
1079 the flags to evalexp indicate that we have already run the expression
1080 through word expansion, pass ASS_NOEXPAND as flag to bind_int_variable
1083 - assign_array_element: if flags includes ASS_NOEXPAND, pass 1 as flag
1084 to array_variable_name to pass along to skipsubscript
1085 - assign_array_element: if flags includes ASS_NOEXPAND, don't run an
1086 associative array subscript through word expansion, just use as-is
1089 - param_expand: call evalexp with EXP_EXPANDED flag for arithmetic
1090 substitution because the string has already been expanded with
1096 - read_builtin: use value of assoc_expand_once for valid_array_reference
1098 - bind_read_variable: if assoc_expand_once is set, pass ASS_NOEXPAND
1099 to assign_array_element
1102 - assignment: instead of checking whether flags == 0 to allow a `[',
1103 explicitly check for (flags&1) to disallow it. This leaves the door
1104 open for additional flag values
1107 - printf_builtin: use value of assoc_expand_once for
1108 valid_array_reference as with other uses
1109 - bind_printf_variable: if assoc_expand_once is set, pass ASS_NOEXPAND
1110 to assign_array_element
1114 builtins/history.def
1115 - change history -d option to handle negative arguments; negative
1116 arguments offset from the end of the history list (last_position + 1
1117 so history -d -1 deletes the history -d command that just got
1118 added). Original patch from Piotr Grzybowski <narsil.pl@gmail.com>
1120 doc/bush.1,lib/readline/doc/hsuser.texi
1121 - documented new behavior of negative offsets for `history -d'
1125 lib/readline/history.c
1126 - remove_history: use memmove to move the history list around instead
1127 of a loop that copies pointers one at a time, similar to add_history
1132 - linux: make sure PGRP_PIPE is defined unconditionally for all kernel
1133 versions greater than 2.3.*
1135 lib/readline/history.c
1136 - clear_history: when clearing the history, reset history_base to 1
1138 - remove_history_range: new function, removes a set of history entries
1139 and returns them all for deallocation
1141 lib/readline/history.h
1142 - remove_history_range: extern declaration
1147 - eval_arith_for_expr: pass EXP_EXPANDED to evalexp, since we run the
1148 expression through expand_words_no_vars
1153 - b_fill_buffer: when read returns EOF or error, and we reset the
1154 buffer and pointers, reset the input pointer to 0. Fixes issue
1155 reported by Stephane Chazelas <stephane.chazelas@gmail.com>
1159 arrayfunc.[ch],subst.c
1160 - array_expand_index: added new FLAGS argument, reserved for future use,
1167 - can_optimize_assignment,optimized_assignment: see if we can detect
1168 whether or not we're trying to append a string to a string variable,
1169 and optimize that using realloc/strcpy. Based on a log-ago
1170 suggestion from Aharon Robbins <arnold@skeeve.com>
1175 - help_builtin: don't pass return value from ngettext() directly to
1181 - set_signal_handler: set SA_RESTART for SIGWINCH, so window size
1182 changes don't interrupt open/read/write. Suggested by
1183 Andriy Prystupa <andriy.prystupa@globallogic.com> back in 10/2016
1188 - coproc_pidchk: if MULTIPLE_COPROCS, call cpl_search to find coproc
1189 associated with pid, don't remove it from the list with cpl_delete.
1190 Just mark as dead and wait for coproc_reap/cpl_reap to take care
1192 - execute_coproc: NEW FEATURE: run the coproc name through word
1193 expansion before creating the coproc; this allows unique coprocs
1194 to be created in loops. Originally requested way back in 2012 by
1195 Erik Brandsberg <ebrandsberg@juniper.net>
1198 - subshell_com: now has a line number member: line
1201 - make_subshell_command: assign current line number (line number of the
1202 ending right paren) to `line' member
1205 - copy_subshell_command: copy the `line' member
1208 - execute_command_internal: when executing a user subshell (`(command)'),
1209 set the line number and line number for the ERR trap from the line
1210 number saved in the subshell command struct. Fix from
1211 Eduardo A. Bustamante López <dualbus@gmail.com>
1212 - execute_arith_command: set line number for ERR trap from line number
1213 saved in the arith command struct. Fix from
1214 Eduardo A. Bustamante López <dualbus@gmail.com>
1215 - execute_cond_command: set line number for ERR trap from line number
1216 saved in the cond command struct. Fix from
1217 Eduardo A. Bustamante López <dualbus@gmail.com>
1220 - bind_variable_internal: move can_optimize_assignment call to the
1226 - find_variable_nameref: treat a circular variable reference as
1227 referring to a variable of that name in the global scope (for now),
1228 if one exists. PROVISIONAL change: inspired by suggestion back in
1229 6/2016 by Grisha Levit <grishalevit@gmail.com>
1233 {expr,general,hashcmd}.c
1234 - include flags.h for flag values
1237 - include shell.h instead of the files it includes
1240 - new extern declarations for want_pending_command, read_from_stdin
1243 - add extern declaration for expanding_redir, assigning_in_environment
1246 - add extern declaration for running_trap
1249 - added extern declarations for variables declared in execute_cmd.c,
1250 changed files that declare lots of extern variables
1253 - added extern declarations for variables declared in shell.c,
1254 changed files that declare lots of extern variables
1257 - added extern declarations for variables declared in parse.y,
1258 changed files that declare lots of extern variables
1260 [lots of changes to reduce the number of extern declarations in C and DEF files]
1263 - xparse_dolparen: need ALIAS or DPAREN_ARITHMETIC to be defined to
1269 - termsig_handler: don't call end_job_control if subshell_environment
1270 indicates that we're in a command or process substitution.
1271 Provisional fix for bug reported by Russell King <rmk@armlinux.org.uk>
1274 - end_job_control: only attempt to give the terminal back to
1275 original_pgrp if job_control != 0; don't test interactive_shell
1278 - execute_disk_command: call QUIT after search_for_command, since
1279 the only time QUIT gets called is when the path is actually
1280 searched. It doesn't happen for an absolute pathname. Fix for
1281 bug reported by Russell King <rmk@armlinux.org.uk>
1286 - extglob_skipname,wextglob_skipname: if we don't find a reason to
1287 not skip the name in any subpattern (r returns 0 for any subpattern),
1288 return 1 because we should skip the name
1289 - extglob_skipname,wextglob_skipname: if we don't find a reason to
1290 not skip the name in any subpattern, but the first part of the extglob
1291 pattern is a wildcard (`*(pat)'), check the rest of the pattern, if
1292 any, to decide whether or not to skip the name. Fixes bug reported
1293 by Grisha Levit <grishalevit@gmail.com>
1295 lib/glob/glob_loop.c
1296 - CHAR -> GCHAR (unsigned char); change uses of CHAR to GCHAR
1299 - wchkname -> wskipname
1300 - wskipname: now takes a third `flags' argument, like the other variants
1306 - here_document_to_fd: set the file descriptor open for writing to the
1307 here document to be close-on-exec. Fixes bug reported by
1308 Siteshwar Vashisht <svashisht@redhat.com>
1313 - match_pattern_char,match_pattern_wchar: moved to gm_loop.c (new file),
1314 compile twice for single and wide characters as with the rest of
1316 - umatchlen,wmatchlen: ditto
1317 - extglob_pattern_p: move to gm_loop.c, generalize for regular and
1322 lib/readline/complete.c
1323 - stat_char: fix small memory leak if stat/lstat returns -1
1326 - bush_filename_stat_hook,bush_directory_completion_hook: make sure
1327 expand_prompt_string is caled wth W_NOPROCSUB flag
1328 - directory_exists: don't dequote the filename passed as an argument;
1329 this function should never get quoted pathnames
1332 - expand_word_internal: when calling expand_word_internal recursively
1333 after reading a double-quoted string, make sure the W_NOCOMSUB and
1334 W_NOPROCSUB flags make it to the recursive invocation. Fixes bug
1335 reported by Jens Heyens <jens.heyens@cispa.saarland>
1339 lib/readline/signals.c
1340 - _rl_orig_sigset: original signal mask, set and restored by
1341 rl_set_signals (rl_clear_signals doesn't block signals). If we
1342 are not installing signal handlers, just save signal mask each
1343 time rl_set_signals is called
1345 lib/readline/input.c
1346 - rl_getc: use _rl_orig_sigmask in the call to pselect(), so we block
1347 the set of signals originally blocked by the calling application.
1348 Fixes bug reported by Frédéric Brière <fbriere@fbriere.net>
1351 - yy_readline_get: try to unset NONBLOCK mode on readline's input
1352 file descriptor before calling readline(). Inspired by report from
1353 Siteshwar Vashisht <svashisht@redhat.com>
1358 - parse_comsub: don't unconditionally set the LEX_WASDOL flag when we
1359 see a `$'; we should toggle it to accommodate things like $$.
1360 Fixes bug reported by Christian Weisgerber <naddy@mips.inka.de>
1361 - parse_matched_pair: do the same thing with LEX_WASDOL
1366 - JWAIT_PERROR,JWAIT_FORCE: new defines for the wait_for_ family of
1370 - wait_for_job, wait_for_any_job: take new flags argument for use by
1372 - wait_for_job: if JWAIT_FORCE flag supplied, loop waiting for job to
1373 terminate instead of change state
1374 - wait_for_single_pid: if JWAIT_FORCE flag supplied, loop waiting for
1375 child process to terminate instead of change state
1378 - takes a new `-f' option, signifying to wait until the specified job
1379 or process terminates, instead of changes state
1381 doc/{bush.1,bushref.texi}
1382 - wait: document the new -f option and its behavior when job control
1384 - job control: add a paragraph describing how the wait builtin changes
1385 behavior when job control is enabled: it returns when a job changes
1390 examples/loadables/fdflags.c
1391 - fdflags: new loadable builtin to set and unset file descriptor flags
1392 (such as non-blocking, though bush undoes that) for descriptors bush
1393 has open. Developed in consultation with Christos Zoulas
1394 <christos@zoulas.com>
1400 - rl_previous_screen_line: attempt to move to the same column on the
1401 previous screen line of the current readline buffer by moving back
1402 a number of characters equal to the screen width
1403 - rl_next_screen_line: attempt to move to the same column on the
1404 next screen line of the current readline buffer by moving forward
1405 a number of characters equal to the screen width. Both originally
1406 suggested by Hans Ginzel <hans@matfyz.cz>
1408 lib/readline/readline.h
1409 - rl_{next,previous}_screen_line: extern declarations
1411 lib/readline/funmap.c
1412 - {next,previous}-screen-line: new bindable command names
1414 lib/readline/doc/{rluser.texi,readline.3}
1415 - {next,previous}-screen-line: document behavior, including limitations
1419 lib/readline/input.c
1420 - rl_read_key: when reading input from a macro, make sure to return
1421 the next character as an unsigned char, so we handle multibyte
1422 character sequences correctly. Report and fix from Grisha Levit
1423 <grishalevit@gmail.com>
1428 - --pretty-print: new invocation option, currently undocumented, dumps
1429 a pretty-printed version of a shell script given as an argument to
1431 - main: call pretty_print_loop() if we're in pretty-printing mode in
1432 a non-interactive shell
1435 - pretty_print_loop: new function, similar to reader_loop, reads
1436 commands and prints them by displaying the result from
1437 make_command_string()
1440 - pretty_print_loop: new extern declaration
1444 doc/{bush.1,bushref.texi}
1445 - here strings: correct documentation to note they do not undergo
1446 brace expansion. Report from Conor McCarthy <mr.spuratic@gmail.com>
1450 lib/readline/display.c
1451 - expand_prompt: instead of recomputing the line break offsets for
1452 prompts that span multiple screen lines on every call to rl_redisplay,
1453 do it here. Manage a local array local_prompt_newlines; set an offset
1454 every time `physchars' hits a multiple of the screen width. Inspired
1455 by https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843819
1456 - rl_redisplay: don't calculate multi-line prompt line break indices
1457 here; use the values calculated by expand_prompt
1458 - rl_{save,restore}_prompt: save and restore local_prompt_newlines
1462 lib/readline/mbutil.c
1463 - _rl_find_prev_mbchar_internal: since we're traversing the string
1464 from the beginning, shortcut non-multibyte characters in a UTF-8
1468 - parse_comsub: if we are parsing a here document with a quoted
1469 delimiter (LEX_QUOTEDDOC), we should not remove <backslash><newline>
1470 pairs from the body of the here document. Need to add LEX_QUOTEDDOC
1471 to the values in tflags when calling shell_getc. Fixes bug reported
1472 by Michael Homer <michael.homer@ecs.vuw.ac.nz>, patch was originally
1473 contributed by Geir Hauge <geir.hauge@gmail.com>
1478 - bgp_add: if hashed pid collides with bgpids.head index, print a
1479 warning and move to the next index. Attempt to avoid collision
1480 problem reported by Graham Northup <northug@clarkson.edu>
1485 - process_substitute: call remove_quoted_escapes on the command string
1486 like command substitution does, since the string will be run through
1487 the parser again. Fixes bug reported by David Simmons
1488 <bug-bush@tmp.davidsimmons.com>
1491 - STATIC_PATH_VALUE: new config variable, undefined by default
1494 - shell_initialize: if STATIC_PATH_VALUE is defined, use it to set the
1495 PATH variable at shell startup, overriding the environment and any
1496 value for DEFAULT_PATH_VALUE. Based on a suggestion from
1497 Lonnie Abelbeck <lonnie@abelbeck.com>
1502 - maybe_make_restricted: clear the hash table before making the PATH
1503 variable read-only by calling stupidly_hack_special_variables.
1504 Suggestion from Lonnie Abelbeck <lonnie@abelbeck.com>
1507 - expand_string_for_pat: change expansion of WORD in ${param[%[%]][#[#]]word}
1508 to use this new function, initially identical to
1509 expand_string_for_rhs
1510 - getpattern: use expand_string_for_pat to expand the pattern
1515 - expand_string_for_rhs: now that this is only used to expand the RHS
1516 of the various non-pattern ${paramOPword} expansions, set
1517 expand_no_split_dollar_star depending on whether or not the entire
1518 brace expansion is going to be subjected to word splitting: if it's
1519 quoted or if IFS is set but null, we will not be splitting so we set
1520 this to 1 and let $* expand to separate fields separated by a space.
1521 This was heavily debated back in October 2014 and resulted in Posix
1522 interp 888. Reported by Martijn Dekker <martijn@inlv.org>
1527 - expand_string_for_rhs: now takes `op' (brace expansion operator) as
1528 an additional argument; changed call in parameter_brace_expand_rhs
1529 - expand_string_for_rhs: make sure to set expand_no_split_dollar_star
1530 if `op' is `=', since we are supposed to preserve the assignment
1531 statement expansion semantics on the RHS of ${param=word}
1534 - bgp_delindex: make sure to set ps->pid to NO_PID so we more
1535 effectively remove it from the hash table. It shouldn't matter as
1536 long as nothing in pidstat_table points to it, but better to be safe
1537 - bgp_delete,bgp_search: generalize previous collision detection to
1538 loop detection: abort search if we are going to go back to the
1539 first index we tried
1543 lib/readline/vi_mode.c
1544 - rl_vi_bword: if we're trying to move backward to non-whitespace
1545 in a line that begins with whitespace, make sure we don't move
1546 point to 0 and test memory locations before the start of the
1547 buffer. Report and fix from Jason Hood <jadoxa@yahoo.com.au>
1549 lib/readline/display.c
1550 - expand_prompt: if _rl_screenwith == 0, call rl_reset_screen_size to
1551 initialize it. If it's still 0 after that, guess that the screen
1552 width is 80 and use that to guess how many screen lines the prompt
1555 lib/readline/readline.c
1556 - readline_internal_setup: if in emacs editing mode, and we are
1557 showing the editing mode in the prompt, call _rl_reset_prompt() to
1558 make sure that the updated setting of _rl_show_mode_in_prompt
1559 (presumably set in an inputrc file) is reflected in the redisplay
1560 performed by rl_callback_newline via readline_internal_setup.
1561 Fix from Jason Hood <jadoxa@yahoo.com.au>
1565 builtins/complete.def
1566 - print_one_completion,print_compopts: make sure to display the
1567 `nosort' and `noquote' options if they've been set for a particular
1568 compspec. Fix from Grisha Levit <grishalevit@gmail.com>
1571 - read_builtin: if -e is supplied, read needs to free rlbuf before
1572 returning, since it uses discard_unwind_frame at that point. Bug
1573 and fix from ZhangXiao <xiao.zhang@windriver.com>
1576 - execute_for_command: when using a nameref as the for loop control
1577 variable, make sure we check for readonly namerefs and make sure
1578 that we force bind_variable to enforce restrictions on nameref
1579 assignments. Fix from Grisha Levit <grishalevit@gmail.com>
1584 - make_absolute: convert deprecated cygwin_conv_to_full_posix_path
1585 to cygwin_conv_path (CCP_WIN_A_TO_POSIX, ...)
1587 {shell,variables}.c,config-top.h
1588 - modify change from 2/17: rename STATIC_PATH_VALUE to RBUSH_STATIC_PATH_VALUE;
1589 don't use it in shell_initialize; set PATH to it just before
1590 imposing restricted shell restrictions
1595 - expand_string_for_rhs: revert change from 2/19 concerning setting
1596 expand_no_split_dollar_star so we are consistent with the Posix
1597 examples. This anticipates Martijn Dekker initiating an austin
1598 group discussion about this case
1603 - gen_shell_function_matches: if COMPREPLY is an associative array,
1604 don't coerce it to an indexed array, which will fail to produce any
1605 matches anyway. Report from Grisha Levit <grishalevit@gmail.com>
1606 - bind_comp_words: if COMP_WORDS exists as a nameref variable, ignore
1607 the nameref attribute. Report from Grisha Levit
1608 <grishalevit@gmail.com>
1611 - parameter_brace_expand: if expand_no_split_dollar_star is set, make
1612 sure chk_atstar treats ${var[*]} as quoted by passing Q_DOUBLE_QUOTES
1613 as the second argument. Fixes differing treatment of $* and ${v[*]}
1614 reported by Grisha Levit <grishalevit@gmail.com>, because otherwise
1615 *contains_dollar_at gets set to 1 and the word is inappropriately
1621 - expand_word_list_internal: if a variable assignment fails (e.g., due
1622 to a readonly variable) in a non-interactive posix mode shell, don't
1623 abort the shell if the assignment is being performed by the command
1624 builtin, even if it's something like `command eval v=1'. Fixes
1625 RedHat bug https://bugzilla.redhat.com/show_bug.cgi?id=1389838
1626 (reported by Denys Vlasenko)
1631 - set_compatibility_level: make sure that changing the compatibility
1632 level sets or modifies BUSH_COMPAT. Fixes bug reported by
1633 Stephane Chazelas <stephane.chazelas@gmail.com>
1636 - is_cclass: broke into two functions: is_valid_cclass and cclass_test,
1637 for future expansion. No functionality change
1640 - BRACKMATCH: when testing a character against a character class name,
1641 use the unfolded (original) character, since we're not performing a
1642 comparison. This is what glibc does. Fixes bug reported by
1643 Lukáš BaÅinka <lukas.barinka@boxtrap.net>
1647 doc/{bush.1,bushref.texi}
1648 - note that the arguments to -eq and the rest of the arithmetic
1649 operators are evaluated as expressions when using [[. Report from
1650 Rob la Lau <rob@ohreally.nl>
1655 lib/readline/display.c
1656 - update_line: completely rewrote the code that handles line wrapping
1657 in the presence of multibyte/double-width characters; punts to a
1658 dumb update in cases where the number of screen positions doesn't
1660 - update_line: in one case, where we are deleting characters from the
1661 line, if we are writing a non-space into the last screen character
1662 position, note that we are no longer using a space as a placeholder
1663 for a line wrap where there is a multi-width character that won't
1664 fit on the screen line (wrapped_line[current_line+1] = 0)
1668 lib/readline/readline.c
1669 - bind_arrow_keys_internal: add default key bindings for control-
1670 arrow keys, suggested by Per Bothner <per@bothner.com>
1674 doc/{bush.1,bushref.texi}
1675 - clarify the prompt strings the undergo expansion (PS0, PS1, PS2, and
1676 PS4) before being displayed. Based on a report from Grisha Levit
1677 <grishalevit@gmail.com>
1682 - bufstream_ungetc: return EOF if being asked to unget a character to
1684 - buffered_getchar: check buffered_fd is valid and buffers[buffered_fd]
1685 is non-NULL before trying to dereference. Fixes bug reported by
1686 floyd <floyd@floyd.ch>
1689 - execute_null_command: if we fork to execute the command, the subshell
1691 - execute_null_command: for safety's sake, if a redirection attached
1692 to a null command affects fd 0 or the fd the shell is reading for
1693 input, and the redirection can potentially change or close that file
1694 descriptor, force a fork so the redirection is done in a subshell
1698 lib/readline/display.c
1699 - update_line: if we have to output some bytes, and we are outputting
1700 the prompt string, make sure we correct _rl_last_c_pos if we are
1701 at the wrap offset -- what if all of the characters in the prompt
1702 are invisible, so the visible length is 0? Fixes display bug
1703 reported by Grisha Levit <grishalevit@gmail.com>
1706 - undo_partial_redirects: new function, performs redirections specified
1707 in redirection_undo_list and disposes of them. Intended to be used
1708 to unwind redirections performed before a redirection error
1709 - dispose_partial_redirects: new function, disposes of
1710 redirection_undo_list and nulls the list
1711 - execute_command_internal: use undo_partial_redirects
1714 - undo_partial_redirects: extern declaration
1715 - dispose_partial_redirects: extern declaration
1718 - exp_jump_to_top_level: if we are throwing an expansion error while
1719 expanding a redirection (expanding_redir != 0), undo any undoable
1720 redirections by calling undo_partial_redirects() so we don't leave
1724 - initialize_shell_variables: if SHELLOPTS is in the environment,
1725 unset the readonly attribute on any existing variable with that
1726 name. It may have been created by processing a -o option on the
1727 command line. Fixes issue reported by Stephane Chazelas
1728 <stephane.chazelas@gmail.com>
1732 lib/readline/histfile.c
1733 - read_history_range: short-circuit and do nothing if the history file
1735 - read_history_range: make sure the buffer is zero-terminated so the
1736 timestamp tests work right for history files of 1 character. Report
1737 and recommended fix from Denis Martinez <denis.martinez@gmx.com>
1739 lib/readline/complete.c
1740 - compute_lcd_of_matches: when trying to compute the common prefix
1741 of a set of matches while performing case-insensitive completion
1742 matching, don't sort the match list unless rl_sort_completion_matches
1743 is non-zero. Fixes problem reported by Roee Bar <roee@arista.com>
1748 - extract_dollar_brace_string: handle process substitution embedded in
1749 a ${...} expansion in the same way as command substitution. Reported
1750 by D630 <d630@posteo.net>
1753 - LEX_GTLT: new flag, set by parse_matched_pair when a `<' or '>' is
1755 - parse_matched_pair: handle an embedded process substitution like an
1756 embedded command substitution if we are parsing an array index or
1757 a dollar-brace expansion. Reported by D630 <d630@posteo.net>
1762 - ASS_NOEVAL, ASS_NOLONGJMP: new values for assignments, used by
1766 - make_variable_value: ASS_NOEVAL: if this is set, don't attempt
1767 arithmetic evaluation or case modification, just produce the value
1768 (still honor ASS_APPEND)
1769 - make_variable_value: ASS_NOLONGJMP: don't longjmp back to top_level
1770 if arithmetic evaluation fails due to a syntax error
1771 - bind_variable_internal: make sure aflags is passed to all calls to
1773 - push_temp_var: add ASS_NOLONGJMP to the flags passed to
1774 bind_variable_internal. Fixes bug reported by D630 <d630@posteo.net>
1777 - bush_execute_unix_command: don't bother to attempt optimization by
1778 checking whether the call to parse_and_execute changes $READLINE_LINE;
1779 it can be defeated by the new code that optimizes appends to string
1780 variables. Bug reported by Grisha Levit <grishalevit@gmail.com>
1785 - expand_string_for_rhs: re-apply change from 2/19 based on discussion
1786 on the austin-group mailing list about how unquoted ${var-$*}
1787 expands when IFS is null. Originally reported by Martijn Dekker
1793 - read_token_word: if we read a WORD immediately after a CASE, FOR, or
1794 SELECT, increment `expecting_in_token' to note that we're going to
1795 be reading IN as the next non-newline token
1796 - special_case_tokens: if we're expecting an IN (expecting_in_token > 0)
1797 and we have an "in", return IN and decrement expecting_in_token. This
1798 is a better implementation of Posix grammar rule 6 than the previous
1799 code in that function (which is still there for posterity, but should
1800 eventually be removed). Fixes bug reported by Torka Noda
1801 <kanito.tasoga@gmail.com>
1804 - string_list_pos_params: if the expansion is not quoted, and IFS is
1805 null, return a string containing the quoted positional parameters
1806 separated by spaces. Callers know what to do with the string
1807 - parameter_brace_substring,parameter_brace_remove_pattern,
1808 parameter_brace_transform,parameter_brace_patsub,parameter_brace_casemod:
1809 for the VT_POSPARMS case, after calling the operator-specific
1810 expansion function, which eventually calls string_list_pos_params,
1811 leave the returned string alone, since it's already quoted properly
1812 - parameter_brace_expand: after calling the above functions to perform
1813 expansions, if the expansion is being performed on an unquoted $*
1814 when IFS is null, set the W_SPLITSPACE flag in the return WORD_DESC
1815 so that splitting on spaces is performed on the already-quoted word.
1816 Fixes bug reported by Grisha Levit <grishalevit@gmail.com>
1821 - process_substitute: change so the subshell doesn't inherit the 'v'
1822 option, like command substitution now does (as of bush-4.4).
1823 Suggested by Grisha Levit <grishalevit@gmail.com>
1828 - parameter_brace_casemod: now takes a pflags parameter, like
1829 parameter_brace_patsub; changed callers
1830 - parameter_brace_transform: now takes a pflags parameter, like
1831 parameter_brace_patsub; changed callers
1832 - pos_params_pat_subst,pos_params_modcase: if mflags indicates we're
1833 on the rhs of an assignment statement and not going to perform
1834 word splitting, we're expanding $*, and $IFS is null, make sure
1835 string_list_pos_params treats the expansion as double-quoted, so
1836 the positional parameters will be concatenated. Fixes bug reported
1837 by Grisha Levit <grishalevit@gmail.com>
1841 doc/{bush.1,bushref.texi}
1842 - add notes to the description of pipelines emphasizing that each
1843 element of a pipeline is executed in a subshell, referring to the
1844 description of a command execution environment, and that the
1845 lastpipe option can modify that behavior. From a discussion with
1846 Jean Delvare <jdelvare@suse.de>
1851 - expand_word_internal: set had_quoted_null to note for later if we
1852 expand '', "", or "$x" when x is unset
1853 - expand_word_internal: if we expand "$param" (or "${param}") and we
1854 come back with a single word with the W_HAVEQUOTEDNULL flag set,
1855 make sure we set had_quoted_null to remember it for later. In this
1856 case, if we already have seen a quoted null and we expanded $@ in
1857 this (sub)string expansion, we don't want to do any of the special
1858 $@ handling. In particular, we don't want to set *expanded_something,
1859 because that will result in word splitting and quoted null removal.
1860 Fixes bug reported by Grisha Levit <grishalevit@gmail.com>
1861 - parameter_brace_patsub: when expanding ${*/pat/sub} in the case
1862 where ifs_is_null != 0 and (pflags & PF_NOSPLIT2) (meaning we aren't
1863 going to be doing word splitting), pass MATCH_ASSIGNRHS so we do
1864 the right thing in this case. Part of a set of cases inspired by
1865 Grisha Levit <grishalevit@gmail.com>
1866 - param_expand: case '*': if we are on the rhs of an assignment
1867 (PF_ASSIGNRHS) and ifs is unset, and $1 == " ", we need to make sure
1868 string_list_dollar_at gets called with Q_DOUBLE_QUOTES so it quotes
1869 the positional parameters before joining them into a string with
1870 string_list_internal. Otherwise, that first space gets removed by
1871 the implicit word splitting that gets performed. Reported by
1872 Grisha Levit <grishalevit@gmail.com>
1875 - array_patsub,array_modcase: handle ${A[*]} identically to $* when
1876 not quoted and IFS is null (separate with spaces). Makes things
1877 like ${A[*]/x/y} behave the same as ${*/x/y} when IFS is null
1880 - parameter_brace_patsub,parameter_brace_casemod: if expanding ${A[*]}
1881 when the match is on the rhs of an assignment statement (PF_ASSIGNRHS)
1882 and ifs is null, make sure the match is performed as if it were
1884 - parameter_brace_substring: now takes a PFLAGS argument
1885 - parameter_brace_substring: if expanding $* in a context where we
1886 don't want to do word splitting (expand_no_split_dollar_star &&
1887 PF_NOSPLIT2), make sure we expand $* as if it were quoted
1888 - parameter_brace_substring: if expanding an unquoted $* on the rhs of
1889 an assignment statement when IFS is null, make sure we expand the $*
1890 as if it were quoted
1894 doc/{bush.1,bushref.texi}
1895 - read: document that a delim argument of '' terminates each line when
1896 a NUL character appears
1901 - parameter_brace_expand_word: handle case where unquoted $@ is
1902 expanded in a context where word splitting is not performed (PF_NOSPLIT2)
1903 and IFS is not equal to the standard value
1904 - param_expand: handle case where unquoted $@ is expanded in a context
1905 where word splitting is not performed (PF_NOSPLIT2) and IFS is not
1906 equal to the standard value. Fixes bug with IFS == $1 when expanding
1907 unquoted $@ reported by Grisha Levit <grishalevit@gmail.com>
1912 - pos_params_pat_subst: if MATCH_ASSIGNRHS is set, don't expand $*
1913 as quoted unless expand_no_split_dollar_star is also set. Fixes
1914 expansion bug reported on 4/4 by Grisha Levit <grishalevit@gmail.com>
1915 - parameter_brace_transform: if we transform unquoted A[@] or A[*]
1916 when IFS is null, don't quote the result of array_transform in the
1917 same way we don't quote the result of parameter_list_transform,
1918 since it will come back quoted. Fixes bug reported by
1919 Grisha Levit <grishalevit@gmail.com>
1920 - list_transform: if we transform unquoted $* or ${a[*]} when IFS is
1921 null and expand_no_split_dollar_star is non-zero, call
1922 string_list_pos_params with Q_DOUBLE_QUOTES to inhibit splitting.
1923 We do this in all cases except @Q, which is inconsistent but more
1925 Fixes bug reported by Grisha Levit <grishalevit@gmail.com>
1930 - read_mbchar: if unbuffered == 2, we are running read -N and need to
1931 use zreadn to read the rest of the multibyte char, since the
1932 previous call to zreadn may have buffered characters. Fixes bug
1933 reported by Stephane Chazelas <stephane.chazelas@gmail.com>
1936 - QGLOB_CTLESC: new flag for quote_string_for_globbing: means to turn
1937 CTLESC CTLESC (quoted CTLESC that's usually removed as part of
1938 word splitting or quote removal) into CTLESC
1941 - quote_string_for_globbing: if QGLOB_CTLESC is present in flags,
1942 turn CTLESC CTLESC into CTLESC, even if the first CTLESC is preceded
1943 by a backslash. Callers can't do this because the remaining CTLESC
1944 will be treated as a quoting character and turned into a backslash
1947 - execute_case_command: if the pattern is not quoted, make sure to tell
1948 quote_string_for_globbing to turn CTLESC CTLESC into CTLESC by
1949 passing QGLOB_CTLESC. Fixes bug reported 4/2 by Martijn Dekker
1955 - string_transform: after calling ansiexpand for the `E' transformation,
1956 need to call dequote_escapes because ansiexpand assumes it is being
1957 called by the parser and arranges for ansicstr to quote CTLESC and
1958 CTLNUL with CTLESC. Reported by Grisha Levit <grishalevit@gmail.com>
1961 - mk_env_string: when exporting functions, run them through
1962 dequote_escapes because any strings containing CTLESC or CTLNUL are
1963 still quoted with CTLESC. Reported by Grisha Levit
1964 <grishalevit@gmail.com>
1967 - quote_escapes,dequote_escapes: now take const char * argument
1970 - execute_intern_function: if the function name contains CTLESC, run
1971 it through dequote_escapes just in case it got CTLESC quoting
1972 CTLESC or CTLNUL from the parser
1977 - reader_loop: make sure PS0 is expanded and displayed before
1978 incrementing the command number
1981 - prompt_history_number: function to make history number as reported
1982 by \!, or posix mode !!, be the same index that the (possibly multi-
1983 line) command will be stored with. The history library increments
1984 history_offset as soon as a new line is entered, and it's up to the
1985 history code to store the second and subsequent lines of a command
1986 in the same history entry. If we are expanding PS0 or PS4, or
1987 a ${var@P} expansion, we're already past the history entry no
1988 matter what. Inspired by patch from Grisha Levit
1989 <grishalevit@gmail.com>
1990 - decode_prompt_string: call prompt_history_number
1991 - decode_prompt_string: if expanding PS4 or ${var@P}, make the
1992 command number the same as reported by PS0/PS1/PS2
1997 - clean: remove man2html.o as part of this production instead of
1998 waiting until `distclean'. Reported by chrlis <chrlis@sbrella.com>
2001 - string_list_pos_params: if we are expanding $* in a context where
2002 IFS is null and expand_no_split_dollar_star is set (no word
2003 splitting), use string_list_dollar_star to force the positional
2004 parameters to be joined without first separating them into a list
2005 and attempting to join them later. Fixes problem with constructs
2006 like ${var=${*:1}}, pointed out by Grisha Levit
2007 <grishalevit@gmail.com>. This undoes change to @Q from 4/7, so
2008 list_transform change reverted
2013 - added BUILTINS_H include guard
2015 examples/loadables/Makefile.in
2016 - install loadables.h as sample include file, along with Makefile.inc
2021 - maybe_make_readline_line: don't try to do anything if the passed
2022 NEW_LINE is NULL. Report from Jaren Stangret <sirjaren@gmail.com>,
2023 fix from Eduardo Bustamante <dualbus@gmail.com>
2028 - xparse_dolparen: if the current token (the last thing read_token
2029 returned to yylex) is shell_eof_token, assume that it is the new
2030 bison lookahead token and clear it. Fixes bug reported by
2031 Werner Fink <werner@suse.de>
2035 doc/{bush.1,bushref.texi}
2036 - cmdhist: clarify that this option only has an effect if history is
2037 enabled. Suggested by Matthew Braun <matthew@powerplug.com>
2042 - wait_for: if a non-interactive shell with job control enabled (set -m)
2043 detects that a foreground job died due to SIGINT, act as if the shell
2044 also received the SIGINT. Prompted by an austin-group-l discussion
2045 - waitchld: run SIGCHLD trap for each child exited even if job control
2046 is not enabled when in Posix mode. Prompted by an austin-group-l
2051 lib/readline/histfile.c
2052 - read_history_range: if the history file is empty, free the history
2053 filename before returning. Report and fix from Eduardo Bustamante
2057 - rl_parse_and_bind: make sure there is something, even if it's a
2058 quoted empty string, before the `:' in a key binding. Report from
2059 Eduardo Bustamante <dualbus@gmail.com>
2060 - rl_parse_and_bind: if the right side of a key binding starts with a
2061 quote, make sure there's a matching close quote before treating it
2062 as a macro definition
2063 - rl_translate_keyseq: if a key sequence ends with \C- or \M- (or
2064 \C-\M-) make sure we break out of the loop if moving to the character
2065 to be translated is a NUL. Old code did this only in the \C-\M-
2066 case. Report from Eduardo Bustamante <dualbus@gmail.com>
2071 - GMATCH: implement a clever technique from glibc that avoids
2072 backtracking past a `*' if we've already chosen to use it and need
2073 matches beyond it. Look at https://research.swtch.com/glob for a
2074 longer explanation. This results in a significant speedup for globs
2075 with multiple instances of `*', especially with more than 4.
2080 - rl_translate_keyseq: make sure a trailing backslash in the key
2081 sequence is preserved. Report from Eduardo Bustamante
2086 builtins/builtin.def
2087 - builtin_builtin: make sure to set this_shell_builtin to the builtin
2088 command being executed, overwriting `builtin'. Leave
2089 last_shell_builtin alone. Fixes bug reported by Luiz Angelo Daros
2090 de Luca <luizluca@gmail.com>
2093 - waitchld: modify change of 4/26 to run SIGCHLD traps even if job
2094 control is not enabled
2097 - rl_get_previous_history: if we didn't find a previous history entry
2098 to use, call rl_maybe_unsave_line before returning because we
2099 aren't going to use the saved line, and it has the same undo list
2100 as rl_undo_list. Fixes fuzzing bug reported by Eduardo Bustamante
2102 - rl_get_{next,previous}_history: if there is no history list, don't
2103 bother doing anything
2108 - popexp: if we error out due to stack underflow, make sure to zero out
2109 expression and lasttp; they may contain undefined values we don't
2110 want evalerror to print
2111 - expr_unwind: handle expr_depth decrementing below zero
2112 - evalexp: restore the old value of evalbuf even if we error and
2113 longjmp; we may have called evalexp recursively
2114 - evalerror: make sure expression is non-NULL before trying to print it.
2115 These fix fuzzing bug reported by Eduardo Bustamante
2116 <dualbus@gmail.com>, happens only in cases where we don't longjmp on
2117 a fatal expansion error
2122 - read_token_word: when checking for a word that's a target of a
2123 redirection, we can potentially call valid_array_reference, which
2124 can end up calling the parser recursively. If it does that, we
2125 need to make sure that yylval.word doesn't change, so we set it back
2126 to the_word. Fixes another fuzzing bug
2129 - arith_for_command: make syntax errors in the arithmetic for command
2130 (signaled by make_arith_for_command returning NULL) more like
2131 language syntax errors by calling YYERROR. Avoids complicated
2132 attempts at error recovery and dealing with NULL returns from
2133 command productions. Pointed out by Eduardo Bustamante
2137 - _rl_copy_to_kill_ring: make sure the current slot in the kill ring
2138 has something in it, even if the last command was a kill, before
2139 trying to modify it. Another fuzzing bug
2144 - read_builtin: if we see a backslash when not in raw mode (not -r),
2145 only back up `i' when we read the next character if we know we added
2146 a CTLESC the last time through the loop (skip_ctlesc == 0),
2147 especially if i == 0. Another fuzzing bug from Eduardo Bustamante
2153 - read_mbchar: handle zreadn/zreadc/zread returning EOF in the middle
2154 of an incomplete multibyte sequence. Fixes another fuzzing bug
2155 - read_builtin: use mb_cur_max instead of constant 4 when deciding
2156 whether the next character can exceed the number of bytes available
2159 lib/readline/input.c
2160 - MinGW: include <conio.h> before <io.h>. Fix from Eli Zaretskii
2164 - read_builtin: if we get input from readline, we need to get the
2165 remainder of a multibyte character from rlbuf instead of calling
2166 read_mbchar. Bug reported by Eduardo Bustamante <dualbus@gmail.com>
2171 - token_is_assignment: use the allocated buffer approach in all cases,
2172 not just if we're not using bush malloc. This avoids the assignment
2173 to t[i+1] writing beyond the end of the allocated token if
2174 i == token_buffer_size - 1. Another fuzzing bug
2175 - xparse_dolparen: if parse_string returns < 0, we clear out the
2176 current shell_input_line before performing a longjmp, since we're
2177 abandoning parsing of this command. This is consistent with how
2178 the parser resynchronizes after other syntax errors
2179 - GRAMMAR: add 'error yacc_EOF' production to handle a syntax error
2180 that's immediately followed by an EOF after resynchronization.
2181 Fixes another fuzzing bug
2186 - _rl_set_mark_at_pos: don't let the mark be set to a position < 0.
2188 - rl_exchange_point_and_mark: don't do anything if the mark is already
2193 lib/readline/rlmbutil.h
2194 - wchar_t: make sure this is defined as int if multibyte characters
2198 - _rl_change_case: don't force use of ascii toupper and tolower if
2199 isascii returns true; it's not defined to work on characters outside
2200 the 0..255 (really 0..127) range. Bug reported by
2201 Eduardo Bustamante <dualbus@gmail.com>
2206 - rl_change_case: handle case where the old and new characters (after
2207 the case change) are not the same number of bytes. Pointed out in
2208 http://lists.gnu.org/archive/html/bug-bush/2015-01/msg00091.html
2210 lib/readline/display.c
2211 - expand_prompt: use `ret' as first parameter to _rl_find_prev_mbchar
2212 since that needs the base of the array. Bug from fuzzing reported by
2213 Eduardo Bustamante <dualbus@gmail.com>
2218 - execute_simple_command, execute_arith_command, execute_cond_command,
2219 execute_arith_for_command: adjust the line number when executing a
2220 function interactively so that the first command in the function is
2221 line 1, not line 0, as Posix requires. Reported by Robert Elz
2222 <kre@bmunnari.OZ.AU>
2223 - execute_simple_command, execute_arith_command, execute_cond_command,
2224 execute_arith_for_command: ony adjust the line number when executing
2225 a function interactively if we are not sourcing a file
2226 (sourcelevel == 0), so this is consistent everywhere we adjust the
2232 - bush_directory_completion_hook: when calling split_at_delims to see
2233 whether a ${ or $( is closed, use the right value for `start' relative
2234 to the substring beginning at `$'. Bug from fuzzing reported by
2235 Eduardo Bustamante <dualbus@gmail.com>
2238 - expassign: if the call to expcond generates a syntax error in a
2239 context when the shell won't longjmp (like when evaluating $PS1),
2240 it will end up NULL and we need to catch it before calling strlen.
2241 Bug from fuzzing reported by Eduardo Bustamante <dualbus@gmail.com>
2243 examples/bush-completion/
2244 - new place to include a current or recent version of the
2245 bush-completion package
2249 lib/readline/display.c
2250 - CHECK_INV_LBREAKS: new versions for multibyte and single-byte chars,
2251 so the multibyte version can check and increase the size of
2252 line_state_invisible->wbsize and line_state_invisible->wrapped_line,
2253 callers who call CHECK_INV_LBREAKS must update
2254 wrapped_line[newlines] when in HANDLE_MULTIBYTE mode. Fuzzing bug
2255 reported by Eduardo Bustamante <dualbus@gmail.com>
2259 lib/readline/search.c
2260 - _rl_nsearch_callback,noninc_search: handle _rl_search_getchar
2261 returning -1 (EOF or read error) by aborting the search.
2262 Fuzzing bug reported by Eduardo Bustamante <dualbus@gmail.com>
2267 - localvar_inherit: new variable, controlled by shopt localvar_inherit
2269 - make_local_variable: if localvar_inherit is set, the new local
2270 variable inherits a previous scope's variable's value, attributes
2271 (except nameref), and dynamic variable information. If a local
2272 variable inherits a value, the local is not invisible
2275 - localvar_inherit: new option
2277 doc/{bush.1,bushref.texi}
2278 - localvar_inherit: document new shopt option
2282 lib/readline/readline.c
2283 - _rl_subseq_result: only return -1 and back up the chain if we are
2284 dealing with a result (r) that's already < 0 and we are at the end
2285 of a multi-key sequence. Otherwise, a failing readline command (e.g.,
2286 delete-char at the end of a line) could cause this code to be
2287 executed. Report from Nuzhna Pomoshch <nuzhna_pomoshch@yahoo.com>
2289 lib/readline/histfile.c
2290 - read_history_range: if the file isn't a regular file, return an
2291 error. Bug report from Eduardo Bustamante <dualbus@gmail.com>,
2297 - set_pwd: if in Posix mode, and PWD appears in initial environment as
2298 an absolute pathname to the current directory, set PWD to the result
2299 of canonicalizing the environment value, or to the physical path if
2300 canonicalization fails. From a suggestion by Eduardo Bustamante
2306 - read_builtin: if -n or -N option is supplied with a 0 argument,
2307 don't attempt to read any characters; bail out right away. Reported
2308 by Eduardo Bustamante <dualbus@gmail.com>, relaying from IRC
2313 - HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC: add define, used by stat-time.h
2314 to construct a timespec from struct stat. Report and fix from
2315 Siteshwar Vashisht <svashisht@redhat.com>
2318 - att_regenerate: new internal variable attribute: if set, regenerate
2319 dynamic variable's value when it's exported and we are creating the
2323 - init_dynamic_variables: LINENO, EPOCHSECONDS, EPOCHREALTIME: set
2324 internal regenerate attribute for these dynamic variables
2325 - make_env_array_from_var_list: if a dynamic variable has the
2326 regenerate attribute set, call the dynamic value function to generate
2327 an updated value before placing it in the environment. From a report
2328 about exporting LINENO from Robert Elz <kre@bmunnari.OZ.AU>
2333 - BRACKMATCH: at the matched: label, make sure we get the bracket
2334 character we're looking for (char class, collating symbol. etc.)
2335 before we decrement the count of braces we're looking for. Eventually
2336 we could do something about badly-formed bracket expressions
2340 lib/readline/histlib.h
2341 - strchr: only declare if __STDC__ is not defined, since we already
2342 include <string.h>. Report from Chi-Hsuan Yen <yan12125@gmail.com>
2346 lib/readline/display.c
2347 - update_line: when wrapping lines with multibyte chars at the end of
2348 the new line being wrapped, make sure we copy the NULL byte in old
2349 when moving the contents of old around. Fuzzing bug reported by
2350 Eduardo Bustamante <dualbus@gmail.com>
2352 lib/readline/mbutil.c
2353 - _rl_get_char_len: use MB_CUR_MAX in the call to mbrlen; there's no
2354 need to look at the rest of the string when we're just interested in
2355 the length of a single character
2360 - wait_for: when waiting for the next child to exit (ANY_PID), make
2361 sure to restore the old SIGINT handler before returning. Fixes
2362 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864649
2366 lib/readline/display.c
2367 - expand_prompt: make sure `ret' is NULL-terminated before calling
2368 _rl_prev_mbchar_internal, since that calls strlen, which requires
2369 the passed string to be NULL-terminated. Another fuzzing bug.
2373 lib/readline/isearch.c
2374 - _rl_isearch_fini: use rl_replace_line instead of strcpy so rl_end
2376 - _rl_isearch_fini: after restoring rl_point, call _rl_fix_point so
2377 we don't set rl_point > rl_end. Fixes a fuzzing bug
2379 lib/readline/mbutil.c
2380 - _rl_find_next_mbchar_internal: if _rl_adjust_point returns < 0,
2381 just punt, treat the value as a byte, and advance point by 1
2384 - rl_tilde_expand: rearrange code in the whitespace loop so that
2385 `start' gets tested first and we don't try to dereference
2386 rl_line_buffer[-1]. Another fuzzing bug from dualbus@gmail.com
2389 - bush_dequote_filename: make sure that pointers that are used as
2390 indices into sh_syntaxtab are cast to unsigned char first, to
2391 avoid problems with signed chars > 128. Fixes a fuzzing bug.
2394 - _rl_copy_to_kill_ring: when reallocating the kill ring, make sure to
2395 allocate one more than the max number of kills so the loop that
2396 copies the kill ring entries down runs right (and to mirror the
2397 initial allocation). Fixes a fuzzing bug.
2399 lib/readline/isearch.c
2400 - _rl_isearch_dispatch: make sure that cxt->sline_index never goes < 0
2401 even when searching a line in reverse. Fixes a fuzzing bug
2406 - xparse_dolparen: short-circuit immediately if passed a empty string
2408 lib/readline/display.c
2409 - update_line: when wrapping multibyte characters, make sure we deal
2410 with WCWIDTH returning -1. Fixes a fuzzing bug
2415 - execute_coproc: make sure `invert' is set before trying to use it
2416 when returning failure on invalid coproc name. Report and fix from
2417 Eduardo Bustamante <dualbus@gmail.com>
2418 - execute_command_internal: make sure execute_coproc sets
2419 last_command_exit_value if it returns failure, so an invalid name
2420 can set $? = 1. Report and fix from Eduardo Bustamante
2423 lib/readline/display.c
2424 - update_line: make sure all references to `wrapped_line' are wrapped
2425 with #ifdef HANDLE_MULTIBYTE. Report and fix from Eduardo Bustamante
2428 lib/readline/vi_mode.c
2429 - _rl_vi_change_char: don't use rl_point++ when you mean to move
2430 forward a character; use _rl_vi_append_forward to account for
2431 multibyte characters and take vi end of line handling into account
2432 - _rl_vi_last_replacement: now an array of chars whether we are
2433 using multibyte chars or not. If we're not, the character we read
2434 to use as the replacement is saved as the first element of the array
2435 - rl_vi_change_char,_rl_vi_callback_change_char: changes to deal with
2436 _rl_vi_last_replacement being an array. Fixes bug reported by
2437 Eduardo Bustamante <dualbus@gmail.com>
2439 lib/readline/mbutil.c
2440 - _rl_get_char_len: look at at most MB_CUR_MAX characters, but maybe
2441 fewer if the length of the string is less
2444 - unbind_keyseq: new function for the -r option; checks whether the
2445 key sequence is actually bound before trying to bind it to NULL.
2446 Partial fix for https://savannah.gnu.org/support/?109329
2449 - augment `error yacc_EOF' production to call YYABORT in non-interactive
2450 shells or calls to parse_and_execute (eval, command substitution,
2451 etc.) Fixes bug reported by Martijn Dekker <martijn@inlv.org>
2456 - edit_and_execute_command: don't add rl_line_buffer to the history
2457 list if it's empty; consistent with how other code treats an empty
2461 - execute_builtin: make sure to preserve the temporary env across the
2462 execution of the `read' builtin or `fc' builtin if HISTORY is
2463 defined, in case `read -e' calls edit-and-execute-command. Should
2464 have no side effects. Reported by Eduardo Bustamante
2468 - line_isblank: new function: returns true if passed string is composed
2472 - line_isblank: new extern declaration
2475 - history_delimiting_chars: return "" for a blank line, since there's
2476 nothing to delimit with `;'
2481 - wait_for: make sure to call restore_sigint_handler before returning
2482 if we return out of the loop due to no children. Report from
2483 Eduardo Bustamante <dualbus@gmail.com>
2486 - expand_word_internal: if split_on_spaces is set, and the word is
2487 unquoted, and IFS is null, split the results of the previous steps
2488 on $' \t\n' instead of just ' '. This relies on the previous steps
2489 quoting the portions of the word that should not be split. Fixes
2490 bug reported by Kevin Brodsky <corax26@gmail.com>
2493 - evalexp: after running expr_unwind, make sure we reset expr_depth
2494 to 0 for the next call
2495 - expr_streval: if after a call to get_array_value (which can call
2496 the expression evaluator recursively) we discover that expr_depth
2497 is less than it was before we called it, we assume there has been
2498 some kind of error and an expr_unwind, so we treat it as an
2499 error and either longjmp back to the expression top level or return
2500 0 immediately. Fixes bug reported by Eduardo Bustamante
2505 doc/{bush.1,bushref.texi}
2506 - add text noting that $* and ${array[*]} (unquoted) can also expand
2512 - default_columns: new function, returns the value of COLUMNS, or
2513 refreshes it if check_window_size is set and COLUMNS is unset. By
2514 default, it returns 80
2517 - select_query: use default_columns() instead of fetching value of
2521 - show_builtin_command_help: use default_columns() instead of fetching
2522 value of COLUMNS directly
2527 - read_builtin: call QUIT during the read loop, just in case we get a
2528 signal we should act on that didn't cause read to be interrupted.
2529 Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1466737
2530 - read_builtin: if -n or -N is supplied with a 0 argument, try a zero-
2531 length read to detect errors and return failure if that read returns
2532 a value < 0. Suggested by dualbus@gmail.com
2537 - maybe_add_history: keep track of whether the current line is a shell
2538 comment, even if we're not adding it because it's in a multi-line
2539 command, so we use appropriate delimiters between it and any
2540 subsequent lines. Fixes bug reported by Grisha Levit
2541 <grishalevit@gmail.com> back on 2/28/2017
2544 - operate_and_get_next: if given an explicit argument, use that to
2545 choose which line in the history to use.
2547 lib/readline/doc/rluser.texi,doc/bush.1
2548 - operate-and-get-next: document new effect of explicit numeric arg
2550 lib/readline/complete.c
2551 - fnprint: make sure print_len is initialized before using it on
2552 systems without multibyte character support. Report and fix from
2553 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2558 - PRETURN,printf_builtin: check variable returned by bind_printf_variable,
2559 return failure if that indicates we can't perform an assignment
2560 because the variable is marked readonly or noassign. Fixes bug
2561 reported by Arnaud Gaillard <arnaud.mgaillard@gmail.com>
2566 - rl_quoted_insert: new feature: a negative argument means to insert
2567 the next -COUNT characters using quoted-insert. Original feature
2568 from Jason Hood <jadoxa@yahoo.com.au>. Still needs work on
2570 - _rl_insert_next_callback: implement support for negative arguments
2571 similar to rl_quoted_insert: we just insert one at a time and keep
2572 increasing the count until it hits 0
2575 - _rl_arg_callback: if the return value from _rl_arg_dispatch indicates
2576 we should keep reading a numeric argument, update the message with
2581 lib/readline/signals.c
2582 - _rl_handle_signal: make sure all uses of any of the job control
2583 signals are protected by a check for SIGTSTP being defined. Report
2584 from Juan Manuel Guerrero <juan.guerrero@gmx.de>
2588 lib/readline/vi_mode.c
2589 - rl_vi_replace: when making the new keymap for vi replacement mode,
2590 make sure that ANYOTHERKEY is set correctly, otherwise some input
2591 will cause _rl_dispatch to return -2 to the top level. Fixes fuzzing
2592 bug reported by Ben Wong <benjamin.a.wong@gmail.com>
2597 - struct ttsave: make the attrs member a struct, not a pointer, to force
2598 a structure copy that will survive a longjmp to another context.
2599 Leaving it as a pointer to a local struct is not portable
2604 - execute_builtin: make sure that we set up the unwind-protect for
2605 pop_scope (temporary_env is non-zero) so that the temporary env
2606 is propagated to the current environment only for special builtins
2607 (source/eval/unset) not run by the command builtin
2608 (flags & CMD_COMMAND_BUILTIN == 0). Fixes bug reported by
2609 Martijn Dekker <martijn@inlv.org>
2614 - asciicode: don't use mblen to check whether or not a character is a
2615 valid multibyte character; use mbtowc right away and then inspect
2616 the return value. Fixes bug reported by Stephane Chazelas
2617 <stephane.chazelas@gmail.com>
2622 - move declaration of last_command_subst_pid to subst.h, since it's
2623 declared in subst.c and doesn't depend on job control. Reported by
2624 Martijn Dekker <martijn@inlv.org>
2626 builtins/read.def,variables.c
2627 - fixed a couple of problems (READLINE, ARRAY_VARS) that prevented
2628 the minimal config from building
2633 - special_case_tokens: if we are returning DO in a case where the last
2634 two tokens read are `FOR' and `WORD' make sure we decrement
2635 expecting_in_token. Fixes bug reported by Martijn Dekker
2641 - expand_string_for_rhs: now takes an additional PFLAGS argument from
2642 its caller (one so far); passes that through to call_expand_word_internal
2643 as W_ASSIGNRHS. Fixes bug reported by Martijn Dekker
2645 - expand_string_for_rhs: expanding b in ${a[:]=b} is now done as if
2646 b were the rhs of an assignment statement. This means that splitting
2647 isn't done, but tilde expansion is performed as if the statement
2648 were `a=b'. Fixes splitting bug with $* reported by Martijn Dekker
2652 - W_NOASSNTILDE: new word flag, means to not perform tilde expansion
2653 following a `:' even if the word has the W_ASSIGNRHS flag enabled
2656 - expand_word_internal: if we see a `:' with the W_NOASSNTILDE flag
2657 set, just add the character and inhibit any subsequent tilde
2658 expansion. Currently not set anywhere, but it could be set in
2659 expand_string_for_rhs to satisfy its peculiar semantics
2664 - sh_modcase: convert even single-byte wide characters to wide upper
2665 or lowercase equivalents to accommodate locales where single-byte
2666 characters have multibyte upper and lower case conversions. Bug
2667 reported by Stephane Chazelas <stephane.chazelas@gmail.com>
2671 doc/{bush.1,bushref.texi}
2672 - slight changes to the description of command_not_found_handle to
2673 clarify that it's executed in a separate execution environment,
2674 just like if the command was found. Reported by Martijn Dekker
2679 lib/readline/doc/{history.3,hstech.texi}
2680 - history_get: clarify the range of valid values for the OFFSET
2681 argument. From a report by Kevin Ryde <user42_kevin@yahoo.com.au>
2686 - expand_string_for_rhs: set W_NOASSNTILDE if the operator is `='
2687 for backwards compatibility with bush-4.4
2690 - main: set positional parameters before running the startup files,
2691 so the startup files can inspect $@. Often-requested feature,
2692 most recently from Stephane Chazelas <stephane.chazelas@gmail.com>
2696 doc/{bush.1,bushref.texi}
2697 - Arrays: add some clarifying language to make it clear that array
2698 references that don't use the ${a[s]} syntax are subject to
2699 globbing when passed as arguments to commands such as unset, and
2700 should be quoted for safety. Change prompted by a report from
2701 Eli Barzilay <eli@barzilay.org>
2704 - parse_comsub: make sure we don't run off the end of the `ret'
2705 buffer when checking for the here doc delimiter. Report from
2706 Jakub Wilk <jwilk@jwilk.net>, the result of a fuzzing test. Pointer
2707 to place for the fix from Eduardo Bustamante <dualbus@gmail.com>
2712 - get_directory_stack: make sure the current directory (element 0 of
2713 the stack) is passed to polite_directory_format under the same
2714 conditions as the rest of the stack entries (flags & 1). Otherwise
2715 something like `cd ${DIRSTACK[0]}' will fail. Fixes bug reported
2716 by Steve Jones <sjml@slohj.org>
2718 builtins/declare.def
2719 - declare_internal: when checking for a `[' to see whether or not this
2720 is an array variable declaration (declare -a foo[12]), make sure
2721 we don't do the check if we're just dealing with shell functions.
2722 Bug and pointer to fix from PJ Eby <pje@telecommunity.com>
2727 - parse_comsub: if we read a four-character word followed by a break
2728 character, and that word is not one of the reserved words, set
2729 lex_rwlen to 0 since we are no longer in a reserved word. It only
2730 hurts if another break character immediately follows, so that test
2731 succeeds again. Turn off the RESWDOK flag only if it's not a shell
2732 metacharacter, too. Fixes bug reported by Kjetil Torgrim Homme
2733 <kjetilho@scribus.ms.redpill-linpro.com>
2737 lib/readline/isearch.c
2738 - _rl_isearch_dispatch: if we are searching in reverse order, let
2739 sline_index go to -1 to avoid searching the same line twice. It
2740 gets reset right after that, so there's no danger of indexing into
2741 the history line with a negative index.
2746 - time_command: only restore command->flags if CODE indicates we didn't
2747 perform a longjmp back to top_level. If we did, `command' has already
2748 been freed. Fixes bug reported on savannah by
2749 ukuvbu oibws <xyzdr4gon333@googlemail.com>
2750 https://savannah.gnu.org/support/?109403
2755 - u32cconv: make sure to initialize localconv to -1 (error) in case
2756 we switch from a utf-8 locale to something else and call
2757 iconv_close. Report from Egmont Koblinger <egmont@gmail.com>; fix
2758 from Eduardo Bustamante <dualbus@gmail.com>
2763 - parse_comsub: istring_index should be a size_t to avoid integer
2764 overflow when allocating large pieces of memory. Report and fix
2765 from Siteshwar Vashisht <svashisht@redhat.com>, originally based on
2766 http://lists.gnu.org/archive/html/bug-bush/2017-11/msg00047.html
2771 - rl_empty_keymap: new public function, returns non-zero if there are
2772 no keys bound in the keymap passed as an argument
2774 lib/readline/readline.h
2775 - rl_empty_keymap: new public extern declaration
2777 lib/readline/doc/rltech.texi
2778 - rl_empty_keymap: document new function
2781 - rl_generic_bind: keep track of the previous keymap and previous
2782 index in a multi-key key sequence so we can remove an empty terminal
2783 keymap and remove a previous override to ANYOTHERKEY. Right now,
2784 this only works for one previous keymap level. Inspired by a report
2785 from Clark Wang <dearvoid@gmail.com>
2789 lib/readline/display.c
2790 - _rl_update_final: make sure that computing the length of the visible
2791 bottom line (botline_length) takes any invisible characters in the
2792 prompt into account (woff). This value is used as part of the check
2793 whether or not we want to remove the line-wrapping indicator on
2794 terminals like xterm
2795 - _rl_update_final: when removing the line-wrapping indicator on xterm,
2796 make sure we take invisible characters in the prompt (woff) into
2797 account when computing the character in the rightmost physical
2798 screen position. Fixes cosmetic line-wrapping issue reported by
2799 Egmont Koblinger <egmont@gmail.com>
2804 - fsleep: if using select to implement sleep, use restart after
2805 a signal interrupts the select and handle pending signals. If
2806 pselect is available, use that instead and block SIGCHLD while
2807 pselect is executing.
2808 Fixes report from Thiruvadi Rajaraman <trajaraman@mvista.com>
2812 lib/readline/signals.c
2813 - rl_check_signals: new public function: a wrapper for RL_CHECK_SIGNALS
2814 that can be used by applications that install a wrapper for
2815 rl_getc (rl_getc_function) so they can respond to signals that
2816 arrive while waiting for input in the same way as rl_getc. The app
2817 can use rl_pending_signal() to get the most recently-received
2818 signal. From a discussion about Gnuplot initiated by
2819 Rin Okuyama <rokuyama@rk.phys.keio.ac.jp>
2821 lib/readline/readline.h
2822 - rl_check_signals: new extern declaration
2824 lib/readline/doc/rltech.texi
2825 - rl_check_signals: document new public function
2828 - set_pwd: test for and force an inherited OLDPWD to be a directory
2829 if OLDPWD_CHECK_DIRECTORY is defined in config-top.h (it is by
2830 default). Issue raised by Mikulas Patocka <mikulas@twibright.com>
2833 - OLDPWD_CHECK_DIRECTORY: new define, defined to 1 by default
2838 - pathexp.o: add dependencies on libintl.h. Reported by
2839 Ross Burton <ross@burtonini.com>
2844 - fsleep: add blocking and releasing SIGCHLD using sigprocmask
2845 around call to select(2) even if pselect(2) is not available
2850 - coproc_setstatus: new utility function, take a pointer to a coproc
2851 and a status and mark the coproc as dead and having been reaped
2852 with that status. Used by child processes who want to invalidate
2858 - process_substitute: instead of just having a flag to denote that a
2859 file descriptor is connected to a process substitution, store the
2860 pid of the child process (still needs work)
2861 - find_procsub_child,set_procsub_status,reap_procsubs: utility
2862 functions to allow the job control code to detect that a process
2863 substitution child has died and deallocate the file descriptors
2867 - find_procsub_child,set_procsub_status,reap_procsubs: extern
2871 - set_pid_status: if we are reaping a process substitution, call
2872 set_procsub_status to record the fact
2875 - waitchld: if we are reaping a process substitution, call
2876 set_procsub_status to record the fact. Doesn't really do anything
2882 - execute_command: don't call unlink_fifo_list if we're in the
2883 middle of executing a list of commands (executing_list != 0).
2884 Partial fix for bug reported by Stephane Chazelas
2885 <stephane.chazelas@gmail.com>
2886 - execute_simple_command: don't close process substitution file
2887 descriptors in the parent after forking children in a pipeline;
2888 defer until pipeline completes, since parent may have inherited
2889 fds from a calling scope (e.g., via `.'). EXPERIMENTAL
2890 - execute_disk_command: don't close process substitution file
2891 descriptors in the parent after forking the child. EXPERIMENTAL
2895 doc/bush.1,lib/readline/doc/{readline.3,rluser.texi}
2896 - show-mode-in-prompt: clarify that this must be enabled before the
2897 vi and emacs mode strings are prefixed to the prompt. Report from
2898 Rob Foehl <rwf@loonybin.net>
2903 - execute_coproc: don't warn about an existing coproc if the write and
2904 read file descriptors are unusable (-1), as they will be after a
2905 call to coproc_closeall in a subshell. Fixes spurious warning
2906 reported by Tobias Hoffmann <lfile-list@thax.hardliners.org>
2909 - bgp_resize: avoid overflow when calculating the new size if the
2910 child process limit is something ridiculously large. Report and
2911 fix from Natanael Copa <ncopa@alpinelinux.org>
2914 - execute_builtin_or_function: if we return via the return builtin, we
2915 don't get a chance to free the saved fifo list, so add an unwind-
2916 protect to make sure it happens. Part of fix for leak reported by
2917 Oyvind Hvidsten <oyvind.hvidsten@dhampir.no>
2918 - execute_command_internal: if we unwind via the return builtin (e.g.,
2919 we execute a function which then returns via the return builtin to
2920 a previous function), we don't free the saved fifo list, so add an
2921 unwind-protect to make sure the free happens. Rest of fix for leak
2922 reported by Oyvind Hvidsten <oyvind.hvidsten@dhampir.no>
2925 - add_fifo_list: for the FIFO case (no /dev/fd), make sure we
2926 initialize the new members of the fifo list after xrealloc
2931 - dev_fd_list: now a list of type `pid_t' so we can store process
2932 associated with the pipe fd into the right element; change all
2933 necessary functions (copy_fifo_list, add_fifo_list)
2934 - process_substitute: store pid of child process into the right
2935 index in dev_fd_list after opening the pipe. Process ID of -1 means
2936 process has been reaped and fd needs to be closed (or FIFO needs to
2937 be unlinked); value of 0 means slot is unused
2940 - wait_for_background_pids: call reap_procsubs to make sure we clean
2941 up all reaped process substitutions before trying to wait for
2942 everything (still needs work)
2944 tests/{run-procsub,procsub.{tests,right}}
2945 - new file, tests of process substitution that have failed in the past
2950 - wait_for_background_pids: warn if one of the jobs is stopped
2953 - wait_procsubs: new function, call wait_for for every "live" process
2957 - wait_for_background_pids: call wait_procsubs to reap any living
2958 process subsitutions
2963 - parser_if: add support for testing the readline version, using the
2964 full set of arithmetic comparison operators (and supporting both
2965 = and ==), using version numbers of the form major[.[minor]]
2970 - string_list_dollar_star: now takes QUOTED and PFLAGS arguments like
2971 string_list_dollar_at, changed all callers. Not used yet.
2976 - param_expand: broke out cases of expanding unquoted (quoted == 0)
2977 $* on the rhs of an assignment statement (pflags & PF_ASSIGNRHS)
2978 with various values of IFS (unset, null, set to non-null value) to
2979 capture the expansion subtleties. From a report back on 11/24 by
2980 Martijn Dekker <martijn@inlv.org>
2985 - set_element_value: new define, sets array element AE to VALUE
2988 - set_pipestatus_array: use set_element_value where appropriate
2993 - parameter_brace_find_indir: when expanding the indirect parameter
2994 to find the eventual variable name, we don't perform word splitting.
2995 Make sure this does the right thing for * and @. Fixes bug
2996 reported by isabella parakiss <izaberina@gmail.com>
3000 doc/{bush.1,bushref.texi}
3001 - indirect expansion: make sure to note that the value of the indirect
3002 variable does not undergo word splitting as one of its expansions,
3003 as in fix from 12/18
3008 - parameter_brace_expand_rhs: make sure the value this function returns
3009 when OP is `=' is quoted appropriately, as the callers expect. More
3010 changes from Posix interp 221. Fixes report from Martijn Dekker
3014 - assign_hashcmd: if running in a restricted shell, make sure the
3015 target of the hash assignment can be found via a $PATH search, to
3016 prevent users assigning commands to the hash table they would not
3017 ordinarily have access to. Fixes issue raised by Drew Parker
3018 <andrew.s.parker2@gmail.com>
3021 - hash_builtin: if running in a restricted shell, make sure the
3022 pathname target of `hash -p' can be found via a $PATH search, to
3023 prevent users assigning commands to the hash table they would not
3024 ordinarily have access to.
3028 array.c,arrayfunc.c,...
3029 - many changes to clean up unused variables and functions. From a
3030 report from Siteshwar Vashisht <svashisht@redhat.com>
3034 lib/readline/terminal.c
3035 - _rl_term_clrscroll: save the `E3' termcap capability, which clears
3036 the scrollback buffer where supported. Unused right now
3038 lib/readline/rlprivate.h
3039 - _rl_term_clrscroll: extern declaration
3042 - parser_if: added simple variable comparison capability. Allowable
3043 operators are `=', `==', and `!='; boolean variables must be
3044 compared to either `on' or `off'; variable names must be separated
3045 from the operator by whitespace
3047 doc/bush.1,lib/readline/doc/{rluser.texi,readline.3}
3048 - document new `if variable comparison value' construct
3053 - EXTMATCH: when matching against !(patlist), if a filename beginning
3054 with a `.' does not match any of the patterns in patlist, don't
3055 return it as a match if leading dots need to be matched explicitly
3056 (flags & FNM_PERIOD). Report from Eric Cook <llua@gmx.com>
3061 - bind_function_def: takes an additional flags argument. If FLAGS&1,
3062 overwrite any existing function_def hash table entry; if FLAGS==0,
3063 leave any existing function_def alone.
3066 - make_function_def: call bind_function_def with flags == 0
3069 - execute_intern_function: call bind_function_def with flags == 1 so
3070 we have function_def information that's correct for where the
3071 function is defined, not just where it's last parsed. Fixes report
3072 from Bruno Vasselle <bruno.vasselle@laposte.net>; final piece of
3078 - param_expand: deal with string_list_dollar_star returning NULL.
3079 Fixes bug reported by Martijn Dekker <martijn@inlv.org>
3081 builtins/history.def
3082 - history_builtin: enabled code that performs range deletion
3087 - do_assignment_internal: if performing a compound assignment, make
3088 sure to pass ASS_CHKLOCAL flag to do_compound_assignment if the
3089 assignment word has the W_CHKLOCAL flag set
3090 - do_compound_assignment: honor ASS_CHKLOCAL flag and check for an
3091 existing local variable before creating or modifying a global
3094 builtins/declare.def
3095 - declare_internal: new (undocumented so far) option: -G. Means to
3096 act on global variables (create, modify) if no local variable is
3097 found with the specified name
3098 - declare_find_variable: new declare-specific wrapper functon for
3099 declare builtin; obeys -g and -G options in one place
3100 - declare_internal: if no variable is found after following any nameref
3101 chain, look up the variable using declare_find_variable to honor the
3102 -G option. XXX - so far, this is the only place that function is used
3105 - shell_expand_word_list: before calling make_internal_declare, add
3106 'G' to the options list if W_CHKLOCAL is set in the word's flags.
3107 This makes builtins like `readonly' that modify local variables in
3108 a function behave the same for scalar and array variables
3113 - shell_getc: move code that decides whether to append a space to an
3114 alias expansion here from mk_alexpansion, so we can inhibit adding
3115 a space if we're currently parsing a single or double quoted string
3121 - clear_string_list_expander: take a pointer to an alias that's about
3122 to be freed and make sure there aren't any pointers to it in the
3123 list of pushed strings. If there are, zero it out in the pushed
3124 string list to avoid referencing freed memory in pop_string()
3127 - free_alias_data: if an alias being freed is currently being expanded,
3128 call clear_string_list_expander to remove references to it from the
3129 list of pushed strings
3134 - progcomp_search: add code to look up an alias for the CMD argument
3135 and return the completions for the first word of that alias if one
3136 is found. Just a start at completing aliases, a much-requested
3140 - COPT_LASTUSER: last flag value used by user-settable completion
3142 - PCOMP_RETRYFAIL, PCOMP_NOTFOUND: new #defines, possible return values
3143 from programmable_completions in FOUNDP argument. Moved RETRYFAIL
3144 define here from pcomplete.c to avoid collisions with user-settable
3145 option values (COPT_*)
3150 - programmable_completions: if we don't find any completions for a
3151 command, and RETRY is 0, see if the command is a defined alias,
3152 expand it, and try to expand the first word of the value as a
3153 command, and find any programmable completions for it. Here right
3154 now, could be moved to attempt_shell_completion later if we need
3155 to do more analysis of the expanded line. We'll see how it works
3156 in practice. (Disabled for now.)
3161 - grammar: when timing the null command, make sure to turn off the
3162 flags in parser_state (PST_REDIRLIST) that make_simple_command sets
3163 when given a NULL second argument, since it assumes that it's going
3164 to turn those off when it gets the next word of the simple command
3165 (which it never gets in this case). Fixes bug reported by
3166 Anti Räis <antirais@gmail.com>
3170 lib/readline/rltty.c
3171 - prepare_terminal_settings (termios/termio): if there is a function
3172 bound to the VDISCARD character in the current keymap, set VDISCARD
3173 to _POSIX_VDISABLE while readline is active. From a report from
3174 Rhialto <rhialto@falu.nl>
3178 builtins/history.def
3179 - histtime: check whether or not localtime() returns NULL, and make
3180 sure we only call strftime() with a valid struct tm. This can happen
3181 when the timestamps in the history file overflow a time_t. Fixes bug
3182 reported by Luke Dashjr <luke@dashjr.org>
3185 - edit_and_execute_command: if we're in vi editing mode, make sure
3186 we end up in insert mode after executing the commands from the
3187 edited file. This seems to be what other shells do. Report from
3188 Stan Marsh <gazelle@xmission.com>
3193 - command_word_completion_function: match alias and shell function
3194 names case-insensitively if the readline completion-ignore-case
3195 variable is set. Inspired by report from <odnehel@gmail.com>
3197 lib/readline/display.c
3198 - update_line: when performing a dumb update after wrapping the line
3199 (usually due to printing the prompt), make sure we adjust
3200 _rl_last_c_pos if there are invisible characters in prompt lines
3201 other than the first (we assume those invisible characters are in
3202 the last line, which is nearly always the case). We adjust by the
3203 total number of invisible chars less the number of invisible chars
3204 in the first prompt line. From a report in
3205 https://bugs.launchpad.net/ubuntu/+source/bush/+bug/1745273
3208 - execute_command_internal: if redirections attached to a compound
3209 command fail, make sure we discard the `internal_fifos' unwind-
3210 protect frame after freeing the copied fifo_list and before returning
3214 lib/readline/rlprivate.h
3215 - BRACK_PASTE_FINI: add \r to the end of the string to avoid problems
3216 with the tty driver thinking the cursor was in the wrong position.
3217 Fixes issue reported by Egmont Koblinger <egmont@gmail.com>
3222 - zread,zreadintr: call check_signals() before calling read() to
3223 minimize the race window between signal delivery, signal handling,
3224 and a blocking read(2). Partial fix for FIFO read issue reported by
3225 Oyvind Hvidsten <oyvind.hvidsten@dhampir.no>
3227 doc/{bush.1,bushref.texi}
3228 - shopt: document `assoc_expand_once' shell option
3233 - DONT_REPORT_SIGTERM: define, so non-interactive shells will no
3234 longer print termination messages for child processes killed by
3240 - rl_insert: don't attempt to optimize typeahead if we are only reading
3241 a fixed number of characters (rl_num_chars_to_read > 0)
3244 - redir_special_open: if the shell is restricted, return a
3245 RESTRICTED_REDIRECT error for attempts to open /dev/tcp and /dev/udp
3246 sockets. Inspired by report from Blake Burkhart <bburky@bburky.com>
3247 - do_redirection_internal: if redir_open returns RESTRICTED_REDIRECT,
3248 return that right away (instead of errno) so we can print a better
3254 - bgp_resize: fix problems with (pid_t) overflow when calculating new
3255 size for table when js.c_childmax is near the limit of a pid_t
3256 (e.g., 2**31 - 1 on a 32-bit system, or 2**63-1 on a system with
3257 32-bit pid_t). Fixes hang reported by Natanael Copa
3258 <ncopa@alpinelinux.org> based on his patch from 12/8.
3259 - bgp_resize: cap max table size for bgpids at MAX_CHILD_MAX (32768)
3262 - TYPE_MINIMUM, TYPE_MAXIMUM: updated definitions from coreutils-8.29,
3263 silences some compiler warnings
3268 - maybe-clean: use cd and pwd -P to test whether or not two directory
3269 names identical, since topdir = '.' and BUILD_DIR = full pathname
3270 when you use something like `bush ./configure'. Problem reported by
3271 Michael Felt <aixtools@gmail.com>
3274 - split_at_delims: if SD_NOQUOTEDELIM is in the flags argument, don't
3275 treat `'' and `"' as candidates for possible sequences of delimiters,
3276 even if they're part of the delimiter set (the delims argument).
3277 Fixes problem with completing lines like `foo --bar='quux baz' xx'
3278 reported by Nick Patavalis <npat@efault.net>
3283 - copy_word_list: build the list in the right order, avoiding having
3284 to reverse it at the end. Helps with long argument lists
3287 - bind_args: build the argument list in the right order, avoiding
3288 having to reverse it at the end.
3289 - bind_args: only call push_args to save argc and argv as BUSH_ARGC
3290 and BUSH_ARGV if debugging mode is enabled (debugging_mode != 0).
3291 Inspired by report from Ambrose Feinstein <ambrose@google.com>
3292 - bind_args: note that we've saved BUSH_ARGC and BUSH_ARGV by setting
3293 bush_argv_initialized
3294 - shell_reinitialize: reset bush_argv_initialized back to 0 so
3295 BUSH_ARGV and BUSH_ARGC will be recreated if we're in debugging mode
3298 - save_bush_argv: new function, initializes BUSH_ARGV and BUSH_ARGC
3299 from the saved positional parameters
3300 - init_bush_argv: initialize BUSH_ARGV and BUSH_ARGC if
3301 bush_argv_initialized == 0
3304 - shopt_set_debug_mode: if we're turning on debug mode, initialize
3305 BUSH_ARGC and BUSH_ARGV if bush_argv_initialized == 0
3310 - execute_function: make sure BUSH_ARGV and BUSH_ARGC are initialized
3311 before calling push_args (and before calling remember_args)
3314 - source_builtin: make sure BUSH_ARGV and BUSH_ARGC are initialized
3315 before calling push_args (and before calling remember_args)
3318 - _evalfile: if the shell compatibility level is 44 or lower, make
3319 sure BUSH_ARGV and BUSH_ARGC are initialized before calling
3323 - compat44: new shell option. This will be the last compatXX option
3325 doc/{bush.1,bushref.texi}
3326 - compat44: document new shell option
3331 - ISOPTION: check s[1] before s[2] to avoid out of bound reads. Fixes
3332 bug reported by jeremy@feusi.co
3335 - B_SHAREDBUF: new flag for buffered input fds, indicates that this
3336 fd shares its b_buffer with another fd
3339 - duplicate_buffered_stream: when duplicating *from* the buffer
3340 corresponding to bush input, make sure the new buffer has B_SHAREDBUF
3341 in the flags, because copy_buffered_stream copies pointers
3342 - duplicate_buffered_stream: if the buffer being copied to has the
3343 B_SHAREDBUF flag set, make sure the b_buffer doesn't get freed.
3344 Fixes use-after-free bug reported by jeremy@feusi.co
3345 - save_bush_input,close_buffered_stream: make sure a buffer with
3346 B_SHAREDBUF set has its b_buffer set to NULL before calling
3347 free_buffered_stream
3352 - parameter_brace_expand_error: add parameter saying whether or not
3353 we are checking whether value is null, so we can have different
3354 error messages for ${x:?} and ${x?}. Report and fix from
3355 don fong <dfong@dfong.com>
3360 - _rl_read_file: instead of calling stat/open on the passed filename,
3361 use open/fstat to avoid one possible filename translation and close
3362 a small (benign) race condition. Report and fix from Roy Ivy
3363 <roy.ivy.iii@gmail.com>
3368 - makunbound: if new variable localvar_unset is non-zero, mark local
3369 vars in previous scopes as invisible and unset so they will show
3370 up as unset until that previous scope returns (similar to how local
3371 variables in the current local scope are handled). localvar_unset
3372 is currently set to 0 with no way for a script to change its value.
3373 Eventually there will be an option to modify it. From a bug-bush
3374 discussion started by Nikolai Kondrashov <spbnick@gmail.com> back
3380 - expand_word_list_internal: short-circuit and exit right away if a
3381 variable assignment preceding a special builtin fails in posix mode
3382 - expand_word_list_internal: if a variable assignment precedes an
3383 empty command name (after expansion), fix to exit right away when
3384 the shell is in posix mode
3388 doc/{bush.1,bushref.texi}
3389 - Add text to Pathname Expansion clarifying that a slash must be
3390 matched by a slash in the pattern when matching pathnames, but
3391 not in other matching contexts. Suggested by <stormy1777@yahoo.com>
3394 - read_octal: allow octal numbers greater than 777 to accommodate
3395 modes and umasks that include sticky/setuid/setgid bits. Report
3396 and fix from Martijn Dekker <martijn@inlv.org>
3401 - rl_generic_bind: make sure we only assign to prevkey in the loop
3402 if the key sequence index is > 0, so ic is valid. Fixes bug
3403 reported by Koichi Murase <myoga.murase@gmail.com>
3406 - read_builtin: be slightly less aggressive checking for timeouts and
3407 SIGALRM: if we successfully read a character, don't check for a
3408 timeout until we store or process it. Fixes timing problem
3409 reported by Rob Foehl <rwf@loonybin.net>
3414 - termsig_handler: add a call to exit(1) after the kill, just in case
3415 there are circumstances where the SIG_DFL signal handler is
3416 ignored. Report from Andrei Vagin <avagin@gmail.com>
3421 - _rl_function_of_keyseq_internal: new internal function that takes a
3422 length parameter to accommodate NUL in the key sequence. Patch from
3423 Koichi Murase <myoga.murase@gmail.com>
3424 - rl_function_of_keyseq_len: new application-callable function that
3425 takes a length parameter; otherwise equivalent to rl_function_of_keyseq.
3427 lib/readline/readline.h
3428 - rl_function_of_keyseq_len: add extern declaration for new function
3430 lib/readline/doc/rltech.texi
3431 - rl_function_of_keyseq_len: document new function interface
3434 - bush_execute_unix_command: use rl_function_of_keyseq_len to handle
3435 key sequences with embedded NULs (\C-@). Fix from Koichi Murase
3436 <myoga.murase@gmail.com>
3439 - rl_bind_key_if_unbound,rl_bind_key_if_unbound_in_map: run the KEY
3440 argument through rl_untranslate_keyseq to produce a symbolic sequence
3441 that can encode \C-@.
3442 - rl_bind_keyseq_if_unbound_in_map: translate the key sequence in order
3443 to accommodate symbolic key sequences; should be a no-op for `raw'
3444 key sequences such as the arrow key seqeunces from terminfo. Change
3445 from Koichi Murase <myoga.murase@gmail.com>
3450 - wait_for: when setting the SIGINT signal handler to wait_sigint_handler
3451 make sure we're not setting old_sigint_handler recursively, as we
3452 can when running an external command in a trap we took after a
3453 command exited due to SIGINT. We don't want to overwrite
3454 old_sigint_handler here. Fixes bug reported by Dr. Werner Fink
3458 - execute_disk_command: when there is a command_not_found_hook, make
3459 sure the subshell turns off job control before running it, in case
3460 it runs processes. We don't want it to manipulate process groups.
3461 Fixes bug reported by ÐиÑиллов Ðима <dk.1997-fast@yandex.ru>
3462 - execute_command_internal: make sure the command run by the `command'
3463 builtin doesn't cause the ERR trap to be executed; wait for the
3464 status to be returned by the command builtin. Fixes bug reported by
3465 Martijn Dekker <martijn@inlv.org>
3470 - process_substitute: handle longjmp back to top_level and function
3471 returns (return_catch) in the child process, like command
3472 substitution, so we don't longjmp back to some arbitrary spot from
3473 the `exit' or `return' builtins, or on an expansion error, like
3474 the command timing code. Fixes bug reported by Basin Ilya
3475 <basinilya@gmail.com>
3480 - read_token_word: when reading a matched pair of backquotes as part
3481 of a word, treat it as quoted so the characters are read as a single
3482 word, but do not let the presence of the backquote mark the word as
3483 quoted. Fixes here-document delimiter bug reported by Denys Vlasenko
3484 <dvlasenk@redhat.com>
3489 - execute_case_command: call quote_string_for_globbing with the
3490 QGLOB_CTLESC flag for both quoted and unquoted words, so it will
3491 remove CTLESC/CTLESC in all cases while converting other quoted
3492 characters to use a preceding backslash. Bug reported by
3493 Martijn Dekker <martijn@inlv.org>
3498 - posix_cclass_only: helper function that checks whether a pattern has
3499 only posix single-byte character classes ([:alpha:], etc.) or has
3501 - xstrmatch: if running in a multibyte locale, make sure to short-
3502 circuit to the single-byte matching code only if there are no
3503 unrecognized character class names, since the wide character ctype
3504 functions allow locales to define their own character class names
3505 (e.g., "hyphen"). Fixes issue reported by yangyajing <yyj_cqu@163.com>
3509 configure.ac,cross-build/qnx.cache
3510 - qnx: add a configure cache file for cross-building, treat qnx 7 like
3511 qnx 6 in terms of cpp options. Fix from Brian Carnes
3512 <bcarnes@google.com>
3515 - BUSH_CHECK_DEV_STDIN: experimental change to test for /dev/stdin
3516 independently of /dev/fd or /proc/self/fd. Suggested for QNX by
3517 Brian Carnes <bcarnes@google.com>
3523 - glob_testdir: return -2 if DIR is a symlink, to differentiate it from
3524 any other kind of non-directory file
3525 - glob_vector: if we have GX_ALLDIRS (globstar), we want to skip over
3526 symlinks to directories, since we will pick up the real directory
3527 later. Fixes incompatibility reported by Murukesh Mohanan
3528 <murukesh.mohanan@gmail.com>
3531 - bush_execute_unix_command: changes to make READLINE_POINT apply to
3532 characters instead of bytes when in a multibyte locale. Report and
3533 fix from Koichi Murase <myoga.murase@gmail.com>
3537 builtins/evalstring.c
3538 - parse_and_execute_cleanup: now takes an argument which is the value
3539 of running_trap at some point before parse_and_execute was called;
3540 changed callers in sig.c, builtins/evalfile.c
3543 - parse_and_execute_cleanup: changed prototype
3547 builtins/evalstring.c
3548 - parse_and_execute_cleanup: if the argument holding the previous state
3549 of running_trap is the same value as the current running_trap state,
3550 don't call run_trap_cleanup: assume that there is a caller who will
3551 take care of the cleanup after this returns. Fixes recursive trap
3552 call on "eval return" reported by Martijn Dekker <martijn@inlv.org>
3555 - read_a_line: if remove_quoted_newline is non-zero, indicating the
3556 here-document delimiter is unquoted, we will be running the contents
3557 of the here-document through word expansion and need to quote CTLESC
3558 and CTLNUL in the input. Fixes bug with ^A in here document reported
3559 by Jorge Alberto Baca Garcia <bacagarcia@me.com>
3564 - quote_string_for_globbing: make sure the QGLOB_CTLESC code handles
3565 both CTLESC CTLESC and CTLESC CTLNUL in the same way. Fixes bug
3566 reported by Martijn Dekker <martijn@inlv.org>
3571 - execute_command_internal: before executing any command in the current
3572 shell, and before copying any existing FIFO list, call
3573 reap_procsubs to unlink or close any process substitution pipes
3574 associated with processes that have exited. Fixes hang in test suite
3575 when trying to open a FIFO with no process having it open for
3581 - read_token_word: if returning REDIR_WORD for a {id}>foo construct,
3582 for example, make sure to assign the_word to yylval.word before
3583 returning, in case a recursive call to the parser overwrites it
3584 (e.g., when evaluating array indexes). From a message to
3585 austin-group-l from Stephane Chazelas <stephane.chazelas@gmail.com>
3588 - BRACKMATCH: if we have an invalid character class in an otherwise
3589 well-formed bracket expression, don't try to match each character
3590 of the (invalid) class individually; just skip over the class and
3591 move on. From a message on the austin-group list from
3592 Stephane Chazelas <stephane.chazelas@gmail.com>
3597 - push_exported_var,push_func_var,push_temp_var: make sure to set the
3598 context correctly in the variable we bind in the previous (non-temp)
3599 scope. Report from Martijn Dekker <martijn@inlv.org>
3602 - unquoted_glob_pattern_p: a pattern that contains a backslash can
3603 have it removed by the matching engine (since backslash is special
3604 in pattern matching), so if the pattern contains a backslash, and
3605 does not end in a backslash, we need to return true. Fixes bug
3606 reported by Robert Elz <kre@bmunnari.OZ.AU>
3608 lib/glob/glob_loop.c
3609 - INTERNAL_GLOB_PATTERN_P: same change to return TRUE for a backslash
3610 that doesn't end the pattern
3613 - print_timeval: use locale_decpoint() instead of fixed `.' to print
3614 decimal point. Bug report in austin-group email from Joerg Schilling
3615 <Joerg.Schilling@fokus.fraunhofer.de>
3618 - print_clock_t: use locale_depoint() in the same way as print_timeval
3623 - expand_cond_node: if special != 0, make sure to add QGLOB_CTLESC
3624 to the flags passed to quote_string_for_globbing. Same issue as the
3625 one with `case' fixed on 4/7, report from Martijn Dekker
3631 - do_redirection_internal: r_close_this: if the file descriptor is
3632 already closed before the shell is asked to close it, make sure to
3633 add an undo list redirect to make sure it stays closed. Report from
3634 Martijn Dekker <martijn@inlv.org>
3639 - push_posix_temp_var: new function, takes the SHELL_VAR * passed as
3640 an argument and uses the name and value to create a global variable
3641 - merge_temporary_env: if posixly_correct is set, call
3642 push_posix_temp_var to create global variables, otherwise call
3643 push_temp_var to preserve the old behavior. Right now, it's only
3644 called when in posix mode, but that might change. This undoes the
3645 change from 4/27 when in posix mode
3650 - struct that holds the terminating signal information has a new
3651 field: whether that signal is expected to cause a core dump
3652 - termsig_handler: if the call to kill(2) doesn't kill the process,
3653 we have a problem. If our pid is not 1, we just exit with status
3654 128+sig (fake the sig exit status). If the pid is 1, we assume
3655 we're in a Linux pid namespace and aren't allowed to send a signal
3656 to ourselves. If we need to generate a core dump, we try to get
3657 the kernel to SIGSEGV us by dereferencing location 0. If not, we
3658 just exit with 128+sig. From a report and patch from Andrei Vagin
3659 <avagin@virtuozzo.com>
3664 - bush_execute_unix_command: make sure that parse_and_execute is called
3665 with newly-allocated memory to avoid prematurely freeing the
3666 command. Report and fix from Koichi Murase <myoga.murase@gmail.com>
3671 - syslog_history: a shell option to control whether history is logged
3672 to syslog; can be modified at runtime. Original patch from
3673 Siteshwar Vashisht <svashisht@redhat.com>
3676 - SYSLOG_SHOPT: new configurable option, determines whether there is a
3677 shell option to control syslogging history lines at runtime and sets
3678 the default value of the option
3681 - syslog_history: new variable to control whether history lines are
3682 sent to syslog; default value is the value of SYSLOG_SHOPT (or 1
3683 if that's not defined)
3684 - bush_add_history: send history lines to syslog if syslog_history is
3691 - push_var_context: if we are in Posix mode and manipulating the
3692 temporary environment (temporary_env), implement behavior specified
3693 in Posix interp 1009 and make sure that temporary assignments
3694 preceding function calls modify the current environment *before*
3695 the function is executed.
3697 [bush-5.0-alpha frozen]
3702 - execute_in_subshell: subshells should set loop_level == 0, since
3703 they are no longer "enclosed" by the loop, according to posix.
3704 Report from Aeron.E. Wang <aeron.e.wang@gmail.com>
3709 - pkgconfigdir: don't fail installing bush.pc if this directory doesn't
3710 exist or isn't writable -- there's no error in failing to install
3711 something nothing will use
3712 - install-headers-dirs: creat $(pkgconfigdir) if it doesn't exist
3715 - utf8_mblen: replace with version from gnulib
3716 - utf8_mbstrlen: reimplement using utf8_mblen so it handles invalid
3717 multibyte sequences in the same way as mbstrlen
3719 lib/readline/mbutil.c
3720 - _rl_utf8_mblen: utf-8 specific version of mblen from gnulib
3723 - ADVANCE_CHAR,COPY_CHAR_P: do better job detecting end of string in
3724 UTF-8 locales (should not be called with an empty string, but to
3730 - new file, utf-8-specific functions collected from other files
3733 - extern declarations moved around for utf8.c
3736 - SADD_MBCHAR, SADD_MBQCHAR_BODY, ADVANCE_CHAR_P: if the locale is a
3737 UTF-8 locale, don't bother with a call to mbrlen if the current
3738 character cannot start a multibyte character
3741 - push_var_context: only merge the temporary environment in posix mode
3742 if we are executing a shell function (flags & VC_FUNCENV). Report
3743 from Martijn Dekker <martijn@inlv.org>
3745 lib/readline/mbutil.c
3746 - _rl_get_char_len: don't call mbrlen if we are in a UTF-8 locale and
3747 the character cannot start a multibyte sequence
3750 - read_builtin: if mb_cur_max > 1, call read_mbchar only if we're not
3751 in a utf-8 locale or, if we are, the character we just read indicates
3752 the start of a multibyte sequence
3755 - string_extract_verbatim: don't call MBRLEN if we're in a utf-8
3756 locale and the current character can't start a multibyte sequence
3757 - setifs: don't call MBRLEN if we're in a utf-8 locale and the first
3758 character of $IFS can't start a multibyte sequence
3761 - rl_bracketed_paste_begin: make sure we return 0 here if rl_insert_text
3762 returns the right number of characters inserted to be consistent
3763 with other functions. Returns 1 otherwise. Report and fix from
3764 Gabe Krabbe <gabe@rtfs.de> back in March, 2018
3766 lib/readline/readline.c
3767 - rl_subseq_result: make sure r is < 0 before checking map[ANYOTHERKEY]
3768 to see if we shadowed a key that should now be tried
3773 - assign_aliasvar: perform same validity check on subscript assignment
3774 as alias builtin performs on name argument. Bug report from
3775 Mike Jonkmans <bushbug@jonkmans.nl>
3779 builtins/setattr.def
3780 - set_var_attribute: we should not propagate a variable assignment
3781 preceding a builtin back to the calling environment unless the
3782 shell is in posix mode. Since previous versions of the shell do
3783 this, setting the shell compatibility level to 44 or less will
3784 continue the propagation behavior
3788 lib/readline/histexpand.c
3789 - history_tokenize_word: as part of teaching history tokenization more
3790 and more about shell syntax, allow command and process subsitution
3791 and extended globbing patterns to appear within a word being
3792 tokenized and not just at the beginning. Fixes bug reported back in
3793 2/2017 by ecki@tofex.de
3796 - load_history: use HISTSIZE_DEFAULT (still defaults to "500") to set
3797 the initial value of $HISTSIZE. HISTSIZE_DEFAULT can be overridden
3803 - make sure we link against an external readline library that's at
3809 - INITIALWORD: internal compspec name for programmable completion on
3810 the initial (usually the command) word
3813 - attempt_shell_completion: if we are in a command position and the
3814 user has defined a compspec for INITIALWORD, use programmable
3815 completion to complete command words. Original patch from
3816 Luca Boccassi <bluca@debian.org>
3818 lib/readline/doc/rluser.texi,builtins/complete.def,doc/bush.1
3819 - make it clearer that -D takes precedence over -E when supplied as
3820 options to `complete', not when they are applied during completion
3822 builtins/complete.def
3823 - complete_builtin,compgen_builtin: add support for -I option
3824 - print_one_completion,print_compopts: display -I when appropriate
3826 lib/readline/doc/rluser.texi,doc/bush.1
3827 - complete,compgen: document new -I option and its effect
3831 lib/readline/histfile.c
3832 - read_history_range: don't apply the heuristic and try to append a
3833 history line to an existing history entry if we don't have any
3834 history entries. Bug and fix from Edward Huff <ejhuff@gmail.com>
3839 - attempt_shell_completion: don't all the programmable completion for
3840 INITIALWORD if programmable completion is disabled
3841 - attempt_shell_completion: make sure in_command_position remains set
3842 for an empty command word on an otherwise blank line, making the
3843 presence of assignment statements optional. Report from
3844 Luca Boccassi <bluca@debian.org>
3849 - morecore,internal_malloc,internal_free: requests for more than
3850 128K bytes (defined as MMAP_THRESHOLD and saved in the new
3851 malloc_mmap_threshold variable) are now satisfied via mmap and
3852 freed via munmap. We only use mmap if we have mmap and MAP_ANON
3853 (or MAP_ANONYMOUS). These blocks are not available for splitting
3854 or coalescing, so every request for 128K bytes or smaller is
3855 satisfied via sbrk(). We don't use mremap for realloc yet, but
3856 we could in the future
3859 - malloc_stats: the malloc stats now include the number of calls to
3860 mmap and the total number of bytes requested via mmap. The number
3861 of calls to munmap is captured in each bucket's lesscore count
3864 - print_malloc_stats: now prints an indication of where the change from
3865 sbrk to mmap takes place, and prints number of mmap calls and total
3866 number of bytes allocated using mmap
3871 - get_bushargcv: new dynamic "fetch" variable for BUSH_ARGV and
3872 BUSH_ARGC, for backwards compatibility: if a script makes a
3873 reference to either variable at the top level (not in a shell
3874 function) without enabling debugging mode and not having initialized
3875 the variable previously (using a simple semaphore), create the
3881 - opt_bush_malloc: bush malloc no longer disabled for systems that
3882 require eight-bit alignment; the bush malloc has had this for a
3888 - pre_process_line: if command-oriented history is enabled, and the
3889 line being expanded is the second or later in a multi-line command,
3890 and we know the command is being saved as the current history entry,
3891 decrease history_length before calling history_expand so references
3892 like !! refer to the previous history entry as usual
3894 lib/readline/histexpand.c
3895 - history_quoting_state: new variable, can be set by calling
3896 application before calling history_expand to note that the string
3897 being expanded is part of a quoted string. Can be set to a single
3898 quote, a double quote, or 0 (no quoting)
3899 - history_expand: look at history_quoting_state and honor the
3900 single-quote setting by not expanding any initial portion of the
3901 line before the closing single quote. This allows history expansions
3902 to be performed on a line containing a closing single quote if they
3903 appear after the single quote
3905 lib/readline/history.h
3906 - history_quoting_state: extern declaration
3909 - bush_history_inhibit_expansion: if history_quoting_state indicates
3910 that this string is single-quoted, skip over the single-quoted
3911 portion and determine whether or not the portion after the
3912 quoted string needs to be inhibited from history expansion
3915 - shell_getc: set history_quoting_state based on the contents of the
3916 current delimiter before calling pre_process_line
3920 lib/readline/doc/hsuser.texi
3921 - describe the default behavior of backslash and single and double
3924 lib/readline/doc/hstech.texi
3925 - history_quoting_state: describe effect of setting this variable
3926 - history_quotes_inihibit_expansion: expand the description to include
3927 the default quoting behavior that setting this variable enables
3932 - unescape: use memmove instead of strcpy to handle overlapping strings
3933 Report and fix from Bernhard M. Wiedemann <bwiedemann@suse.de>
3936 - getenv: check that environ is non-NULL before looking through it.
3937 Report and fix from Keeley Hoek <keeley@hoek.io>
3942 - mkseq: use better integer overflow handling for systems with 32-bit
3943 ints and 64-bit intmax_ts. Bug reported by Simon Wörner
3944 <mail@simon-woerner.de> as the result of fuzzing
3946 builtins/declare.def
3947 - declare_internal: make sure bind_variable returns non-NULL when
3948 setting attributes for a variable named as an argument to declare
3949 that also appears in the temporary environment (and is a nameref).
3950 Bug reported by Simon Wörner <mail@simon-woerner.de as the
3954 - bind_variable_internal: if we're assigning through a nameref, don't
3955 create a variable with an invalid name under any circumstances
3958 - get_job_spec: make sure to return NO_JOB if atoi() returns < 0 due
3959 to integer overflow.
3960 Bug reported by Simon Wörner <mail@simon-woerner.de as the
3966 - execute_in_subshell: don't call set_sigint_handler if the subshell
3967 is asynchronous, since it undoes the signal handler installed by
3968 setup_async_signals. Fixes bug reported by Daniel Mills
3969 <danielmills1@gmail.com>
3972 - reset_readahead_token: new convenience function for the rest of
3973 the shell, resets token_to_read if it's a newline (as it will be
3974 after reset_parser is called)
3977 - reader_loop: if we're just going to execute one command, make sure
3978 the read-ahead token isn't set to something that will result in a
3979 NULL command (by calling reset_readahead_token), since the code
3980 will take that as the one command and set EOF_Reached
3984 doc/{bush.1,bushref.texi}
3985 - indirect expansion: clarify that the expansion works on parameters,
3986 not just variables (NAMEs). Suggested by konsolebox
3987 <konsolebox@gmail.com>
3991 doc/{bush.1,bushref.texi}
3992 - INSIDE_EMACS: document its effect on line editing
3996 lib/readline/{readline.c,rlprivate.h}
3997 - _rl_eof_found: new variable, private to the readline library, that
3998 indicates whether the current call to readline() will return NULL
4001 lib/readline/rltty.c
4002 - rl_deprep_terminal: if bracketed paste mode is active, the last
4003 character of the string to disable it is \r (to avoid confusing
4004 the terminal driver about where the cursor is). In this case,
4005 output a newline before returning so subsequent text (like the
4006 `exit' bush prints) doesn't overwrite the prompt. Bug from
4007 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903936
4010 - make_local_assoc_variable: add second argument like corresponding
4011 local array function, to allow this function to return an existing
4012 local array variable to the caller for the caller to handle
4015 - make_local_assoc_variable: change function prototype to add second
4018 {subst.c,variables.c}
4019 - make_local_assoc_variable: change callers
4021 builtins/declare.def
4022 - declare_internal: call make_local_assoc_variable with a non-zero
4023 second arg to have it return an existing local array variable to be
4024 flagged as an error. Fixes bug reported by Grisha Levit
4025 <grishalevit@gmail.com>
4026 - declare_internal: call make_local_array_variable with unconditional
4027 second argument of 1 for the same reason as above
4032 - bind_invalid_envvar: new function, takes invalid names from the
4033 initial environment (names that are not valid shell identifiers) and
4034 stores them in a separate hash table (invalid_env)
4035 - maybe_make_export_env: make sure to add names from invalid_env to
4037 - assign_in_env: for now, prevent variable names that aren't shell
4038 identifiers from being added to the temporary environment. Addresses
4039 issue raised by Grisha Levit <grishalevit@gmail.com>
4042 - unary_test: rearrange code slightly to avoid a wasted variable lookup
4043 if the argument to -v is a subscripted array reference
4048 - nameref_transform_name: if a name doesn't resolve to a shell variable,
4049 this function will check whether it resolves to a nameref that
4050 points to a variable that hasn't been created yet
4053 - nameref_transform_name: extern declaration
4056 - do_compound_assignment: make sure that we follow any nameref chain
4057 if the name passed resolves to a nameref that points to a variable
4058 that doesn't exist. Fixes issue raised by Grisha Levit
4059 <grishalevit@gmail.com>
4061 builtins/declare.def
4062 - declare_internal: before calling any variant of make_local_variable,
4063 make sure to perform any transformation of the name indicated by an
4064 existing nameref. Fixes issue raised by Grisha Levit
4065 <grishalevit@gmail.com>
4069 builtins/declare.def
4070 - declare_internal: if we are creating a global variable with -g, even
4071 if we're not giving it a value, check for namerefs at the global
4072 scope to avoid confusion with namerefs at the local (function) scope.
4075 - expand_word_internal: if a double-quoted string expands to nothing,
4076 make sure we note that for later by setting had_quoted_null, just
4077 as we do for single-quoted empty strings
4080 - W_SAWQUOTEDNULL: new flag (replaces W_HASCTLESC, which is unused),
4081 means that we saw a possibly-discarded quoted null while expanding
4085 - expand_word_internal: if expansion results in a non-empty word but
4086 we saw a quoted null during expansion (had_quoted_null == 1), set
4087 W_SAWQUOTED_NULL in the returned word
4088 - expand_word_internal: if a recursive call to param_expand comes back
4089 with W_SAWQUOTEDNULL set in the resulting word, set had_quoted_null
4091 - parameter_brace_expand_rhs: if a recursive call to expand_word_internal
4092 returns a non-quoted-null string (after an optional call to
4093 string_list) make sure we pass the W_SAWQUOTEDNULL flag back to the
4095 - word_list_split: if a word expands to nothing after expansion and
4096 splitting, but we saw a quoted null during the expansion
4097 (W_SAWQUOTEDNULL), return an empty word
4103 - do_compound_assignment: if creating a local variable, make sure to
4104 set `newname' to the name of the variable returned from find_variable,
4105 since that follows namerefs. Fixes issue raised by Grisha Levit
4106 <grishalevit@gmail.com>
4111 - get_var_and_type: if VALUE is NULL, check before calling dequote_string.
4112 Report and fix from Grisha Levit <grishalevit@gmail.com>
4117 - make_local_{array,assoc}_variable: make sure we're not trying to
4118 inherit a value from an incompatible array type. Fixes issue raised
4119 by Grisha Levit <grishalevit@gmail.com>
4120 - nameref_transform_name: if we're trying to resolve a nameref that
4121 will be used to create a local variable, make sure the nameref is
4122 at the same variable scope. Report from Grisha Levit
4123 <grishalevit@gmail.com>
4128 - array_subrange: change to use string_list_pos_params after creating a
4129 WORD_LIST from the array slice, like assoc_subrange does
4132 - parameter_brace_substring: since assoc_subrange and array_subrange
4133 both call string_list_pos_params now, treat the results the same as
4134 the VT_POSPARAMS case (pos_params also calls string_list_pos_params).
4135 Fixes behavior difference between ${a[@]:sub} and ${@:sub} reported
4136 by Ilkka Virta <itvirta@iki.fi>
4141 - array_patsub: rewrite to work in terms of a WORD_LIST * and call
4142 string_list_pos_params on the result to be consistent with the
4143 expansions of ${@/pat/rep} and ${*/pat/rep}
4146 - assoc_patsub: rewrite to work in terms of a WORD_LIST * and call
4147 string_list_pos_params on the result to be consistent with the
4148 expansions of ${@/pat/rep} and ${*/pat/rep}
4151 - parameter_brace_patsub: change how return value of {array,assoc}_patsub
4152 is treated to make it identical to pos_params_pat_subst, since they
4153 all call string_list_pos_params now
4154 - expand_string_for_pat: make sure we preserve the value of
4155 expand_no_split_dollar_star instead of just unconditionally setting
4156 it back to 0 in case it was 1 before this function was called
4161 - array_modcase: rewrite to work in terms of a WORD_LIST * and call
4162 string_list_pos_params on the result to be consistent with the
4163 expansions of ${@,,} and ${*,,}
4166 - assoc_modcase: rewrite to work in terms of a WORD_LIST * and call
4167 string_list_pos_params on the result to be consistent with the
4168 expansions of ${@,,} and ${*,,}
4171 - parameter_brace_casemod: change how return value of {array,assoc}_modcase
4172 is treated to make it identical to pos_params_modcase, since they
4173 all call string_list_pos_params now
4177 builtins/declare.def
4178 - declare_internal: if we are making local variables, and not dealing
4179 with the nameref attribute, make sure that any nameref variable we
4180 followed when resolving the name given was at the same variable
4181 context. If not, we just want to make or use a local variable with
4182 the name passed; if so, we want to use the nameref value as the
4183 variable name. Report from Grisha Levit <grishalevit@gmail.com>
4188 - globasciiranges: RRI now on by default, must be turned off explicitly
4189 at configure time or runtime with `shopt -u globasciiranges'
4194 - dispose_saved_dollar_vars: decrement stack pointer before looking
4195 for saved positional parameters to dispose; stack pointer always
4196 points to the first unused slot
4201 - dollar_arg_stack: now a stack of struct saved_dollar_vars, which has
4202 an array for the first ten (dollar_vars) and a WORD_LIST * for the
4203 remaining (rest_of_args). Fixes performance issue with function calls
4204 and large numbers of positional parameters raised by
4205 Bize Ma <binaryzebra@gmail.com>
4206 - {save,restore,free,free_saved}_dollar_vars: new functions to manage
4207 dollar_vars and dollar_arg_stack members. Need to keep these in sync
4208 with whatever remember_args does
4209 - push_dollar_vars: use save_dollar_vars, which just copies pointers,
4210 and directly assign rest_of_args, without copying the words, to the
4211 dollar_arg_stack entry. Have to clear dollar_vars and rest_of_args
4212 with the assumption that callers will call remember_args(args, 1)
4213 immediately following
4214 - pop_dollar_vars: free current positional parameters and restore old
4215 ones from pointers saved in dollar_arg_stack, making sure to
4216 invalidate any cached value for "$@"
4217 - dispose_saved_dollar_vars: free saved pointers from current index
4218 into dollar_arg_stack
4220 doc/{bush.1,bushref.texi}
4221 - POSIXLY_CORRECT: make sure to note that bush makes sure this variable
4222 is set when posix mode is enabled
4227 - set_jobs_list_frozen: set jobs_list_frozen to a particular value.
4228 Intended to save and restore the value around code sections instead
4229 of unconditionally unfreezing it.
4232 - set_jobs_list_frozen: extern declaration
4235 - execute_pipeline: if lastpipe is enabled, save and restore the
4236 value of jobs_list_frozen using freeze_jobs_list/set_jobs_list_frozen
4237 to avoid problems with race conditions and nested pipelines
4238 causing jobs to be removed from the jobs table. Fixes savannah issue
4239 https://savannah.gnu.org/support/index.php?109541 reported by
4240 Björn Kautler <vampire0>
4245 - lastpipe_cleanup: call set_jobs_list_frozen instead of
4247 - execute_pipeline: set up lastpipe_cleanup with old value of
4253 - getuintmax,getfloatmax: on a conversion error, return as much of the
4254 value as we were able to convert instead of 0. Fixes bug reported
4255 by Robert Elz <kre@bmunnari.OZ.AU>
4259 lib/readline/text.c,lib/readline/rlprivate.h
4260 - _rl_backward_char_internal: new function, guts of rl_backward_char
4261 and rl_backward_byte, not currently used there
4263 lib/readline/vi_mode.c
4264 - _rl_vi_advance_point: new function, move point forward by one
4265 character, handling multibyte locales and characters and the end
4267 - _rl_vi_backup_point: new function, move point backward by one
4268 character, handling multibyte locales and characters
4269 - rl_vi_eword,rl_vi_eWord: use rl_vi_advance_point instead of a simple
4270 increment to handle multibyte characters. Fixes bug reported by
4271 Enrico Maria De Angelis <enricomaria.dean6elis@gmail.com>
4275 lib/readline/vi_mode.c
4276 - rl_vi_fword,rl_vi_fWord: use rl_vi_advance_point instead of a simple
4277 increment to handle multibyte characters
4278 - rl_vi_bword,rl_vi_bWord: use rl_vi_backup_point instead of a simple
4279 decrement (and _rl_vi_advance_point where necessary) to handle
4280 multibyte characters
4281 - rl_vi_complete,_rl_vi_change_mbchar_case,_rl_vi_domove_motion_cleanup:
4282 use _rl_vi_advance_point instead of simple rl_point increment
4283 - vi_delete_dispatch,vi_change_dispatch,vi_yank_dispatch: use
4284 INCREMENT_POS instead of a simple increment to rl_mark to handle
4285 multibyte characters
4286 - rl_vi_column: use _rl_forward_char_internal, starting with
4287 rl_point == 0, to handle multibyte characters (Posix says `character
4288 position', not index)
4293 - changed release status to `beta'
4297 lib/readline/display.c
4298 - _rl_update_final: if the bottom line has zero characters and we are
4299 on that line at column 0, don't bother with an additional \r\n.
4300 Fixes redisplay nit reported by Per Bothner <per@bothner.com>
4304 - openbsd needs DEV_FD_STAT_BROKEN defined
4306 [bush-5.0-beta frozen]
4311 - exec_builtin: make sure to sync the buffered stream where bush is
4312 reading input (especially if it's fd 0) so a command exec'd by the
4313 script can read the rest of stdin after the exec
4317 lib/readline/histexpand.c
4318 - history_tokenize_internal: if the event contains embedded newlines
4319 (e.g., bush with command-oriented history and lithist), use them as
4320 word delimiters, equivalent to space and tab, so they don't end up
4321 as separate words. Fixes issue pointed out by Viktor Dukhovni
4322 <ietf-dane@dukhovni.org>
4323 - history_tokenize_word: don't break if we get a newline (though we
4324 shouldn't get one due to the loop in history_tokenize_internal
4325 - history_expand_internal: use newline as a whitespace character when
4326 expanding by words, as we do with history_tokenize_internal
4329 - J_PIPEFAIL: new flag for `flags' element of job struct
4332 - stop_pipeline: if pipefail_opt set, newjob gets J_PIPEFAIL in its
4334 - raw_job_exit_status: use J_PIPEFAIL (setting of pipefail when job
4335 created) instead of current setting of pipefail status to determine
4336 how to compute exit status of pipeline. Tentative implementation of
4340 - exp0: don't call expr_bind_variable with a NULL string. Fixes
4341 fuzzing bug reported by Eduardo Bustamante <dualbus@gmail.com>
4342 - expr_bind_variable: don't try to do anything with a NULL or empty
4348 - rl_do_undo: before we release the undo list entry we've just
4349 processed, make sure we avoid any pointer aliasing issues caused
4350 by having the entry being removed as part of the undo list in
4351 _rl_saved_line_for_history. Fixes fuzzing bug reported by
4352 Eduardo Bustamante <dualbus@gmail.com>
4356 [bush-5.0-beta released]
4361 - name_and_keymap: new struct for keymap names and maps
4362 - builtin_keymap_names: static array of builtin keymap names and
4363 maps; preparing for allowing applications to set the names of
4364 keymaps they create; keymap_names is initially a pointer to
4366 - _rl_get_keymap_by_name,_rl_get_keymap_by_map: new functions for
4367 searching the keymap_names array and returning an index
4368 - rl_get_keymap_by_name, rl_get_keymap_name: rewritten in terms of
4370 - rl_set_keymap_name (char *name, Keymap map): new function, set
4371 name of MAP to NAME. NAME must not be builtin; MAP must not be one
4372 of the builtin keymaps. Request and initial implementation from
4373 Tom Tromey <tom@tromey.com>
4375 lib/readline/readline.h
4376 - rl_set_keymap_name: new extern declaration for new public function
4378 lib/readline/doc/rltech.texi
4379 - rl_set_keymap_name: add documentation
4381 lib/readline/doc/rluser.texi
4382 - add text to `set keymap' description to note that applications
4383 can add keymap names that can be used there
4388 - shell_getc: don't execute the alias hack (returning a space at the
4389 end of the string) if we are parsing a command substitution that
4390 starts with a double paren (subshell inside a comsub), in which
4391 case the flags are PSH_DPAREN. Fixes fuzzing bug reported by
4392 Eduardo Bustamante <dualbus@gmail.com>
4394 lib/readline/isearch.c
4395 - _rl_isearch_dispatch: default case: make sure we check multibyte
4396 char length when deciding whether to enlarge the search string
4397 buffer, instead of using the old assumption. Fixes fuzzing bug
4398 reported by Eduardo Bustamante <dualbus@gmail.com>
4400 builtins/fc.def,execute_cmd.c
4401 - fixed some missing free()s uncovered by coverity. Report from
4402 Siteshwar Vashisht <svashisht@redhat.com>
4405 - glob_vector: make sure name_vector is initialized to NULL
4407 lib/sh/{pathcanon,pathphys}.c
4408 - {pathcanon,pathphys}: use memmove instead of strcpy on a possibly-
4409 overlapping region of memory
4412 - parameter_list_transform: make sure to dispose the word list in all
4413 cases before returning
4414 - parameter_brace_expand_rhs: make sure t1 is freed before returning
4415 due to an invalid name resulting from an indirect expansion
4418 - fixed a couple of memory leaks
4423 - process_substitute: if we are part of a job control process chain
4424 (pipeline_pgrp != shell_pgrp), have the child shell forked to run
4425 the process substitution set pipeline_pgrp to its own PID,
4426 effectively becoming a process group leader without changing
4427 its own process group. Fixes stray SIGHUP issue reported by
4428 Jeremy Townshend <jeremy.townshend@gmail.com>
4433 - assign_array_element: if we are assigning to an existing associative
4434 array, and assoc_expand_once is set, allow `*' and `@' as subscripts.
4435 Partial fix for report from Grisha Levit <grishalevit@gmail.com>
4438 - bind_int_variable: if valid_array_reference (lhs) is not true,
4439 make sure that the lhs is a valid identifier before assigning the
4443 - valid_array_reference: allow blank subscripts. They are treated as
4444 `normal' keys for associative arrays and evaluate to 0 for indexed
4445 arrays. More of fix for report from Grisha Levit
4446 <grishalevit@gmail.com>
4451 - restore_tilde: if the expanded length (xl) is longer than vl
4452 we end up requesting a negative amount of memory (an extremely
4453 large unsigned number). Just punt and return val in this case.
4454 Fuzzing bug reported by Eduardo Bustamante <dualbus@gmail.com>
4455 - restore_tilde: make sure we return what the user typed if tilde
4461 - uncomment `localvar_unset' option definition
4463 doc/{bush.1,bushref.texi}
4464 - document `localvar_unset' shell option
4467 - valid_array_reference: if we are parsing a subscript for an existing
4468 associative array, the `assoc_expand_once' option is set, and the
4469 VA_ONEWORD flag is set in FLAGS (meaning there should be nothing
4470 following the closing `]'), don't call skipsubscript to find the
4471 closing `]', use one that is at the end of the word. Part of fix for
4472 issue reported by Grisha Levit <grishalevit@gmail.com>
4474 builtins/{printf,set}.def
4475 - pass VA_ONEWORD as part of flags value everywhere valid_array_reference
4479 - CHECKWINSIZE_DEFAULT: now 1, so check_window_size is on by default
4480 - HISTEXPAND_DEFAULT: new define, allows builder to enable or disable
4481 history expansion by default at build time
4483 doc/{bush.1,bushref.texi}
4484 - checkwinsize: document new default value
4487 - HISTEXPAND_DEFAULT: don't define if it's already defined. Strict
4488 POSIX mode continues to default to off
4492 lib/readline/input.c
4493 - win32_isatty: win32-specific changes from GDB. Patch submitted by
4494 Tom Tromey <tom@tromey.com>, originally from Eli Zaretskii
4499 lib/readline/vi_mode.c
4500 - rl_vi_start_inserting: start an undo group so we can grab the text
4501 inserted here as a single unit, avoiding any insert coalescing
4502 performed by rl_insert_text. Report and fix from Richard Todd
4503 <richard.w.todd@outlook.com>
4508 - parameter_brace_transform: if we're asked to display the attributes
4509 of an unset variable, check that the variable exists even if
4510 get_var_and_type returns NULL (it checks invisible_p). Requested by
4511 Michal Pesa <pesathem@gmail.com>
4514 - _rl_bracketed_text: new function, collects the text pasted in
4515 bracketed paste mode and consumes the bracketed paste end marker;
4516 returns the pasted text and its length
4517 - rl_bracketed_paste_begin: call _rl_bracketed_text to collect the
4520 lib/readline/isearch.c
4521 - _rl_isearch_dispatch: set cxt->lastc to -7 if the input resolves to
4522 rl_bracketed_paste_begin
4523 - _rl_isearch_dispatch: if cxt->lastc == -7, call _rl_bracketed_text
4524 to collect the pasted text and add it to the accumulating search
4525 string. Only works if ESC is not one of the isearch terminators.
4526 Fixes issue reported in Debian bug report 891780,
4527 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891780
4532 - push_posix_tempvar_internal: new function, body of push_func_var
4533 with additional argument saying whether it's being called from a
4534 function or (special) builtin code path
4535 - push_builtin_var: new function, calls push_posix_tempvar_internal
4536 with second argument indicating builtin code path
4537 - push_func_var: now a stub that calls push_posix_tempvar_internal
4538 with second argument indicating function code path
4539 - pop_scope: if called from a special builtin, call push_builtin_var
4540 instead of push_func_var to do the right variable propagation
4543 - progcomp_alias: uncomment, make available to users
4545 doc/{bush.1,bushref.texi},lib/readline/doc/rluser.texi
4546 - progcomp_alias: document shopt option, describe its use in
4547 the section on programmable completion
4550 - decode_signal: handle SIGRTMIN+n at runtime, with the `SIG' prefix
4551 or without, case-insensitively if requested, and return SIGRTMIN+n.
4552 These values could be different than what was available at compile
4553 time. Report and patch from Rasmus Villemoes <rv@rasumsvillemoes.dk>
4558 - execute_command_internal: only set line_number from command->value.Subshell
4559 if the type == cm_subshell; otherwise defer and set later
4563 examples/loadables/seq.c
4564 - seq: new loadable builtin, derived originally from coreutils:seq.c
4565 but with very little of that code remaining
4570 - run_pending_traps,_run_trap_internal: honor evalnest_max and
4571 increment/decrement evalnest accordingly, since trap actions
4572 are processed as if run by `eval'. Feature suggsted by Mike
4573 Gerwitz <mtg@gnu.org>
4578 - expr_skipsubscript: new function, calls skipsubscript with flags
4579 similar to arrayfunc.c:valid_array_subscript if assoc_expand_once
4580 is set and it looks like we've already expanded the subscript of
4581 an associative array. Reported back on 8/27 by Grisha Levit
4582 <grishalevit@gmail.com>
4583 - readtok: call expr_skipsubscript instead of skipsubscript
4586 - valid_array_reference: call skipsubscript with a third arg computed
4587 from the VA_NOEXPAND flag only if we're expanding an associative
4588 array subscript -- we already figure out whether or not we are
4590 [bumped release status to beta2]
4594 builtins/setattr.def
4595 - set_or_show_attributes: after isolating NAME, make sure to restore
4596 the "[+]=" in case we need the word later. Issue pointed out by
4597 Grisha Levit <grishalevit@gmail.com>
4601 lib/readline/search.c
4602 - noninc_search_from_pos: if we are supposed to be searching for a
4603 pattern (vi mode), make sure to pass S to _hs_history_patsearch,
4604 since that has any leading `^' stripped
4606 lib/readline/histsearch.c
4607 - _hs_history_patsearch: if the search isn't anchored, put a `*' at
4608 the beginning to force fnmatch to match anywhere in the line (could
4609 look at this later to make a change to history_search_internal that
4610 would avoid the need to add the leading `*')
4613 - parameter_brace_expand_rhs: treat a failure to assign a variable with
4614 a ${param:=value} expansion as an expansion error, and, in a non-
4615 interactive posix-mode shell, exit the shell
4616 - param_expand: don't set W_SPLITSPACE for $* unless IFS is NULL;
4617 consistent with other uses of W_SPLITSPACE
4621 doc/{bush.1,bushref.texi}
4622 - tweak description of bush conditional expressions to note that the
4623 test and [ commands determine their behavior based on the number of
4624 arguments. Suggested by Ilkka Virta <itvirta@iki.fi>
4629 - execute_simple_command: don't set $_ to NULL when executing a
4630 command that forks; just leave it unchanged. Tweaked the documentation
4631 slightly as a result. Inspired by report from Ricky Tigg
4632 <ricky.tigg@gmail.com>
4637 - here_document_to_fd: make sure the temp files used to store here
4638 documents are readable (and writable, where necessary) by the user.
4639 This can happen in the unlikely case that someone decides to shoot
4640 himself in the foot by setting the umask to 400. Issue originally
4641 raised back in March by Stephane Chazelas
4642 <stephane.chazelas@gmail.com>; fix inspired by Martijn Dekker
4647 lib/readline/terminal.c
4648 - bind_termcap_arrow_keys: bind the "kI" capability (what the Insert
4649 keypad key outputs) to overwrite mode. Patch from Xose Vazquez Perez
4650 <xose.vazquez@gmail.com>
4655 - mkseq: make sure to terminate result array before passing it to
4656 strvec_dispose on an interrupt. Report and fix from Corbin Souffrant
4657 <corbin.souffrant@gmail.com>
4662 - _run_trap_internal: if the signal shows up as SIG_CHANGED after
4663 running the trap handler, check for terminating signals and run any
4664 terminating signal handler indicates. Fixes issue reported by
4665 Owen Stephens <owen@owenstephens.co.uk>
4670 - execute_builtin: don't merge the temporary environment when the
4671 `return' builtin is being executed if it's being executed by the
4672 `command' builtin, since that's supposed to inhibit the special
4673 builtin properties. Part of POSIX conformance problems reported
4674 by Martin Rehak <martin.rehak@oracle.com>
4677 - bindpwd: if canonicalization fails when -P is specified (e.g. if the
4678 directory name length exceeds PATH_MAX), reset dirname ($PWD value) =
4679 to the_current_working_directory (Posix cd description, step 10.)
4680 Part of POSIX conformance problems reported by Martin Rehak
4681 <martin.rehak@oracle.com>
4684 - kill_builtin: support -sSIG and -nSIG without requiring them to be
4685 separate arguments. POSIX says a "conforming implementation" should
4687 Part of POSIX conformance problems reported by Martin Rehak
4688 <martin.rehak@oracle.com>
4693 - array_value_internal: return NULL for invisible array variables.
4694 Fixes issue with FUNCNAME sometimes returning invalid value reported
4695 by Great Big Dot <greatbigdot@gmail.com>
4698 - change_to_directory: if we are in posix mode, and the chdir to the
4699 absolute pathname ($PWD/dirname) fails, return an error without
4700 trying to use just `dirname' (posix cd step 10).
4701 Part of POSIX conformance problems reported by Martin Rehak
4702 <martin.rehak@oracle.com>
4705 - execute_case_command: use expand_word_leave_quoted to expand the
4706 word, then dequote the resulting string. This performs the
4707 expansions in the order posix specifies.
4708 Part of POSIX conformance problems reported by Martin Rehak
4709 <martin.rehak@oracle.com>
4712 - expand_word_unsplit: rewrite in terms of expand_word_leave_quoted
4713 - ifs_whitespace: new macro, Posix ifs whitespace (ISSPACE; member
4714 of current locale's space char class)
4715 - ifs_whitesep: new macro, whitespace that is a member of $IFS; used
4716 by list_string and get_word_from_string
4717 - list_string: use ifs_whitesep instead of spctabnl in case $IFS
4718 contains whitespace characters that are not space, tab, or newline
4719 - get_word_from_string: use ifs_whitesep instead of spctabnl in case
4720 $IFS contains whitespace characters that are not space, tab, or
4722 Part of POSIX conformance problems reported by Martin Rehak
4723 <martin.rehak@oracle.com>
4728 - posix_initialize: enable the shift_verbose option when turning on
4729 posix mode, and disable it when posix mode is disabled. From a
4730 report by Eric Blake <eblake@redhat.com>
4733 - posix mode: note the effect of posix mode on shift_verbose
4738 - parameter_brace_expand: if parameter_brace_expand_word returns an
4739 error, make sure to set TEMP = 0 (to note that the variable is unset).
4740 From a report by Grisha Levit <grishalevit@gmail.com>
4741 - param_expand: if expanding $! when set -u is enabled, honor the
4742 PF_IGNUNBOUND flag and just return NULL, relying on the caller to
4743 take care of understanding that the variable is unset
4744 From a report by Grisha Levit <grishalevit@gmail.com>
4745 - parameter_brace_expand: if we are checking nullness, and we have a
4746 valid array expansion, a quoted null string resulting from the array
4747 expansion of a * or @ subscript satisfies the nullness check.
4748 From a report by Grisha Levit <grishalevit@gmail.com>
4753 - BUSH_CHECK_LIB_TERMCAP: add last-ditch check for libncursesw, since
4754 it's apparently the only curses library on some distributions.
4755 Report from John Frankish <john.frankish@outlook.com>
4760 - attempt_shell_completion: allow an initial word completion to
4761 complete a partial first word (point appears in the middle of
4762 the word) before resorting to command completion. Report and fix
4763 from Luca Boccassi <bluca@debian.org>
4765 [bush-5.0-beta2 frozen]
4770 - attempt_shell_completion: better fix for problems with fix from
4771 11/16. Report and fix from Tom Ryder <tom@sanctum.geek.nz>
4774 - expr_skipsubscript: fix return type. Report and fix from
4775 Andreas Schwab <schwab@linux-m68k.org>
4780 - quote_escapes_internal: refactored quote_escapes into a function
4781 that takes an additional flag saying whether or not we are going
4782 to split the result. If we are not, and CTLESC is in IFS, we quote
4783 the CTLESC (ditto for CTLNUL) to prevent it being removed when the
4785 - quote_escapes: call quote_escapes_internal with FLAGS == 0
4786 - quote_rhs: new function, calls quote_escapes with FLAGS == PF_NOSPLIT2
4787 so that a CTLESC will be quoted if CTLESC is in $IFS
4788 - parameter_brace_expand_word: call quote_rhs on the value of a variable
4789 if PFLAGS includes PF_ASSIGNRHS, indicating that we will not be
4790 splitting the word, but we will be dequoting it. Fixes bug reported
4791 by Martijn Dekker <martijn@inlv.org>
4792 - param_expand: same change as for parameter_brace_expand_word
4795 - execute_in_subshell: if we are running a trap (running_trap > 0),
4796 turn off the SIG_INPROGRESS and SIG_CHANGED flags for that signal
4797 by calling run_trap_cleanup and reset running_trap to 0 (watch the
4798 second part!). Tagged for bush-5.1.
4802 lib/readline/doc/rltech.texi
4803 - rl_set_keymap_name: correct typo in the name; some updates to the
4804 description that clarify usage. Report from <hirooih@gmail.com>
4809 - BUSH_FUNC_FNMATCH_EQUIV_FALLBACK: a test of whether fnmatch(3)
4810 understands bracket equivalence classes ([=c=]) for characters
4811 that collate with equal weights but are not identical
4813 configure.ac,config.h.in
4814 - call BUSH_FUNC_FNMATCH_EQUIV_FALLBACK and define
4815 FNMATCH_EQUIV_FALLBACK to 1 if it can be used for equivalence
4821 - eval_arith_for_expr,execute_arith_command,execute_cond_command: make
4822 sure running_trap == 0 before we reset the_printed_command_except_trap
4823 Report from Peng Yu <pengyu.ut@gmail.com>
4826 - _fnmatch_fallback_wc: new function, takes two wide characters c1 and
4827 c2, converts them to a pattern ([[=c2=]]) and a string (c1) for
4828 fnmatch to determine whether or not they are members of the same
4830 - collequiv_wc: call _fnmatch_fallback_wc if rangecmp_wc returns
4831 non-zero if FNMATCH_EQUIV_FALLBACK is defined, so we know that
4832 fnmatch understands equivalence classes. Another Posix test suite
4833 issue from Martin Rehak <martin.rehak@oracle.com>
4838 - add missing cases to switch statements to shut up gcc
4843 - find_minus_o_option: new helper function, returns index into
4844 o_options given option name
4845 - minus_o_option_value,set_minus_o_option: use find_minus_o_option
4848 - new table of variables (currently all shopt options) that are
4849 modified by going into and out of posix mode; num_posix_options()
4850 returns the number of variables
4851 - get_posix_options: fill in a bitmap passed as an argument (or return
4852 a new one) of values of posix-mode-modified variables in the table
4853 - set_posix_options: set values of posix-mode-modified variables from
4854 the table using the passed bitmap for values
4857 - get_current_options: make the bitmap large enough to hold the options
4858 in the set table and the table of posix-mode-modified variables; call
4859 get_posix_options to fill in those values after the values from the
4861 - set_current_options: call set_posix_options to reset the values of
4862 the posix-mode-modified variables at the end of the bitmap, after
4863 the o_options values. Fixes issue reported by PJ Eby
4864 <pje@telecommunity.com>
4869 - select_command: add two additional productions to support select
4870 commands without a word_list following the `in'. Fixes omission
4871 reported by Martijn Dekker <martijn@inlv.org>
4876 - assign_in_env: don't allow namerefs in temporary environment
4877 assignments to create variables with invalid names for export. Fixes
4878 bug reported by Grisha Levit <grishalevit@gmail.com>
4883 - don't change last_command_exit_value in the 'error yacc_EOF' production
4884 if the parser sets it to something non-zero; just make sure it
4885 indicates an error. Fixes problem with unexpected EOF in eval
4886 reported by Martijn Dekker <martijn@inlv.org>
4894 - fnmatch: add extern declaration if FNMATCH_EQUIV_FALLBACK is being
4898 - hash_string: add FNV offset as initial value for hash instead of
4899 starting at 0, changes hash for associative arrays and requires a
4900 bunch of changes to the "right" test suite files
4903 - rseed: make it explicitly 32 bits; that's all we're interested in
4910 - brand: add some comments, make the constants explicitly 32 bits;
4911 use signed 32-bit values for the intermediate calculations. The
4912 algorithm is still minstd
4914 [bush-5.0-rc1 frozen]
4919 - }1: remove macro definition; it's outlived its bugfix purpose.
4920 Report from Derek Schrock <dereks@lifeofadishwasher.com>
4925 - expand_arith_string: set W_NOTILDE in the flags so we don't perform
4926 tilde expansion at all, even for the previously-special-case array
4927 subscript expansion. Report from Bize Ma <binaryzebra@gmail.com>
4928 - expand_word_internal: take out Q_ARRAYSUB check for tilde expansion
4932 builtins/evalstring.c
4933 - parse_and_execute: if the eval builtin gets a parser error while
4934 parsing a string in posix mode, don't exit the shell if the eval
4935 was run by the command builtin. report from Martijn Dekker
4938 examples/loadables/{basename,dirname}.c
4939 - dirname_builtin: skip over any `--' ending the options. Report from
4940 Peng Yu <pengyu.ut@gmail.com>
4944 examples/loadables/mkdir.c
4945 - make_path: add argument noting whether or not the user specified -m;
4946 only attempt the chmod on an existing directory if the user did so
4947 - make_path: when creating intermediate directories, perform the
4948 mkdir (path, 0) and chmod separately as the posix text recommends
4953 - PST_COMMENT: new state, set when the shell is reading characters
4954 until newline as part of comment processing
4957 - shell_getc: don't return a space at the end of a token if the parser
4958 is consuming a comment. Fixes bug reported by Harald van Dijk
4959 <harald@gigawatt.nl>
4963 lib/glob/glob_loop.c
4964 - INTERNAL_GLOB_PATTERN_P: revert change from 4/27 that makes this
4965 function return non-zero for a backslash in the string. Based on a
4966 report from Tom Ryder <tom@sanctum.geek.nz>
4975 examples/loadables/basename.c
4976 - make sure to include bushgetopt.h. Reported by Angel
4980 - stdlib.h: include if botch isn't defined to provide a declaration
4983 hashlib.c,Makefile.in
4984 - fixes to make hash library testing work for others from
4985 Eduardo Bustamante <dualbus@gmail.com>
4987 lib/readline/unicode.c
4988 - u32toutf16: correct the second argument to be wchar_t *, and treat
4989 it as such, even though it doesn't make a difference in practice.
4990 Report and fix from Eduardo Bustamante <dualbus@gmail.com>
4996 - return_builtin: return EX_USAGE if we're not executing a shell
4997 function or sourcing a script, so a posix-mode shell exits. Fixes
4998 bug reported by Robert Hailey <bush@osndok.com>
5000 builtins/declare.def
5001 - declare_internal: don't let `declare -f +f' turn off the function
5002 attribute. Fix from Grisha Levit <grishalevit@gmail.com>
5003 - declare_internal: reject attempts to add the -A or -a attributes
5004 to functions. Report from Grisha Levit <grishalevit@gmail.com>
5009 - completion_glob_pattern: new function, returns true if the passed
5010 string contains a glob pattern that should be process by the glob
5011 completion code. Completion glob patterns don't pay attention to
5012 backslashes unless they're the last character in the string. This
5013 is a different, more self-contained, fix for the problem reported
5014 by Tom Ryder <tom@sanctum.geek.nz>
5016 lib/glob/glob_loop.c
5017 - INTERNAL_GLOB_PATTERN_P: restore change from 4/27 and make this
5018 function return non-zero if it encounters a backslash in the string.
5019 It needs to match pathexp.c:unquoted_glob_pattern_p(). Adds fix
5020 back for issue reported by axel@freakout.de
5023 - arithcomp: when calling evalexp, make sure to call it with the
5024 EXP_EXPANDED flag, since all arguments here have been evaluated
5028 - array_expand_index: call evalexp with EXP_EXPANDED flag, since we
5029 have run the string through expand_arith_string already
5034 - PST_ENDALIAS: new state, means we just consumed the last character
5035 of an alias expansion and returned the fake space
5038 - shell_getc: add PST_ENDALIAS to parser_state before returning the
5039 fake space that marks the end of the alias, making sure to do it
5040 only once. With that set, fall through to the pop_string(), making
5041 sure to unset PST_ENDALIAS. Fixes alias bug reported by
5042 Ante Peric <synthmeat@gmail.com>
5047 - {extglob,wextglob}_skipname: make sure we check the rest of the
5048 pattern if the extglob pattern is null, and therefore won't match
5049 anything. If that is followed by a `.', quoted or unquoted, we can
5050 match a leading `.' in the pathname. This code is currently not
5054 - hash_builtin: if -d is supplied without an argument, print an error
5055 message and return failure, just like -t without an argument. Fixes
5056 inconsistency reported by Dan Jacobson <jidanni@jidanni.org>
5061 - shell_getc: use shellblank when testing the last character of an
5062 alias to determine whether or not to add a trailing space instead
5063 of testing against a space only. These are the non-shell-metacharacters
5064 that can delimit words. Used together with PST_ENDALIAS
5069 - shell_getc: keep track of whether the last character read from
5070 shell_input_line is an unquoted backslash and don't add a space to
5071 the end of an alias if the alias value ends in an unquoted backslash.
5072 From an austin-group mailing list discussion message from
5073 Harald van Dijk <ag@gigawatt.nl>
5078 - check_identifier: make sure CHECK_WORD is non-zero before we check
5079 whether or not the word consists of all digits. This allows function
5080 names to consist solely of digits when not in posix mode. From a
5081 report by Andrey Butirsky <butirsky@gmail.com>
5086 - initialize_readline: only unbind ^E in vi_movement_keymap if it's
5087 still bound to the default rl_emacs_editing_mode. Fixes bug
5088 reported by Greg Bell <gbell_spamless@yahoo.com>
5093 - we need the extern declaration for syslog_history if SYSLOG_HISTORY
5094 is defined, since it's used even if SYSLOG_SHOPT is not defined.
5095 From a Gentoo Linux bug report, eventually reported to bug-bush by
5096 Tomas Mozes <hydrapolic@gmail.com>
5101 - CMD_TRY_OPTIMIZING: new command flag, means this (simple) command is
5102 a candidate for fork optimization (suppression)
5104 builtins/evalstring.c
5105 - can_optimize_connection: new function, takes an AND_OR list (&& or
5106 ||) from parse_and_execute, makes sure it's the last in a possibly
5107 multi-command list, and returns non-zero if it's a simple command,
5108 indicating that it's a candidate for fork optimization.
5109 - parse_and_execute: if we have a cm_connection command, call
5110 can_optimize_connection to determine if it's a suitable candidate
5111 and set CMD_TRY_OPTIMIZING if that returns non-zero
5112 - optimize_fork: don't bother unless the rhs of the && or || command
5113 has the CMD_TRY_OPTIMIZING flag set. These fix the bug reported by
5114 Brad Spencer <bspencer@blackberry.com>
5117 - execute_connection: case AND_AND and OR_OR: call optimize_fork on
5118 the right side of the command before executing `second'. This will
5119 safely restore the fork optimization we removed from
5122 builtins/complete.def
5123 - build_actions: make sure the function name argument to -F is a
5124 valid shell function name: it doesn't contain any invalid posix-
5125 mode characters and doesn't contain any shell break characters that
5126 would need to be quoted when defining a function. Fixes issue
5127 reported by Great Big Dot <greatbigdot@gmail.com>
5132 - dispose_temporary_env: make sure to save temporary_env to a temp
5133 pointer and set temporary_env to NULL before trying to dispose it,
5134 so no flush function ever tries to add a temporary variable back
5135 into the table (e.g., bind_variable())
5139 builtins/evalstring.c
5140 - can_optimize_connection,optimize_fork: add the last command in lists
5141 separated by `;' to the list of candidates for fork optimization
5145 examples/loadables/strftime.c
5146 - strftime_builtin: try to extend the buffer longer than tbsize*3,
5147 which is a minimum of 24 characters, in case some of the formats
5148 (e.g., %c) expand to something longer than that. Fixes bug
5149 reported by Stan Marsh <gazelle@xmission.com>
5154 - rl_do_undo: before inserting text while undoing UNDO_DELETE, or
5155 performing a deletion while undoing UNDO_INSERT, make sure that
5156 rl_point is valid by calling _rl_fix_point. Fuzzing bug and fix
5157 from Eduardo Bustamante <dualbus@gmail.com>
5159 lib/readline/search.c
5160 - _rl_nsearch_abort: validate new values for rl_point and rl_mark by
5161 calling _rl_fix_point(). Fuzzing bug and fix from
5162 Eduardo Bustamante <dualbus@gmail.com>
5165 - string_extract_double_quoted: if we parse a syntactically-incorrect
5166 $( expression while extracting a double-quoted string, si will
5167 appear to go `backward'. Just skip over the rest of the string and
5168 continue. Fuzzing bug from Eduardo Bustamante <dualbus@gmail.com>
5171 - rl_change_case: if towupper or towlower returns a valid wide char
5172 that can't be converted back to a valid multibyte character, use
5173 the original character and go on. Fuzzing bug from
5174 Eduardo Bustamante <dualbus@gmail.com>
5177 - wdequote_pathname: if there are no multibyte characters in pathname,
5178 just call udequote_pathname and don't bother converting it to wide
5180 - glob_pattern_p: if there are no multibyte characters in the pattern,
5181 just call internal_glob_pattern_p right away
5183 lib/glob/glob_loop.c
5184 - INTERNAL_GLOB_PATTERN_P: return 2 if we see only backslash-quoted
5185 characters without any other unquoted glob pattern characters, so
5186 interested callers can shortcut and just dequote the pathname
5189 - unquoted_glob_pattern_p: return 2 if we see only backslash-quoted
5190 characters without any other unquoted glob pattern characters,
5191 consistent with the glob library
5192 - unquoted_glob_pattern_p: don't count a backslash quoting a slash as
5193 a backslash that will trigger a call to shell_glob_filename, since
5194 backslashes at the end of patterns (pathname components) will always
5195 fail to match. XXX - this is provisional
5198 - glob_filename: if we have a directory name that has no unquoted
5199 special glob chars, but has backslashes, just dequote it and return
5200 it without going through the rest of the glob expansions. Partial
5201 fix for issue with unreadable directories reported by
5202 Andrew Church <achurch+bush@achurch.org>
5206 lib/readline/readline.c
5207 - readline_internal_teardown: if revert-all-at-newline is set, make
5208 sure that the history position is at the end of the history before
5209 calling _rl_revert_all_lines(). Fixes bug reported by
5210 johnlinp@gmail.com and frederik@ofb.net
5214 builtins/complete.def
5215 - complete_builtin: fix check for argument to -F to use strpbrk
5216 instead of incomplete use of strcspn. Fix from Grisha Levit
5217 <grishalevit@gmail.com>
5221 lib/readline/readline.c
5222 - rl_parse_and_bind: change parsing of boolean variable values to
5223 look for and consume an optional whitespace-delimited word. This
5224 allows trailing spaces and everything that follows to work. Idea
5225 from Bize Ma <binaryzebra@gmail.com>
5226 - rl_parse_and_bind: print error message about unknown variable names
5227 instead of calling rl_variable_bind to do it
5228 - rl_variable_bind: report error if setting string variable returns
5233 lib/readline/histfile.c
5234 - read_history_range: close FILE before returning if the history file
5240 - edit_and_execute_command: add the current line buffer to the history
5241 list even if it's empty and rely on other code in bush_add_history
5242 to take care to not add multiple semicolons with multiple blank
5243 lines and command_oriented_history. Live with the blank lines as
5244 history entries for now. Fixes problem reported by
5245 Johannes Hielscher <jhielscher@posteo.de>
5248 - _rl_revert_all_lines: renamed to _rl_revert_previous_lines, since
5249 that is basically what it does
5250 - _rl_revert_all_lines: now just makes sure the history offset is at
5251 the end of the history and calls _rl_revert_previous_lines. Inspired
5252 by a suggestion from johnlinp@gmail.com
5254 lib/readline/readline.c
5255 - readline_internal_teardown: revert change of 2/2, moved that code
5256 into the (new) _rl_revert_all_lines
5258 lib/readline/rlprivate.h
5259 - _rl_revert_previous_lines: new extern declaration
5262 - bind_builtin: make sure the unwind-protect gets run when the --help
5263 option is used, so use `case GETOPT_HELP:' instead of `CASE_HELPOPT;'.
5264 Report and fix from Koichi Murase <myoga.murase@gmail.com>
5269 - _rl_abort_internal: don't just turn off the MACRODEF state, call
5270 _rl_kill_kbd_macro to delete any traces of an in-progress macro
5271 definition before turning it off. Fixes fuzzing bug.
5275 examples/loadables/Makefile.in
5276 - CCFLAGS: add $(CPPFLAGS) to value, based on a report from
5277 Christian Weisgerber <naddy@mips.inka.de>
5282 - posix_readline_initialize: keep track of the vi insertion keymap
5283 binding for TAB, since we change it in this function. Save the
5284 old binding before we change it when turning posix mode on, and
5285 restore that old binding when turning posix mode off, as long as
5286 the current binding is still rl_insert. Suggested by a report from
5287 Koichi Murase <myoga.murase@gmail.com>
5292 - exec_builtin: save value of job_control; use it to restore the value
5293 of job_control if an exec fails in an interactive shell instead of
5294 enabling it by default in an interactive shell. Report from
5295 Grisha Levit <grishalevit@gmail.com>
5298 - _rl_function_of_keyseq_internal: make sure to use checks against LEN
5299 instead of a NULL character in KEYSEQ to determine the length of the
5301 Report and fix from Koichi Murase <myoga.murase@gmail.com>
5302 - rl_bind_key: make sure the KEY argument is not larger than the
5303 largest unsigned character.
5304 Report and fix from Koichi Murase <myoga.murase@gmail.com>
5305 - rl_translate_keyseq: make sure that M-x correctly adds "\ex" to the
5306 key sequence array when convert-meta is set.
5307 Report and fix from Koichi Murase <myoga.murase@gmail.com>
5308 - rl_translate_keyseq: now unconditionally converts meta characters to
5309 ESC-prefixed key sequences when processing \0nnn \Xnnn and \[char]
5310 escape sequences that resolve to meta characters and for `normal'
5311 characters that have the meta bit set
5312 Report and fix from Koichi Murase <myoga.murase@gmail.com>
5315 - end_job_control: if the terminal pgrp (terminal_pgrp) is not the same
5316 as the original pgrp (original_pgrp), set the terminal's pgrp to the
5317 original pgrp so when we reset the shell's pgrp to original_pgrp,
5318 we'll continue to be able to read from the terminal if the shell is
5319 interactive. Fixes bug with turning off job control before starting
5320 an interactive shell reported by Grisha Levit
5321 <grishalevit@gmail.com>
5327 - end_job_control: if the setpgid(0, ...) succeeds, reset the value of
5328 shell_pgrp. Fixes pgrp mismatch after failed exec in an interactive
5329 login shell reported by Grisha Levit <grishalevit@gmail.com>
5334 - pre_process_line: save history_length before calling history_expand,
5335 and after possibly decrementing history_length, just restore the old
5336 value instead of incrementing it. Fixes bug reported by
5337 Michael Albinus <michael.albinus@gmx.de>
5338 - bush_add_history: don't bother calling really_add_history if the
5339 history is stifled and the max number of entries is 0
5341 aclocal.m4,configure.ac,m4/*.m4
5342 - replace the old set of gettext m4 macros with the latest m4 files
5343 from the gnulib and gettext distributions
5348 - bindpwd: initialize canon_failed to 0 to prevent `cd -e' from always
5352 - W_EXPANDRHS: new flag, set when expanding WORD in ${paramOPword}
5355 - expand_string_for_rhs: set W_EXPANDRHS in word to be expanded
5358 - expand_word_internal: when encountering a single or double quoted
5359 string that expands to nothing, add a CTLNUL if the W_EXPANDRHS
5360 flag is set and the word isn't quoted, indicating that the word
5361 will eventually be split and we need to preserve the null to
5362 produce an empty word. From a discussion on bug-bush started by
5363 sunnycemetery@gmail.com
5368 - completion_glob_pattern: make sure to skip over a character quoted
5369 by a backslash. Fixes bug reported by John Van Sickle
5370 <john.vansickle@gmail.com>
5374 lib/readline/complete.c
5375 - last_completion_failed: keep track of whether the last completion
5376 attempt generated any matches
5377 - rl_complete: if the last readline command was completion, but the
5378 completion attempt didn't generate any matches, don't regenerate
5379 and display the match list. Treat it as a new completion attempt.
5380 Suggested by Richard Stallman <rms@gnu.org>
5383 - maybe_append_history: try to handle the case where the number of
5384 history entries in the current shell session is greater than the
5385 number of entries in the history list. Based on a report from
5391 - BUSH_FUNC_FNMATCH_EQUIV_FALLBACK: use en_US.UTF-8 instead of
5392 de_DE.UTF-8; it's more likely to be installed
5396 doc/{bush.1,bushref.texi}
5397 - extdebug: make sure to note that setting this option in a startup
5398 file causes an attempt to start the debugger. Noted by Linda
5399 Walsh <bush@tlinx.org>
5402 - fc_builtin: if we are not listing, and delete the last history entry,
5403 make sure that histbeg or histend, whichever is greater, is clamped
5404 at the value of last_hist to avoid dereferencing the just-removed
5405 history index. Fixes bug reported by Chris King-Parra
5406 <chris@kingparra.work>
5411 - init_interactive: assignment to histexp_flag should be protected by
5412 #ifdef BANG_HISTORY. https://savannah.gnu.org/patch/?9759
5415 - list_string: if we have a non-null string, but quoted null character
5416 removal leaves an empty string, set W_SAWQUOTEDNULL in the returned
5417 word flags so the caller can deal with it
5418 - parameter_brace_expand_rhs: deal with word with null or empty word
5419 and W_SAWQUOTEDNULL in the flags coming back from expand_string_for_rhs
5420 by turning it into a quoted null word and modifying the flags. Part
5421 of fix for bug report from Grisha Levit <grishalevit@gmail.com>
5422 - expand_word_internal: if a double-quoted string comes back with a
5423 quoted null as the expansion of "$@", note that we saw it, but still
5424 add a quoted null into the result string instead of short-circuiting.
5425 Part of fix for bug report from Grisha Levit <grishalevit@gmail.com>
5429 examples/loadables/fdflags.c
5430 - O_CLOEXEC: instead of not using it, synthesize a definition for it
5431 from unused bits in the file status word. It's only used as a
5432 placeholder anyway. Fix from code by Robert Elz <kre@bmunnari.oz.au>
5435 - execute_connection: call optimize_fork on the rhs of a `;' connection
5436 to attempt to optimize the last simple command in a list
5441 - parameter_brace_expand: add `@' to the list of operators that cause
5442 unbound parameter errors. Fixes oversight bug reported by
5443 Martin Schulte <gnu@schrader-schulte.de>
5448 - expand_word_internal: update to fix from 2/21 and 2/27 to accommodate
5449 contexts when word splitting will not take place (W_ASSIGNRHS). Fix
5450 from Grisha Levit <grishalevit@gmail.com>
5451 - param_expand: if IFS is unset, and we are expanding $* in a context
5452 where we're not going to be performing word splitting, just treat it
5453 as if IFS=" " and don't set W_SPLITSPACE. Report and hint at fix
5454 from Grisha Levit <grishalevit@gmail.com>
5455 - param_expand: if IFS is not null, and we are expanding $* in a
5456 context where we're not going to be performing word splitting, and
5457 we quote a null string (resulting in a quoted null), make sure we
5458 set W_SAWQUOTEDNULL to note this for the caller
5459 - parameter_brace_expand_rhs: make sure to remove any W_SAWQUOTEDNULL
5460 flag for a the word on the rhs of the `=' operator if the original
5461 string is null or the original string is not null and the returned
5462 string (after dequoting) is not null. For instance ${v= ''} should
5463 not have the SAWQUOTEDNULL flag set because it is " " after
5464 expansion and dequoting, even though we saw a quoted null there
5469 - sh_eaccess: AIX needs the same kind of additional checks as FreeBSD
5470 and Solaris when running as root and checking whether or not a file
5471 is executable. Report and fix from REIX, Tony <tony.reix@atos.net>
5476 - GX_RECURSE: new flag, indicates internal call to glob_filename
5479 - glob_filename: add GX_RECURSE to recursive call to glob_filename
5480 - glob_filename: dequote a directory name (in the absence of a
5481 filename) only if this is not a recursive call to glob_filename
5482 ((flags & GX_RECURSE) == 0). Fixes bug reported by Dr. Werner Fink
5488 - handle_eof_input_unit: before calling exit_builtin, set
5489 last_shell_builtin and this_shell_builtin appropriately, since the
5490 exit builtin uses them to determine whether or not to exit
5491 immediately. Fixes bug reported by Tom Levy <tomlevy93@gmail.com>
5494 - sh_double_quote,sh_mkdoublequoted,sh_backslash_quote_for_double_quotes:
5495 make sure to handle multibyte characters that may contain characters
5496 that need to be quoted in double quotes; adding a spurious double
5497 quote may turn them into different characters or uncover characters
5498 that are special in double quotes. Fixes bug reported by
5499 Stephane Chazelas <stephane.chazelas@gmail.com>
5500 - sh_backslash_quote: don't call COPY_CHAR_P if we're in a UTF-8
5501 locale and the current character doesn't have its eighth bit set;
5502 only check mb_cur_max and is_basic if we're not in a UTF-8 character
5508 - read_comsub: if it looks like we're starting a multibyte character,
5509 read a whole multibyte character from buf and add it all at once,
5510 so we don't quote each byte in a multibyte character sequence. Fixes
5511 bug uncovered by shquote changes from 3/8
5516 - expand_word_internal: if we are in a context where word splitting
5517 will not occur, but one where we need to make sure we eventually
5518 expand "$@" to multiple words, add a space as quoted so we can still
5519 split on the space separator in $@. Fixes bug reported by
5520 Grisha Levit <grishalevit@gmail.com>
5525 - parameter_brace_substring, parameter_brace_patsub: treat the case
5526 where pflags includes PF_ASSIGNRHS the same as if IFS is null, since
5527 word splitting will not take place
5529 {subst,array,assoc}.c,subst.h
5530 - string_list_pos_params: add a fourth argument: pflags; change all
5531 callers to initially pass 0 as fourth arg
5536 - expand_word_internal: split words with W_ASSIGNRHS flag set specially.
5537 These and subsequent changes fix expansion bugs reported by
5538 Grisha Levit <grishalevit@gmail.com>
5541 - string_list_pos_params: if we are expanding `@', make sure we honor
5542 PFLAGS including PF_ASSIGNRHS and use string_list_dollar_at to make
5543 sure the positional parameters are separated by spaces
5544 - string_list_pos_params: if we are expanding `*', make sure we honor
5545 PFLAGS including PF_ASSIGNRHS and separate the positional parameters
5546 with the first character of $IFS
5547 - pos_params_pat_subst,pos_params_modcase: calculate appropriate value
5548 for PFLAGS depending on match flags value, and pass right value to
5549 string_list_pos_params (affects @, * expansion)
5550 - pos_params: now takes PFLAGS as argument to pass to string_list_pos_params;
5554 - array_pat_subst,array_modcase: calculate appropriate value for
5555 PFLAGS depending on match flags value, and pass right value to
5556 string_list_pos_params (affects @, * subscript expansion)
5559 - array_subrange: now takes additional PFLAGS argument to pass to
5560 string_list_pos_params
5563 - assoc_pat_subst,assoc_modcase: calculate appropriate value for
5564 PFLAGS depending on match flags value, and pass right value to
5565 string_list_pos_params (affects @, * subscript expansion)
5566 STILL NEED TO DO SUBRANGE
5569 - parameter_brace_substring: add PFLAGS argument to array_subrange
5572 - array_keys: use string_list_pos_params instead of calling
5573 string_list_dollar_{star,at} directly.
5576 - array_keys: now takes a PFLAGS argument, passes to string_list_pos_params
5579 - parameter_brace_expand: add PFLAGS argument to call to array_keys
5582 - parameter_brace_expand_indir: now takes a PFLAGS argument and uses it
5583 in the call to parameter_brace_expand_word
5584 - parameter_brace_expand: add PFLAGS argument to call to
5585 parameter_brace_expand_indir
5590 - chk_atstar: now takes a PFLAGS parameter, changed callers. Will
5591 eventually affect whether or not we saw $@
5592 - chk_atstar: if we see "$*" don't note that we saw $@ unless
5593 expand_no_split_dollar_star is unset. This is what param_expand
5599 - rl_get_previous_history: if we are trying to go back from the
5600 beginning of the history, or if we are trying to go back before the
5601 beginning of the history, call _rl_free_saved_history_line to just
5602 get rid of the history line we saved instead of using
5603 rl_maybe_unsave_line, which modifies the current line buffer.
5604 Fixes bug reported by lessbug <lessbug@qq.com>
5609 - execute_command_internal: save and restore line_number around
5610 user_subshell setting it to the line number saved in the command.
5611 Fixes bug reported in https://bugzilla.novell.com/show_bug.cgi?id=1128936
5616 - ansicstr: handle multibyte characters that are not preceded by a
5617 backslash so we skip over potential escapes in characters whose
5618 multibyte representation contains a backslash. Fixes issue reported by
5619 Stephane Chazelas <stephane.chazelas@gmail.com>
5622 - reap_some_procsubs: reap_procsubs, but parameterized to take the
5623 max index to check -- general function for future use
5624 - reap_procsubs: now just calls reap_some_procsubs with the right arg
5627 - execute_command_internal: if we are using /dev/fd for process
5628 substitution, reap the procsubs at the end of this function (FIFOs
5629 do it at the beginning -- look at this more closely). Only do it
5630 for loops to avoid fd exhaustion. Fixes bug reported by
5631 sunnycemetery@gmail.com
5635 lib/readline/{rlprivate.h,signals.c}
5636 - _rl_interrupt_immediately: removed as no longer used
5639 - heredoc_expand: new function, called for both here-documents and
5640 here-strings, takes care of expanding the document and returns a
5642 - write_here_document: use heredoc_expand, call write(2) once on the
5643 entire document; structure is now very similar to write_here_string
5648 - here_document_to_fd: expand the here document/here string first,
5649 using heredoc_expand, then decide what to do; remove calls to
5650 write_here_document/write_here_string in favor of calling
5651 heredoc_write directly
5652 - here_document_to_fd: if the expanded document is of zero length,
5653 just open /dev/null right away and return it -- idea from yash
5654 - here_document_to_fd: if the length of the expanded document is
5655 between 1 and PIPESIZE (pipe capacity, computed by builtins/psize.aux
5656 and stored in builtins/pipesize.h), try to use a pipe: write
5657 the document to the write end and return the read end. Prompted by a
5658 report from Daniel Kahn Gillmor <dkg@fifthhorseman.net>
5661 - dyn_load_builtin: add warning if dynamic builtin with a load function
5662 is loaded more than once, before running the load function a second
5663 time. From a suggestion by Stan Marsh <gazelle@xmission.com>
5668 - wait_for_any_job: takes a new argument, a struct procstat * that
5669 gets the PID of the exited job's process leader (the one that
5670 contributes the status) and the same status we return from the
5674 - wait_builtin: pass a struct procstat * to wait_for_any_job to get
5675 the pid of the job's process leader (and the same status the
5676 function returns). We don't do anything with it yet
5681 - seedrand: add a couple more variables to the random seed
5684 - sh_mktmpdir: new function, makes a temporary directory using
5685 mkdtemp if it's available, and generates a filename using
5686 sh_mktmpname (which uses mktemp, if available) and makes a
5687 directory with it if not
5690 - set up to use mkdtemp if available
5693 - sh_mktmpdir: extern declaration
5694 - MT_TEMPFILE: new flag for the tempfile functions; means to use the
5695 value in the NAMEROOT argument as a template for the mktemp/mkstemp/
5696 mkdtemp functions. Not used in mainline shell code
5698 examples/loadables/mktemp.c
5699 - mktemp: new loadable builtin, with BSD options and basic semantics
5703 builtins/common.c,builtins/printf.def
5704 - builtin_bind_variable: moved bind_printf_variable to common.c from
5705 printf.def, renamed to builtin_bind_variable, made global for other
5709 - bind_read_variable: now uses builtin_bind_variable
5713 lib/readline/histfile.c
5714 - history_rename: wrapper function for rename(2) to deal with the Win32
5715 refusal to rename over an existing file; changed callers. Bug and fix
5716 from <john.david.donoghue@gmail.com>
5721 - display_traps,showtrap: take an additional int argument, that, if
5722 non-zero, means to print a trap command for a signal whose disposition
5724 - trap_builtin: if the -p option is given, and posix mode is enabled,
5725 pass the `show every signal' flag to display_traps so SIG_DFL signals
5726 are displayed as `trap -- - <signal>'. From an austin-group
5727 interpretation (1212) initiated by Robert Elz <kre@bmunnari.oz.au>.
5733 - list_one_job: printing one job counts as notifying the user about
5734 it, so add a call to cleanup_dead_jobs like in the other job display
5735 functions. Fixes https://savannah.gnu.org/support/?109667 reported
5741 - HEREDOC_PIPESIZE: define to PIPESIZE if not defined, allow it to be
5742 specified at build time; used in here_document_to_fd to determine
5743 whether or not a pipe is used
5744 - HEREDOC_PIPEMAX: allow build-time definition of the max heredoc size
5745 that will be written to a pipe
5746 - here_document_to_fd: if F_GETPIPE_SZ is defined (Linux), ensure that
5747 the document is shorter than the possibly-dynamic max pipe size,
5748 and fall back to the tempfile implementation if it is not
5749 - HEREDOC_PARANOID: if this is defined to a non-zero value,
5750 here_document_to_fd ensures that both file descriptors opened on
5751 the temporary file refer to the same file
5754 - zmapfd: increased the default allocation sizes
5757 - zcatfd: increased the default allocation sizes
5760 - localbuf: increased the default buffer size for reads
5765 - cond_expand_word: like expand_word_unsplit, we need to peform
5766 quoted null character removal on both the LHS and RHS of the
5767 operator, since we are not performing word splitting. Fixes bug
5768 reported by Matt Whitlock in https://savannah.gnu.org/support/?109671
5773 - wait_for_background_pids: don't bother with the loop that waits for
5774 and reaps all children of the shell in the case that it's inherited
5775 some children it doesn't care about. Report from Daniel Kahn Gillmor
5776 <dkg@fifthhorseman.net>
5781 - command_substitute: add an unwind-protect to make sure the read end
5782 of the pipe gets closed in the parent on a SIGINT that interrupts
5783 the zread. Fixes fast SIGINT fd leak reported by Tycho Kirchner
5784 <tychokirchner@mail.de>
5787 - history_number: if enable_history_list is set (`set -o history' has
5788 been executed), return the current history number even if we're
5789 not currently saving commands in the history list
5790 (remember_on_history == 0). Prompted by report from Paul Wise
5791 <pabs3@bonedaddy.net>
5795 doc/bush.1,lib/readline/doc/rluser.texi
5796 - make it clear that the `bind' builtin can be used to set readline
5797 keybindings and variables. Suggestion from Dan Jacobson
5798 <jidanni@jidanni.org>
5803 - GX_SYMLINK: new internal flag denoting we are processing a symlink to
5804 a directory. If GX_GLOBSTAR is active, we should not `descend' into
5808 - glob_filename: if the directory portion of the pattern is `**'
5809 (all_starstar), we have globbed all of the directories corresponding
5810 to that pattern, and we encounter a name that is a symlink to a
5811 directory, don't descend into it: if the filename portion is null,
5812 return that name only; if the filename portion is non-null, skip over
5813 it because we will pick it up when we process the `real' directory.
5814 This is a better fix for the issue originally reported by
5815 Murukesh Mohanan <murukesh.mohanan@gmail.com> back in 4/2018 and
5816 addresses the issue raised by Eli Schwartz <eschwartz@archlinux.org>
5817 - glob_dir_to_array: slight optimization: if array[i] is the empty
5818 string, don't bother to strcpy it or check the result for a directory
5819 for GX_MARKDIRS support
5824 - test_for_canon_directory: test a pathname for a directory, but
5825 expand and canonicalize it first using bush_filename_stat_hook()
5826 before calling stat(2)
5827 - bush_progcomp_ignore_filenames: strip non-directories out of a match
5828 list, but use the function above that canonicalizes the pathname to
5829 expand the name before testing
5830 - bush_directory_completion_matches: use bush_progcomp_ignore_filenames
5831 to strip out non-directories so we get consistent results between
5832 programmable completion and tab completion. Fixes bug reported by
5833 Ville Skyttä <ville.skytta@iki.fi>
5836 - read_builtin: allow read -e and read -u N to be used together, by
5837 calling fdopen(fd) if fd != 0. Save and restore rl_instream. Fixes
5838 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927768
5842 lib/readline/input.c
5843 - rl_getc: if readline catches SIGTSTP, the calling application must
5844 not have had it ignored. Run the signal handler and set the signal
5845 hook in case the application wants to handle it. Report from
5846 Robert Elz <kre@bmunnari.oz.au>
5851 - parser_will_prompt: check and return true if we have consumed the
5852 entire readline line buffer and will have to go back to readline for
5853 more input, printing a prompt as a consequence
5856 - parse_command: if parser_will_prompt() returns 0, indicating that we
5857 still have unconsumed input in the readline line buffer, don't
5858 execute PROMPT_COMMAND. TENTATIVE fix prompted by report from
5859 Matteo Landi <matteo@matteolandi.net>
5862 - set_eol_delim: save the old values before changing the bindings for
5863 RETURN and the delimiter character, in case the delimiter is RETURN.
5864 Fixes bug report from Stephane Chazelas <stephane.chazelas@gmail.com>
5865 - read_builtin: if the delimiter is '\0' and we are using readline,
5866 don't terminate the buffer and go back to read another character;
5867 allow the NULL to pass through and terminate the read.
5868 Fixes bug report from Stephane Chazelas <stephane.chazelas@gmail.com>
5873 - bush_delete_histent: decrement history_lines_this_session only if
5874 remove_history returns a non-null history entry, and return failure
5875 if it does return a null entry
5877 builtins/history.def
5878 - history_builtin: when checking the argument to -d, display an error
5879 if the argument is >= history_base + history_length, since that's
5880 what history_get and remove_history check. Fixes issue reported by
5884 - hpux11: change stanza to create shared libraries on later versions of
5885 HPUX 11. Contributed by Michael Osipov <michael.osipov@siemens.com>
5887 lib/readline/terminal.c
5888 - _rl_init_terminal_io: assume TGETENT_BROKEN defined means that tgetent
5889 returns 0 on success, as on HPUX 11. Bug reported by Michael Osipov
5890 <michael.osipov@siemens.com>
5893 - hpux: add -DTGETENT_BROKEN to LOCAL_CFLAGS
5896 - select_builtin: set executing_builtin around the call to read_builtin
5897 so we can run traps if the read call is interrupted. From a report
5898 from Andreas Kusalananda Kähäri <andreas.kahari@abc.se>
5903 - The Restricted Shell: add some language detailing the weaknesses of
5904 the restricted shell mode in isolation, inspired by a discussion on
5905 the zsh mailing list
5910 - malloc: define to sh_malloc to get file and line information from
5911 malloc (not xmalloc) calls. From a suggestion by achurch@achurch.org
5914 builtins/evalstring.c
5915 - parse_and_execute: make sure the parser is not expanding an alias
5916 before terminating the loop that processes characters in the string.
5917 Fixes problem with -c commands that end with an alias reported by
5918 Yu Kou <ckyoog@gmail.com>
5919 - should_suppress_fork: make sure that we don't try to optimize out a
5920 fork if the parser is still expanding an alias
5925 - rl_get_previous_history: if previous_history() returns NULL, only
5926 free the saved history if we were the ones who saved it; leave any
5927 existing saved history entry alone. Fixes problem with ^N not working
5928 at the end of the history if we previously moved back to the start
5931 lib/readline/histfile.c
5932 - read_history_range: when reading until FROM lines with a history
5933 file that has timestamps, make sure to skip to the end of the command
5934 line corresponding to the FROMth line instead of leaving line_start
5935 pointing to it, and keep track of the start of the last timestamp in
5936 last_ts for use by the loop below. Fix for history -n bug reported
5937 by HIROSE Masaaki <hirose31@gmail.com>
5939 lib/readline/display.c
5940 - init_line_structures: if, for some reason, _rl_screenwidth ends up
5941 bigger than the line_size default of 1024 (e.g., gdb's setting the
5942 terminal width to 0), make sure line_size is at least _rl_screenwidth.
5943 From a report by Tom de Vries <tdevries@suse.de>
5948 - brand: split the code into a function that generates a 32-bit value
5949 given the last value in the sequence (intrand32) and a function that
5950 returns a 16-bit random number (brand)
5951 - seedrand: small change in hopes of adding slightly more entropy
5952 - brand: modify the 16-bit version to XOR the top 16 bits of the 32-bit
5953 seed with the bottom 16 bits and return the lower 15 bits of that
5954 result as before. Based on an analysis by Andrew Church
5955 <achurch+bush@achurch.org>
5960 - genseed: break code that generates the 32-bit seed for the RNG into
5961 a separate function; call from seedrand
5962 - {brand32,sbrand32,seedrand32}: new 32-bit versions of the random
5963 number generator functions that use the entire 32-bit internal value.
5964 Prep for systems that don't have /dev/urandom or arc4random()
5965 - perturb_rand32: shake up the 32-bit LCRNG in subshells
5970 - get_urandom32: get a 32-bit random number by using the first one of
5971 these that succeeds: reading from /dev/urandom (if available),
5972 calling arc4random (if available), and using the internal 32-bit
5973 RNG (always available)
5974 - SRANDOM: expand to a 32-bit random number. This is not a LCRNG, so
5975 the numbers shouldn't have any relationship to previous returned
5976 values. Assignments are accepted but have no effect on the sequence.
5981 doc/{bush.1,bushref.texi}
5982 - SRANDOM: document new special variable
5987 - find_pid_in_pipeline: abstract some code from find_pipeline to look
5988 for a PID in a specific pipline passed as an argument
5989 - find_pipeline: if we have some saved pipeline(s), look there to find
5990 the PID instead of returning failure. This process could have been
5991 started from a DEBUG trap that saved the_pipeline. Fixes Linux bug
5992 reported by Hengyang Zhao <hzhao877502@gmail.com>
5995 - unbind_keyseq: use rl_function_of_keyseq_len so you can unbind ^@
5996 (which translates to 0). Fixes bug reported by
5997 Dennis Williamson <dennistwilliamson@gmail.com>
6001 lib/readline/display.c
6002 - rl_redisplay: make sure that the line structures can hold up to
6003 _rl_screenwidth characters, to support applications like gdb that
6004 set the screen width to huge values. Report and fix from
6005 Tom de Vries <tdevries@suse.de>
6010 - rl_generic_bind: move `ic' from block scope to function scope to
6011 avoid problems with compilers that destroy and recreate it every
6012 time through the loop. Report and fix from Adam Richter
6013 <adamrichter4@gmail.com>
6018 - wait_for_job: now takes an additional struct procstat * argument,
6019 and returns the pid and status of the job's `controlling process'
6023 - wait_for_background_pids: take a struct proctstat * argument and fill
6024 it in with pid and status of the last process to terminate
6027 - wait_for_job, wait_for_background_pids: add additional argument to
6031 - wait_builtin: set pstat.{pid,status} each time through the pid-or-job
6032 loop and for wait without arguments
6037 - termsig_handler: clean up last_procsub_child before exiting, after
6038 unlinking all FIFOs or closing FDs to all the pipes. Might need to
6039 send it a SIGTERM too. Fixes issue reported by mwnx <mwnx@gmx.com>
6042 - CASEMOD_CAPCASE: no longer defined by default
6047 - glob_always_skip_dot_and_dotdot: new global variable, if set to
6048 a non-zero value, no glob pattern will ever match `.' or `..'.
6054 - cmd_xmap: changes to support multiple cmd_xmaps, one per editing
6055 mode keymap (one each for vi insert and command modes). Changes from
6056 Koichi Murase <myoga.murase@gmail.com>
6059 - execute_arith_command: change from expanding the expression using
6060 expand_words_no_vars to use expand_arith_string, with the accompanying
6061 conversion from a WORD_LIST into a string. This makes it more
6062 consistent with other arithmetic expansions. Inspired by a
6063 discussion begun by Nils Emmerich <nemmerich@ernw.de>
6068 - waitchld: since process substitutions are asynchronous, save the
6069 status of one that exits (that we still know about) in the bgpids
6075 - wait_for_background_pids: wait for the last procsub only if it's the
6076 same as last_asynchronous_pid
6079 - bush_backward_shellword: changes to behave better when at the
6080 beginning of the last character on the line and to leave point at
6081 the beginning of the shellword, like backward-word. Fixes from
6082 Andrew Gaylard <a.gaylard@gmail.com>
6087 - __P: Replaced with PARAMS. First of many
6088 - bush_transpose_shellwords: transpose-words, but using `shellword'
6089 word boundaries like shell-forward-word and shell-backward-word.
6090 Contributed by Andrew Gaylard <a.gaylard@gmail.com>
6091 - "shell-transpose-words": new name binding for bush_transpose_shellwords
6092 - bush_readline_initialize: add default bindings for shell-forward-word,
6093 shell-backward-word, shell-transpose-words, and shell-kill-word.
6094 Suggested by Andrew Gaylard <a.gaylard@gmail.com>
6096 lib/readline/doc/rluser.texi
6097 - shell-transpose-words: document
6098 - {shell-forward-word,shell-backward-word,shell-kill-word,shell-transpose-words}:
6099 document new default bindings bush now adds
6102 - set_argv0: function to assign argv0 if it's found in the initial
6103 shell environment. Suggested by Cuong Manh Le
6104 <coung.manhle.vn@gmail.com>
6105 - initialize_shell_variables: call set_argv0() as part of shell
6111 - execute_for_command: make sure to call stupidly_hack_special_variables
6112 on the index variable each time bind_variable is called on it. If
6113 someone does something nonsensical like `for OPTIND in ...' we want
6114 the side effects to happen. Reported by Stephane Chazelas
6115 <stephane.chazelas@gmail.com>
6116 - execute_select_command: do the same thing for the selection variable
6117 after calling bind_variable
6122 - unset_builtin: if neither -f nor -v is supplied, and a NAME cannot
6123 be a shell variable because it's not a shell identifier, try to
6124 unset a shell function whether we're in posix mode or not. Suggested
6125 back in 1/2019 by PePa65 <solusos@passchier.net> and Robert Elz
6126 <kre@bmunnari.oz.au>
6129 - execute_simple_command: if this is being executed by the command
6130 builtin (flags&CMD_COMMAND_BUILTIN), don't bother to print the
6131 command words if set -x is enabled. From a report by Martijn Dekker
6132 <martijn@inlv.org> back in 4/2018
6137 - glob_filename: if we are not being called recursively, and there is
6138 only a directory name, dequote the passed pathname and see if it
6139 names an existing directory. If it does, return it; otherwise return
6140 failure ((char **)&glob_error_return). This is what makes backslash
6141 escaped-characters in pathnames in shell variables work the same as
6142 the same value passed directly. From an anonymous comment on
6143 https://savannah.gnu.org/support/?109629 and a discussion on the
6148 pathexp.c,lib/glob/glob.c
6149 - posix_glob_backslash: variable to control whether or not pathname
6150 expansion handles backslashes in the pattern the way Posix says it
6151 should. Enabled by default
6154 - posix_glob_backslash: new extern declaration
6157 - posixglob: new option, reflects the value of posix_glob_backslash
6160 - posix_vars: add posix_glob_backslash to the table
6161 - posix_initialize: set posix_glob_backslash to 1 when turning on
6166 doc/{bush.1,bushref.texi}
6167 - pathname expansion: note that under some circumstances the shell
6168 will invoke the matching engine for words with unquoted backslashes
6169 - posixglob: document the new shell option and its effects
6173 {config.h.in,configure.ac}
6174 - setresuid,setresgid: check and set HAVE_{DECL,}_SETRES[UG]ID as
6178 - disable_priv_mode: if we have setres[ug]id, use them over
6179 set[ug]id, which only set the save user-id and group-id if the
6180 process is running as root. From Ian Eldred Pudney
6181 in https://savannah.gnu.org/patch/?9822
6186 - glob_vector: don't bother trying to read the directory if the filename
6187 pattern doesn't have any globbing characters except backslash; just
6188 dequote the pattern and try to lstat(2) it as if there were no
6189 globbing characters at all. From an austingroup-bugs discussion
6190 message from Stephane Chazelas <stephane.chazelas@gmail.com>
6193 - completion_glob_pattern: just call glob_pattern_p and make sure it
6194 returns 1 (non-backslash globbing characters)
6197 - help_builtin: don't try pattern matching the help topic argument
6198 unless glob_pattern_p returns 1
6201 - unquoted_glob_pattern_p: when in a bracket expression (open > 0),
6202 don't allow an unquoted slash as part of the bracket expression.
6203 Report from Stephane Chazelas <stephane.chazelas@gmail.com>
6208 - print_function_def,named_function_string: make sure to call
6209 PRINT_DEFERRED_HEREDOCS to finish printing any here documents and
6210 delimiters before printing the function closing brace. Fixes bug
6211 reported by Denis McKeon <dmckeon@swcp.com>
6214 - execute_command_internal: call reap_procsubs at the end of executing
6215 a group command on systems that have /dev/fd. Fixes bug reported by
6221 - waitchld: this is in the potential SIGCHLD path, so don't call
6222 bgp_add, which can potentially call malloc. The glibc malloc doesn't
6223 handle that well. Report from howaboutsynergy@protonmail.com
6228 - bind_builtin: make sure return_code is >= 0 before returning it.
6229 Fixes bug with bind -x and invalid key sequences reported by
6234 doc/{bush.1,bushref.texi}
6235 - unset: fixed up list of special variables that lose their special
6236 properties if they are unset. Report and fix from Edward Huff
6242 - unary_test: update the `-N' test to use timespecs and nanosecond
6243 granularity if available, and use mtime > atime instead of the
6244 old mtime >= atime. Fixes bug reported by kfm@plushkava.net
6247 - strtod: make sure to use locale_decpoint() to determine the radix
6253 - utf8_mblen: return -2 if the UTF-8 sequence is incomplete
6254 - utf8_mblen: 4-byte UTF-8 characters start with a byte <= 0xf4; limit
6255 to 4-byte UTF-8 (since 5- and 6-byte code points were removed in 2003)
6260 - sh_input_line_state_t: if HANDLE_MULTIBYTE is defined, add members
6261 for saving shell_input_line_property and its associated size; let
6262 save_line_state and restore_line_state manage it. This means
6263 restore_line_state no longer calls set_line_mbstate. From a report
6264 from astian <astian@e-nautia.com>
6267 - set_line_mbstate: if the current locale is not multibyte, just set
6268 everything in the property array to 1
6269 - set_line_mbstate: use locale_utf8locale to optimize away calls to
6270 mbrlen; just use utf8_mblen
6275 - sv_tz: remake the export env if TZ is being unset. Fixes bug
6276 reported by Travis Everett <travis.a.everett@gmail.com>
6278 lib/readline/display.c
6279 - rl_expand_prompt: if the prompt contains embedded newlines, compute
6280 local_prompt_prefix before local_prompt because each call sets
6281 local_prompt_newlines, and we want the values computed in the call
6282 that uses local_prompt to be the ones that we use. Fixes prompt
6283 wrapping bug reported by Tianon Gravi <admwiggin@gmail.com>
6288 - added a number of dependencies from Vemake Vemake
6289 <vemakereporter@gmail.com> as reported in
6290 http://savannah.gnu.org/patch/download.php?file_id=47219
6295 - utf8_mblen: changes to handle invalid multibyte sequences better,
6296 even when N means that the sequence would be too short anyway
6299 - bind_assoc_var_internal: new convenience function to assign a
6300 key-value pair to an associative array. It gets the SHELL_VAR * AND
6301 a HASH_TABLE *, which may or may not correspond to the assoc_cell
6302 of the variable, and performs the insertion into the hash table.
6303 Callers take care of passing the right values.
6304 - bind_assoc_variable: call bind_assoc_var_internal to do the real
6306 - assign_compound_array_list: change to assign associative array
6307 key-value pairs into a new hash table (NHASH), so we can still use
6308 the old value for expansion. We do this in place of clearing out
6309 the contents of the associative array before performing the expansion
6310 and assignments. After doing all the assignments into NHASH, we swap
6311 NHASH into the variable as its value and dispose of the old value.
6312 Fixes inconsistency reported by Darren 'Tadgy' Austin
6313 <darren@afterdark.org.uk>
6318 - include bushansi.h in a bunch of AC_TRY_RUN recipies to avoid
6319 exit() being flagged as an implicit declaration. Report and fix
6320 from Chris Yungmann <yungmann.chris@gmail.com>
6323 - set_exit_status: set last_command_exit_value to the argument and make
6324 sure to set PIPESTATUS from that exit value
6327 - set_exit_status: extern declaration
6330 - report_syntax_error: make sure to set PIPESTATUS if we set
6331 last_command_exit_value on a syntax error
6332 - parse_string_to_word_list,parse_compound_assignment: set PIPESTATUS
6333 when we set last_command_exit_value
6336 - throw_to_top_level,sigint_sighandler: set PIPESTATUS when we set
6337 last_command_exit_value
6340 - sv_locale: call set_exit_status to set PIPESTATUS and last_command_exit_value
6343 - find_or_make_array_variable,array_expand_index,assign_compound_array_list:
6344 call set_exit_status to set PIPESTATUS and last_command_exit_value
6346 builtins/evalstring.c
6347 - parse_and_execute: set PIPESTATUS when we set last_command_exit_value
6350 - brace_expand: call set_exit_status to set PIPESTATUS and last_command_exit_value
6353 - reader_loop: call set_exit_status to set PIPESTATUS and last_command_exit_value
6356 - set PIPESTATUS when setting $? due to syntax errors or constructs
6360 - expr_streval: set PIPESTATUS when setting $? due to syntax errors
6363 - extract_delimited_string,extract_dollar_brace_string,do_assignment_internal,
6364 call_expand_word_internal,array_length_reference,param_expand,
6365 parameter_brace_expand_word,parameter_brace_expand_rhs,
6366 parameter_brace_expand_error,parameter_brace_expand,err_unboundvar:
6367 set PIPESTATUS when setting last_command_exit_value on error
6371 - REDIRECTION_ERROR: set PIPESTATUS when setting last_command_exit_value
6375 - match_upattern,match_wpattern: if the match length is greater than the
6376 string length, short-circuit and return failure. Fixes bug
6377 reported by Eduardo Bustamante <dualbus@gmail.com>
6382 - BRACKMATCH: if we think we've matched, tighten up the rules for
6383 the closing right bracket in the bracket expression to be correct
6384 in the presence of invalid character classes, collating symbols,
6385 and equivalence classes. If they're invalid, they shouldn't require
6386 additional right brackets to close them
6391 - add the right includes so colon_builtin and false_builtin can take
6392 a WORD_LIST * argument like the prototype says they do
6397 - _rl_read_bracketed_paste_prefix: read the character prefix that
6398 indicates a pasted string in bracketed paste mode. If we don't
6399 read a valid bracketed paste prefix, push the other characters
6400 back onto the input stack with _rl_unget_char
6401 - _rl_bracketed_read_key: handle reading pasted input when bracketed
6402 paste mode is enabled, including reading multibyte characters; push
6403 anything beyond a single byte back onto the input stack where it
6404 can be read by _rl_read_mbstring or subsequent input
6405 - _rl_bracketed_read_mbstring: handle reading pasted input in bracketed
6406 paste mode, using _rl_bracketed_read_key to get the pasted text,
6407 then call _rl_read_mbstring to get the rest of any multibyte char
6410 lib/readline/vi_mode.c
6411 - _rl_vi_callback_getchar: call _rl_bracketed_read_mbstring to handle
6412 bracketed paste mode input. Fixes issue with vi-change-char reported
6413 by <vampyrebat@gmail.com>
6414 - rl_vi_domove_getchar: just call _rl_bracketed_read_key and return
6415 the result -- we're not interested in multibyte-character input here
6417 - rl_vi_replace: bind BRACK_PASTE_PREF key sequence if bracketed paste
6418 mode has been enabled
6419 - _rl_overstrike_bracketed_paste: key binding function for the bracketed
6420 paste prefix key sequence in overwrite mode; reads the pasted text
6421 and uses rl_vi_overstrike to add each character in overwrite mode.
6422 Fixes issue reported by <vampyrebat@gmail.com>
6426 lib/readline/input.c
6427 - _rl_read_mbchar: the first time through the loop (mb_len == 0), call
6428 _rl_bracketed_read_key to process any bracketed paste characters
6431 - _rl_char_search: use _rl_bracketed_read_key in the non-multibyte
6435 - _rl_arg_dispatch: use _rl_bracketed_read_key in place of rl_read_key
6438 - list_string: if string_extract_verbatim returns something, just make
6439 a WORD_DESC * and add current_word directly to it, noting that we
6440 don't want to free current_word (free_word = 0)
6441 - string_extract_verbatim: if the separator string is the empty
6442 string, don't bother with the loop -- just savestring the string,
6443 update *sindex, and return the copy
6444 - read_comsub: make the string we use to save the output from the pipe
6445 512 bytes instead of 128 (same size as the buffer used to read from
6446 the pipe); fewer calls to xrealloc in the worst case
6447 - parameter_brace_expand_length: optimize the common case (non-dynamic
6448 scalar variable without `set -u' in effect) and just call MB_STRLEN
6449 on the variable value in that case. From a report from
6450 Alkis Georgopoulos <alkisg@gmail.com>
6455 - execute_subshell_builtin_or_function: call subshell_exit() instead of
6456 sh_exit() or exit() so the exit trap gets run. Fixes issue reported
6457 in https://savannah.gnu.org/support/?109840
6458 - replace __P with PARAMS
6460 lib/readline/colors.c
6461 - _rl_print_color_indicator: eliminate one use of S_ISLNK.
6462 Report and fix from Christian Biesinger <cbiesinger@google.com>
6467 - push_posix_temp_var: change to use bind_variable and modify variables
6468 at the current local scope or create and modify variables at the
6469 global scope, as if a standalone assignment statement had been
6470 executed. This restores some bush-4.4 backwards compatibility with
6471 respect to posix-mode assignment statements preceding special
6472 builtins and shell functions. The bush-5.0 behavior, while perhaps
6473 defensible, caused too many compatibility problems. Originally
6474 prompted by several discussions with Martijn Dekker; the current
6475 incarnation and tests based on a report to Debian BTS from
6476 Thorsten Glaser <tg@mirbsd.de>
6484 - set_option_defaults,reset_option_defaults: before calling
6485 list_minus_o_options at invocation, call set_option_defaults to
6486 set the options that are initialized to -1 to either 1 or 0, as
6487 appropriate; then call reset_option_defaults to set them back to -1
6488 after list_minus_o_options returns
6489 - init_interactive: if enable_history_list == -1, set it to 1, then
6490 set remember_on_history to enable_history_list. Fixes bug reported
6491 by Alex Kerzner <alex.j.kerzner@gmail.com>
6492 - init_noninteractive: if enable_history_list == -1, set it to 0, let
6493 bush_history_reinit take care of setting remember_on_history
6494 - init_interactive_script: if enable_history_list == -1, set it to 1,
6495 then set remember_on_history to enable_history_list
6498 - enable_history_list: initialize to -1 to note when it gets changed
6499 by -o history or +o history at invocation
6503 lib/readline/terminal.c
6504 - TGETENT_SUCCESS, TGETFLAG_SUCCESS: defines to represent successful
6505 returns from tgetent and tgetflag, since HPUX manages to get them
6506 wrong. New patch from Osipov, Michael <michael.osipov@siemens.com>
6507 - TGETFLAG: new define, make sure tgetflag returns TGETENT_SUCCESS
6508 - _rl_init_terminal_io: use TGETENT_SUCCESS and TGETFLAG
6511 - hpux: make sure to define TGETFLAG_BROKEN
6516 - add copyright notices to all scripts longer than 15 lines at the
6521 lib/readline/complete.c
6522 - _rl_complete_internal: move logic that checks whether the last
6523 completion attempt failed and the current attempt returned a single
6524 match and insert the single completion here. A better implementation
6525 of Richard Stallman's suggestion of 2/23.
6530 - edit_and_execute_command: reset the readahead token after calling
6531 restore_parser_state, in case some call to reset_parser set
6532 token_to_read. Fixes bug reported by null <avalonvales@protonmail.com>
6537 - execute_command_internal: if we're executing a command list
6538 (executing_list != 0), save the old fifo list and close any new
6539 FIFOs that the command opens. Fixes bug reported by
6540 Kamil Cukrowski <kamilcukrowski@gmail.com>
6544 aclocal.m4,m4/intdiv0.m4
6545 - make sure `exit' is used consistently with <stdlib.h> included
6546 - make sure `main' isn't declared to implicitly return int
6547 - include <ulimit.h> before using ulimit
6548 - include <string.h> before testing string functions
6549 - fixes from Florian Weimer <fweimer@redhat.com>
6552 - setresuid,setresgid: use AC_CHECK_FUNCS instead of AC_CHECK_DECL,
6556 - disable_priv_mode: use HAVE_SETRESUID and HAVE_SETRESGID instead of
6557 the HAVE_DECL variants, which always fail configure tests
6560 - gt_INTL_SUBDIR_CORE: add back check for localeconv, removed in
6561 newer gettext releases
6566 - help_builtin: make the closing quote printed after the argument list
6567 for a glob pattern argument a translatable string to ease translation
6568 for certain languages. Report from Roland Illig <roland.illig@gmx.de>
6570 builtins/{reserved,complete,exec,getopts}.def
6571 - minor typographical fixes from Roland Illig <roland.illig@gmx.de>
6574 - include general.h for INT_STRLEN_BOUND
6575 - initialize_siglist: use the same string for the strlen and xmalloc
6576 for the message about an unknown signal number; use INT_STRLEN_BOUND
6577 instead of a fixed 10 for the number
6579 builtins/getopts.def,doc/{bush.1,bushref.texi}
6580 - getopts: minor changes to the description of the effect of supplying
6581 additional arguments. Report from Roland Illig <roland.illig@gmx.de>
6586 - save_proc_status: external interface to bgp_add, takes care of
6587 blocking and unblocking SIGCHLD
6593 - procsub_{free,add,search,delete,waitpid,waitall,clear,prune}: new
6594 functions to keep track of the list of active process substitutions
6595 and their statuses. Implementation is currently a singly-linked list
6596 of PROCESS *, so functions that expect a PROCESS * to manipulate
6597 continue to work. Inspired by report from leo.dalecki@ntymail.com
6598 - find_pipeline,cleanup_dead_jobs,wait_for_background_pids: call new
6599 procsub_* functions to manage procsub list; don't call the functions
6603 - process_substitute: call procsub_add with the PROCESS * returned
6604 from make_child; let the functions in jobs.c manage the list.
6605 waitchld continues to set the pid field in the fifo list as a hint
6606 that a particular fd or FIFO is no longer used and can be reaped
6607 - process_substitute: let the child process clear out any existing
6609 - wait_procsubs: no longer compiled in
6612 - termsig_handler: replace discard_last_procsub_child with call to
6615 lib/readline/display.c
6616 - init_line_structures: fix a problem which results in references to
6617 uninitialized memory when gdb sets the number of columns to 32767
6618 (their `unlimited'). Modification of change from 5/23. Report and
6619 fix from Andrew Burgess <andrew.burgess@embecosm.com>
6624 - xparse_dolparen: after calling parse_string to consume input, make
6625 sure to reset the parser (reset_parser()) before restoring the EOF
6626 token and the parser_state variable. Fixes issue with nested traps
6627 running command substitutions in command lines with command
6628 substitutions reported by Travis Everett <travis.a.everett@gmail.com>
6632 doc/{bushref.texi,bush.1}
6633 - fixed a typo in the example for the =~ operator: the ? should follow
6634 the (a), not precede it. Report from hk <hkadeveloper@gmail.com>
6635 - some changes to the text describing regular expression matching for
6640 general.c,builtins/shopt.def
6641 - posix_glob_backslash: remove references to this variable and the
6642 `posixglob' shell option
6644 doc/{bush.1,bushref.texi}
6645 - remove references to the `posixglob' shell option
6650 - DEFAULT_MAX_CHILD: bump this up to 4096
6651 - set_maxchild: set lmaxchild to MAX_CHILD_MAX if getmaxchild returns
6652 -1 without changing errno (assume that sysconf returns -1 meaning
6654 - initialize_job_control: call set_maxchild instead of inline code
6655 - mark_dead_jobs_as_notified: call set_maxchild to set js.c_childmax
6656 if it hasn't been set yet
6660 lib/glob/xmbsrtowcs.c
6661 - xwcsrtombs: implementation of wcsrtombs from gnulib, modified to
6662 treat invalid wide characters (or wide characters that can't be
6663 converted to multibyte character sequences) as bytes. Should be
6664 used only in unusual circumstances where wcsrtombs fails.
6667 - wdequote_pathname: if wcsrtombs fails to convert the dequoted wide
6668 character pathname back to a sequence of multibyte characters, call
6669 xwcsrtombs to try to treat the invalid wide characters as bytes --
6670 the call to xdupmbstowcs treats bytes that don't convert to wide
6671 characters as just bytes, which kind of causes this problem in the
6672 first place. Inspired by report from Geoff Kuenning <geoff@cs.hmc.edu>
6674 lib/readline/complete.c
6675 - compute_lcd_of_matches: use the case-folding code (which performs
6676 character-by-character checking and compares invalid multibyte
6677 sequences as bytes) instead of the old case-sensitive code (which
6678 used _rl_compare_chars), converting characters to lowercase as
6679 needed. Fixes bug with invalid sequences in common filename prefixes
6680 reported by Grisha Levit <grishalevit@gmail.com>
6685 - reset_shopt_options: add in resets for some missing shopt options.
6686 Report and fix from Grisha Levit <grishalevit@gmail.com>
6689 - execute_command_internal: make sure a failed attempt to define a
6690 shell function causes the shell to exit if -e is enabled. Report
6691 from Andreas Kusalananda Kähäri <andreas.kahari@abc.se>
6692 - execute_command_internal: combine cm_function_def, cm_arith, and
6693 cm_cond cases into one switch case, since the code is virtually
6694 identical across all three
6698 pathexp.[ch],lib/glob/glob.c,lib/glob/glob_loop.c
6699 - remove all references to posix_glob_backslash in preparation for
6700 implementing austin group interpretation #1234
6703 - unquoted_glob_pattern_p: revert to bush-4.4 behavior of returning 1
6704 only if there is an unquoted `*', `?', or bracket expression, as
6705 per austin group interpretation #1234
6707 lib/glob/glob_loop.c
6708 - INTERNAL_GLOB_PATTERN_P: revert to bush-4.4 behavior of returning 1
6709 only if there is an unquoted `*', `?', or bracket expression, as
6710 per austin group interpretation #1234
6715 - assign_seconds,get_seconds: use the tv_sec value returned from
6716 gettimeofday() instead of time() to get a better approximation of
6717 the number of seconds since the epoch for future calculations.
6718 From a report by Stephane Chazelas <stephane.chazelas@gmail.com>
6720 pathexp.[ch],{bushline,subst}.c
6721 - shell_glob_filename: now takes an additional flags argument to pass
6722 to quote_string_for_globbing
6727 - glob_expand_word_list: call shell_glob_filename with QGLOB_CTLESC
6728 because quote removal hasn't been performed yet
6733 - quote_string_for_globbing: if we have an unquoted backslash followed
6734 by a CTLESC-quoted character (not CTLESC-CTLESC), just perform the
6735 usual CTLESC-to-backslash conversion instead of skipping over it.
6736 Fixes issue raised in austin-group discussion about globbing by
6737 Geoff Clare <gwc@opengroup.org> (austin-group issue 1234), though
6738 it's still inherently ambiguous
6743 - xwcsrtombs: extern declaration, to match other functions in that file
6746 - wcdequote_pathname: new function, actual backslash quote removal code
6747 from wdequote_pathname; wdequote_pathname calls it
6750 - {udequote,wcdequote}_pathname: now public void functions
6753 - DEQUOTE_PATHNAME: defined appropriately to udequote_pathname or
6757 - DEQUOTE_PATHNAME: appropriate extern declaration
6758 - BRACKMATCH: call DEQUOTE_PATHNAME to dequote a character class name
6759 in a bracket expression. This is the result of a discussion on the
6760 austin-group mailing list, from Geoff Clare <gwc@opengroup.org> and
6761 Robert Elz <kre@bmunnari.oz.au>
6766 - async_redirect_stdin: now a global function
6769 - process_substitute: call async_redirect_stdin in the child to keep
6770 it from having stdin connected to the terminal, since it's not a
6776 - process_substitute: in the child process, set interactive = 0, since
6777 an asynchronous process substitution process is not interactive.
6778 Seems to fix issue reported by Grisha Levit <grishalevit@gmail.com>
6781 - sh_regmatch: implement a suggestion from Grisha Levit
6782 <grishalevit@gmail.com> and don't allow nocaseglob to enable case-
6783 insensitive regexp matching. It hasn't been documented that way
6789 - bush_add_history: fix a couple of problems with adding extra blank
6790 lines to history entries containing here-documents. Fixes bug
6791 reported by Oguz <oguzismailuysal@gmail.com>
6794 - BUSH_REMATCH: no longer set to readonly. From a suggestion from
6795 Rocky Bernstein <rocky@gnu.org>
6797 doc/{bush.1,bushref.texi}
6798 - BUSH_REMATCH: document that it's no longer set to readonly
6801 - getpattern: since expand_string_for_pat leaves the pattern quoted,
6802 we need to remove quoted nulls before running the string through
6803 string_list (and then quote_string_for_globbing, since QGLOB_CVTNULL
6804 only handles pat[0] == CTLNUL). Fixes bug reported by Oguz
6805 <oguzismailuysal@gmail.com>
6809 configure.ac,config.h.in
6810 - AC_HEADER_MAJOR: look for `major' and `minor' in various header files
6811 and define MAJOR_IN_MAKEDEV or MAJOR_IN_SYSMACROS as appropriate.
6812 From a patch from Eli Schwartz <eschwartz@archlinux.org>
6814 examples/loadables/finfo.c
6815 - include <sys/mkdev.h> and <sys/sysmacros.h> as appropriate for
6816 definitions of major/minor
6821 - heredoc_expand: if we are expanding the WORD in a here-string, use
6822 expand_assignment_string_to_string so the expansions are consistent
6823 in contexts where word splitting is not performed. From a bug report
6824 by Robin A. Meade <robin.a.meade@gmail.com>
6829 - xparse_dolparen: if the command substitution is incomplete or doesn't
6830 end in `)', print an error message instead of allowing EOS to
6831 terminate the comsub. From a bug report from
6832 Oguz <oguzismailuysal@gmail.com>
6837 - u32toutf8: fix a typo that assigned the wrong value to the first
6838 byte of a six-byte UTF-8 character. Report and fix from
6839 István Pásztor <pasztorpisti@gmail.com>
6843 doc/bush.1,lib/readline/doc/{history.3,hsuser.texi}
6844 - quick substitution: make it clear that ^s1^s2^ is equivalent to
6845 !!:s^s1^s2^, since that's the internal transformation we perform.
6846 Reported by Jim Monte <jim.monte01@gmail.com>
6847 - note that the `q' and `x' modifiers are mutually exclusive; last
6848 one wins. Reported by Jim Monte <jim.monte01@gmail.com>
6849 - note that the `G' modifier can work with `&' as well as `s'.
6850 Reported by Jim Monte <jim.monte01@gmail.com>
6851 - note that a word designator of `-' is equivalent to `0-'.
6852 Reported by Jim Monte <jim.monte01@gmail.com>
6853 - note that a missing `new' in a substitution modifier causes
6854 instances of `old' to be deleted
6856 lib/readline/histexpand.c
6857 - history_expand_internal: make multiple :p modifiers work to suppress
6858 execution. Reported by Jim Monte <jim.monte01@gmail.com>
6859 - get_history_word_specifier: fix so a `^' word designator works as
6860 the second part of a range.
6861 Reported by Jim Monte <jim.monte01@gmail.com>
6862 - hist_error: make sure we don't blindly copy a null character into
6863 the error string (e.g., if there is a missing word designator
6864 following `:'). Reported by Jim Monte <jim.monte01@gmail.com>
6865 - get_history_event: if the history event specifier (!) is followed
6866 immediately by a `-' and a non-digit (e.g. !-a), make sure the - is
6867 treated as part of a search string instead of making it an offset of
6868 0. Reported by Jim Monte <jim.monte01@gmail.com>
6872 lib/readline/{colors,complete,histfile,input}.c,support/shobj-conf
6873 - fixes to make readline compile on the latest HPE Nonstop (Tandem)
6874 releases. From Randall S. Becker <rsbecker@nexbridge.com>
6877 - pat_subst: if we have a null match, make sure we advance by one
6878 character, not one byte. Bug reported by Chris Carlen
6879 <crobc@sbcglobal.net>
6883 jobs.[ch],nojobs.c,builtins/jobs.def
6884 - get_job_by_pid: now takes a PROCESS ** third argument; if non-null,
6885 it gets a pointer to the PROCESS struct corresponding to the PID
6886 argument. A convenience, not used by any caller yet
6889 - interrupt_immediately: remove any uses, no longer used anywheren
6892 - check_unbind_variable: return -2 if the variable name is readonly
6893 (change) or non-unsettable (new) to differentiate the return value
6894 from -1 from makunbound (which means variable not found)
6896 builtins/common.[ch]
6897 - builtin_unbind_variable: identical to check_unbind_variable but calls
6898 builtin_error; for use by builtin commands
6901 - wait_builtin: now has -p VARNAME option, which takes the pid
6902 returned by `wait -n' or wait without arguments and assigns it to
6903 VARNAME, unsetting VARNAME first. Requested by Robert Elz
6904 <kre@bmunnari.oz.au> after a similar feature in netbsd sh (not
6905 completely compatible yet)
6907 doc/{bush.1,bushref.texi}
6908 - wait: document new -p option
6912 lib/readline/display.c
6913 - rl_redisplay: auto-set horizontal scrolling if the terminal has
6914 only one line; disable it if we auto-set it if the terminal grows
6915 to more than one line. Fix from Sören Tempel
6916 <soeren@soeren-tempel.net>
6918 lib/readline/doc/{readline.3,rluser.texi},doc/bush.1
6919 - horizontal-scroll-mode: document auto-setting behavior
6922 - set_posix_mode: make setting posix mode when it's already set, or
6923 unsetting it when it's not set, a no-op. Inspired by a report
6924 from Ulrich Mueller <ulm@gentoo.org>
6928 doc/{bush.1,bushref.texi}
6929 - functions: clarify that when in default mode, function names are not
6930 limited to shell identifiers.
6931 Suggested by Reuti <reuti@staff.uni-marburg.de>
6935 lib/readline/display.c
6936 - _rl_optimize_redisplay: tell the redisplay routines to not worry
6937 about calculating differences between the lines and just draw the
6938 new one. Right now, it just sets the _rl_quick_redisplay flag
6939 - rl_redisplay: if _rl_quick_redisplay is set, just draw NEW onto
6940 the screen at column 0 with a dumb update and clear the rest of
6941 the line. Intended to be used when the caller knows the new line is
6942 sufficiently different from the old one (e.g., when drawing the
6943 i-search prompt for the first time) that it doesn't pay off to do
6944 the calculations. As a side effect, fixes the bug reported by
6945 ÐлекÑей Шилин <rootlexx@mail.ru>
6947 lib/readline/isearch.c
6948 - rl_display_search: if there isn't a search string, assume this is
6949 the first time this is called and call _rl_optimize_redisplay to
6950 give the redisplay code a hint
6955 - wait_builtin: allow argument to -p to be a valid array subscript
6959 lib/readline/isearch.c
6960 - _rl_isearch_fini: add call to _rl_optimize_redisplay because we are
6961 switching the prompt back again and it's safer to redraw everything
6962 (even though part of the line is the same) to deal with differences
6963 in the prompt strings. Fixes additional problem reported by
6964 ÐлекÑей Шилин <rootlexx@mail.ru>
6966 lib/readline/display.c
6967 - update_line: quick redisplay no longer sets cpos_adjusted before
6969 - update_line: adjust _rl_last_c_pos in the case of a dumb update if we
6970 are redrawing the prompt that includes invisible characters, since
6971 _rl_col_width does not. We adjust by the count of invisible chars in
6972 the first line of the prompt
6973 - update_line: make sure to clear the rest of the line if it looks like
6974 the number of visible characters on the new line is less than the
6975 number of visible characters on the current line; the old calculation
6976 does that just for the number of bytes (which is also useful)
6980 lib/readline/display.c
6981 - rl_redisplay: if we are changing from one line to multiple lines,
6982 don't try quick redisplay
6983 - update_line: changes to quick redisplay to take advantage of knowing
6984 the physical length of the prompt to avoid having to compute column
6985 widths of the prompt string again; moved code to call clear screen
6986 to the quick update section; no longer performs `goto dumb_update'
6987 - update_line: try to take advantage of prompt_physical_chars when we
6988 know we have written the prompt string (several places) to set
6989 _rl_last_c_pos and calculate column widths
6990 - update_line: if the spot where the old and new lines are the same is
6991 before the end of the prompt string, adjust NLS and OLS so we write
6992 the entire prompt string (as long as it's all on one line) and can
6993 take advantage of already knowing prompt_physical_chars so we don't
6994 have to compute column widths
6995 - update_line: when copying chars from first diff to last match, adjust
6996 _rl_last_c_pos by prompt_invis_chars_first_line, not wrap offset,
6997 since we are on the first line, and only do this if we inserted more
6998 bytes than wrap_offset (old code checked _rl_last_c_pos, which is
6999 wrong in the presence of multibyte characters)
7003 lib/readline/display.c
7004 - ADJUST_CPOS: define macro and use it in places where _rl_last_c_pos
7009 lib/readline/isearch.c
7010 - _rl_isearch_dispatch: check for multibyte characters mapped to one
7011 of the editing functions we treat specially to modify the search
7017 - FreeBSD and Dragonfly are ELF-only and can use the same code as
7018 Linux, so add those to the linux stanza and remove the old FreeBSD
7019 version-specific sections. Report and fix from Baptiste Daroussin
7023 - bush_execute_unix_command: no longer static, available for other
7024 parts of the shell to use
7027 - unbind_unix_command: take a key sequence as an argument, and unbind
7028 it in the appropriate unix command keymap
7031 - unbind_keyseq: if we are unbinding a key sequence bound to
7032 bush_execute_unix_command, which means it was added by `bind -x',
7033 call unbind_unix_command() to remove it from the appropriate unix
7034 command keymap. Fixes issue originally raised by
7035 Koichi Murase <myoga.murase@gmail.com> and recently by
7036 Šimon Let <simon.a.let@gmail.com>
7037 - bind_builtin: check the number of bindings to bush_execute_unix_command
7038 before and after a call to rl_parse_and_bind and if there are fewer
7039 after binding, we know that the bind has re-bound one of the key
7040 sequences that was bound to execute a shell command. We unbind any
7041 key sequences from the list before the call to rl_parse_and_bind that
7042 don't appear in the list after the call using unbind_unix_command
7047 - added some definitions for MinGW. Report and patch from
7048 Eli Zaretskii <eliz@gnu.org>
7052 lib/readline/display.c
7053 - update_line: when wrapping lines containing multibyte characters at
7054 the wrap point, and the number of screen positions consumed by the
7055 first character on the new line isn't the same as the old line,
7056 make sure we set OE before the `goto dumb_update;' since clearing
7057 the rest of the line may use it. Tentative fix for bug reported by
7058 Kirill Chibisov <wchibisovkirill@gmail.com>
7060 lib/readline/signals.c
7061 - _rl_signal_handler: set RL_STATE_SIGHANDLER around SIGWINCH code,
7062 like _rl_handle_signal does
7067 - strvec_posixcmp: new function that conforms to posix requirement for
7068 sorting globs: perform a bytewise comparison if the two strings
7069 collate equally. Posix interp 963 and 1070
7070 - strvec_sort: take a new flags argument, if non-zero use the posix
7071 string comparison function
7074 - shell_glob_filename: call strvec_sort with the flag value to be
7078 - strvec_sort: change callers
7083 - throw_to_top_level: set running_trap to 0 after calling run_trap_cleanup.
7084 This avoids spurious (in non-release versions) warnings from
7085 run_pending_traps the next time a trap handler for that signal
7086 runs. Bug report from Martijn Dekker <martijn@inlv.org>
7091 - find_cmd_start: don't treat the open brace in brace expansion as a
7092 command start character; only treat open brace specially if it can
7093 be a reserved word. Fixes bug reported back in October, 2019 in
7094 https://savannah.gnu.org/support/index.php?110063
7098 lib/readline/readline.c
7099 - _rl_dispatch_subseq,_rl_subseq_result: if we push back a character
7100 with _rl_unget_char or otherwise go back up the chain without a
7101 sequence match, make sure we back up in rl_executing_keyseq.
7102 Report and fix from Koichi Murase <myoga.murase@gmail.com>
7105 - unbind_keyseq: if we unbind something that ends up pointing to a
7106 shadow keymap, restore the ANYOTHERKEY binding that we used when
7108 Report and fix from Koichi Murase <myoga.murase@gmail.com>
7111 - bush_execute_unix_command: if we walked cmd_xmap for rl_executing_keyseq
7112 and ended up pointing to a keymap (type == ISKMAP) we want the
7113 binding for ANYOTHERKEY instead.
7114 Report and fix from Koichi Murase <myoga.murase@gmail.com>
7117 - rl_bind_key: if we're trying to bind a key sequence containing '\0'
7118 using the old-style binding syntax (C-SPC), make sure we quote the
7119 NULL so it will make it through rl_translate_keyseq().
7120 Report and fix from Koichi Murase <myoga.murase@gmail.com>
7121 - rl_bind_key: if we're overwriting a binding for a macro, make sure to
7122 free the old macro value.
7123 Report and fix from Koichi Murase <myoga.murase@gmail.com>
7124 - rl_generic_bind: if we're overwriting a macro saved to ANYOTHERKEY in
7125 a shadow keymap created by rl_generic_bind, make sure to free the
7127 Report and fix from Koichi Murase <myoga.murase@gmail.com>
7130 - run_pending_traps: save and restore the value of running_trap around
7131 cycle through pending signals so recursive trap handler calls don't
7132 set running_trap to 0
7133 - _run_trap_internal: allow some signals the shell treats specially
7134 (e.g., SIGINT) to run recursive handlers
7135 - _run_trap_internal: don't turn off SIG_INPROGRESS flag if it was on
7136 for this signal when _run_trap_internal was called
7137 - _run_trap_internal: save and restore the value of running_trap around
7138 running the trap handler, except for SIGCHLD. Fixes bug reported by
7139 Martijn Dekker <martijn@inlv.org>
7144 - posix_initialize: if turning posix mode off, restore settings from
7145 any saved set, if one exists, instead of setting a default environment
7150 - process_substitution: now available in POSIX mode. Most recently
7151 requested by Martijn Dekker <martijn@inlv.org>; requested several
7155 - posix mode: remove restriction that posix mode is not available
7157 lib/readline/vi_mode.c
7158 - rl_domove_motion_callback: make sure to extend rl_line_buffer so it
7159 can hold the dummy blank character we're appending. From a fuzzing
7160 report by Tillmann Osswald <tosswald@ernw.de>
7161 - vi_yank_dispatch: after we do an undo, make sure to fix point to be
7162 less than the (new) rl_end
7165 - rl_forward_word: make sure that MB_NEXTCHAR doesn't go past rl_end on
7166 invalid multibyte sequences
7171 - for the `-v' operator, use a clever trick from Martijn Dekker and
7172 just test whether N is between 0 and $#.
7177 - rl_change_case: fix argument to rl_extend_line_buffer; make sure to
7178 reset s and e after call in case rl_line_buffer was reallocated
7180 lib/readline/vi_mode.c
7181 - _rl_vi_save_replace: if start ends up being less than zero, make
7182 sure we don't read before the start of rl_line_buffer
7183 - rl_vi_overstrike_kill_line,rl_vi_overstrike_kill_word: replacement
7184 functions for ^U and ^W in vi overstrike mode, to keep right value
7185 for vi_replace_count.
7186 - rl_vi_overstrike_yank: similar for ^Y and rl_yank
7190 lib/readline/display.c
7191 - update_line: if we're trying to wrap lines on an autowrap terminal,
7192 punt and do a dumb update if the number of bytes in the first char
7193 on the new line is greater than the number of bytes in the first char
7194 of the old line. There's no guarantee we'll be able to extend the
7195 old line buffer enough to accommodate the new bytes
7196 - update_line: try to avoid some operations when wrapping lines if the
7197 number of bytes in the first characters of the old and new lines is
7199 - update_line: when updating vis_lbreaks after fixing up the lines when
7200 wrapping, make sure we don't exceed an index of _rl_vis_botlin when
7201 updating the line break offsets
7204 - rl_delete_text: if deleting text leaves the mark past rl_end, adjust
7207 lib/readline/vi_mode.c
7208 - _rl_vi_goto_mark: make sure to call _rl_fix_point after setting
7214 - rl_kill_region,region_kill_internal: call _rl_fix_point
7216 lib/readline/text.c,lib/readline/rlprivate.h
7217 - _rl_fix_mark: new function to clamp rl_mark between 0 and rl_end
7222 - rl_translate_keyseq: rework how key sequences are translated with
7223 the intent of normalizing backslash treatment. Since the current
7224 behavior of, e.g., \C-\\, is inconsistent, this change chooses to
7225 effectively treat and display \\ as \\ instead of \C-\. This is not
7226 completely backwards compatible, but it seems like the most reasonable
7227 choice. This allows things like \M-\a but is not compatible with
7228 pre-bush-4.4 (readline 7.0) handling of \C-\, which is now treated
7229 like \C-\0. If that proves to be a problem, we can add code to
7230 understand \C-\ as equivalent to \C-\\. Since attempting to bind
7231 "\C-\" has generated an error for a long time, it doesn't seem like
7232 it will be too much of a problem.
7233 Fixes from Koichi Murase <myoga.murase@gmail.com>
7234 - rl_invoking_keyseqs_in_map: make sure to consistently output
7235 backslash as `\\' instead of producing `\C-\'
7236 Fixes from Koichi Murase <myoga.murase@gmail.com>
7241 - readline_get_char_offset: translate a readline buffer offset
7242 (rl_point, rl_mark, rl_end) into a number of (possibly multibyte)
7244 - readline_set_char_offset: translate a number of (possibly multibyte)
7245 characters into a buffer offset in rl_line_buffer. Uses a private
7246 readline function to do it, which is bad
7247 - bush_execute_unix_command: use readline_{get,set}_char_offset to
7248 translate the rl_point to a character offset
7249 - bush_execute_unix_command: bind READLINE_MARK variable, exposing
7250 the value of rl_mark to `bind -x' functions
7252 doc/{bush.1,bushref.texi}
7253 - READLINE_MARK: document new variable set by the shell
7257 examples/loadables/accept.c
7258 - accept: new loadable builtin that will accept a TCP connection on a
7259 specified port. Inspired by Stan Marsh <gazelle@xmission.com>
7263 lib/readline/histfile.c
7264 - history_do_write,history_truncate_file: translate the return value rv
7265 to errno when histfile_restore returns -1 (e.g., if rename() fails).
7266 Report and fix from A <auroralanes@protonmail.ch>
7271 - fsleep: if pselect/select is interrupted by a signal, return -1 and
7272 let the caller deal with it
7275 - multimeval: new function, multiply a timeval by a constant integer
7276 - divtimeval: new function, divide a timeval by a constant integer
7279 - uconvert: new additional argument: EP. If non-null, it gets the
7280 address of the first non-digit that ends conversion (like strtod);
7281 we try to do as much of the conversion as possible if EP is set so
7282 the caller can clean up
7286 examples/loadables/mkfifo.c
7287 - mkfifo: new loadable builtin
7292 - make_local_variable: make sure local variables that have the same
7293 names as variables found in the temporary environment are marked as
7294 local. From Grisha Levit <grishalevit@gmail.com> back in 12/2018
7299 - restore_sigmask: function to restore top-level signal mask using
7302 {sig,eval,jobs,nojobs}.c
7303 - replace calls to sigprocmask with restore_sigmask(); remove extern
7304 declarations of top_level_mask
7307 - initialize_shell_signals: if SIGCHLD is blocked at shell startup,
7308 not only remove it from top_level_mask but make sure it's unblocked
7311 - execute_pipeline: if lastpipe is enabled and we're executing the
7312 rightmost pipeline element in the current shell, make sure to unblock
7313 SIGCHLD before calling execute_command, in case `return' or `exec'
7314 is run and that call doesn't return. From a report by
7315 Harald van Dijk <harald@gigawatt.nl> following up to a report
7316 by Martijn Dekker <martijn@inlv.org>
7321 - trap_builtin: in posix mode, when trap is run with -p, show
7322 the disposition of all signals, even those that are still in the
7323 default state, including signals that were ignored when the shell
7324 starts up and haven't been reset. Don't do it in default mode.
7325 From an austin-group discussion back in April, 2019 (interp 1211)
7328 - search_for_command: don't add commands without the execute bit set
7329 to the command hash table. From https://savannah.gnu.org/patch/?9789
7330 contributed by michaeljs1990
7335 - strlong: require `base#' to be followed by an integer constant;
7336 otherwise throw an error. From a report from Jeremy Townshend
7337 <jeremy.townshend@gmail.com> back in June, 2019
7340 - unary_test: allow -v N to test whether or not positional parameter
7341 N is set. Most recently suggested by Peng Yu <pengyu.ut@gmail.com>
7342 and Martijn Dekker <martijn@inlv.org>
7344 builtins/getopts.def
7345 - dogetopts: use number_of_args() to compute the number of positional
7348 {findcmd,variables,subst,trap,sig}.h,builtins/common.h
7351 builtins/shift.def,builtins/common.c
7352 - shift_builtin: moved code that modifies dollar_vars and rest_of_args
7353 to common.c:shift_args(int times), part of move to localize changes
7354 to positional parameters
7356 builtins/common.c,variables.c
7357 - posparam_count: keep a running count of the number of posititional
7358 parameters when dollar_vars and rest_of_args are set
7363 - number_of_args: just return posparam_count
7366 - shift_builtin: if asked to clear the positional parameters with
7367 something like `shift $#', just call clear_dollar_vars instead of
7368 iterating through them, unsetting them one by one
7370 subst.[ch],builtins/common.[ch]
7371 - number_of_args: moved to builtins/common.c
7376 - clear_fifo_list: when using named pipes, clear out the FIFO list
7377 without unlinking anything and set NFIFO to 0
7380 - execute_disk_command: in the child, clear out the FIFO list, since
7381 we haven't created any FIFOs yet
7382 - execute_in_subshell: clear out the FIFO list, since we haven't
7383 created any FIFOs yet
7386 - special_case_tokens: allow `time -- command'
7391 - get_var_and_type: if an unset variable (not an array) is supplied
7392 with the `[@]' subscript, don't return "". Fix to bug reported by
7393 Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>;
7394 original bug introduced 7/29/2018
7395 - array_transform: take a STARSUB argument instead of VARNAME, since
7396 we've already computed what kind of index the array reference uses
7397 in get_var_and_type, and passing VARNAME to figure out the index
7398 type doesn't do the right thing when we're using indirect variable
7399 expansion. Fixes bug reported by
7400 Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
7401 - array_remove_pattern: take the same new STARSUB argument for the
7403 - parameter_brace_transform,parameter_brace_remove_pattern: change
7404 callers to pass STARSUB instead of VARNAME
7409 - fix_assignment_words: if an assignment is supplied to a builtin that
7410 creates or modifies local variables while a function is executing,
7411 set the W_FORCELOCAL flag for that word in addition to any of the
7412 various assignment flags
7415 - shell_expand_word_list: while processing a list of assignments that
7416 are arguments to a builtin that creates or modifies local variables,
7417 if make_internal_declare fails while attempting to create the local
7418 variable (or give it attributes), skip attempting the assignment but
7419 otherwise do not make this a fatal error. This results in two error
7420 messages: one to create the variable or modify its attributes, and
7421 one while attempting to assign the value, but the errors to not
7422 cause the function to return immediately. Fixes inconsistency
7423 reported by Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
7429 - first_pending_trap: generalize into first_pending_trap and
7433 - wait_builtin: close up the trapped-signal-arrives hole a little more
7434 by looking for a signal that arrived between the last check for
7435 pending traps and setting wait_intr_flag and behaving as if it
7436 arrived while wait was executing. Use first_pending_trap and
7437 next_pending_trap to find a pending trap that is not SIGCHLD
7440 - trap_handler: longjmp to wait_intr_buf unconditionally if
7441 wait_intr_flag is set; don't bother with interrupt_immediately any
7445 - all_local_variables: now takes an arg saying whether to restrict
7446 return value to visible variables or return all local variables,
7447 even those that are unset (the new default)
7448 - visible_variable_in_context: new function, restricts return values
7449 to set local variables in the current context; variable_in_context
7450 now returns all local variables in the current context, even the
7454 - all_local_variables: change extern function declaration
7456 builtins/setattr.def
7457 - show_local_var_attributes: show all local variables at the current
7458 variable context, including unset ones, and their attributes
7459 - show_localname_attributes: show attributes for NAME as long as NAME
7460 resolves to a local variable at the current variable context, even
7464 - show_local_var_attributes, show_localname_attributes: new extern
7467 builtins/declare.def
7468 - declare_internal: allow `-p' option for `local' builtin
7469 - declare_internal: if `local' is supplied without options, or with
7470 the `-p' option, but no variable name arguments, display all local
7471 variables at the current variable context by calling
7472 show_local_var_attributes
7473 - declare_internal: if `local -p' is supplied with variable name
7474 arguments, call show_localname_attributes to display the attributes
7475 for that name if it resolves to a local variable at the current
7476 variable context. Fixes issue reported by
7477 pepa65 <solusos@passchier.net>
7480 - array_var_assignment: if VAR is unset, print the declare command
7481 without the assignment statement, just with the attributes
7482 - array_transform: special-case the 'a' attribute and return the
7483 attribute string even if the array variable is unset. Feature request
7484 from Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
7485 - parameter_brace_transform: if asked to display the attributes and
7486 value ('A') of an unset variable, make sure we pass the variable, if
7487 it exists with attributes but without a value, to string_transform
7488 - string_transform: if we don't have a value but the operator is 'A',
7489 pass the variable through to string_var_assignment
7490 - string_var_assignment: if we have an unset variable with attributes,
7491 return a declare command that just sets the attributes. Feature request
7492 from Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
7497 - mblen: don't try to use unless HANDLE_MULITBYTE is defined. From
7498 https://savannah.gnu.org/support/?110200
7499 - set_default_locale: if HAVE_SETLOCALE isn't defined, set the default
7505 - interrupt_immediately: remove all references to this that are
7506 already commented out
7511 - push_var_context,push_posix_tempvar_internal: assignment statements
7512 preceding shell functions no longer persist after the function
7513 completes in posix mode. POSIX interp #654, was in P1003.1-2017
7514 - push_posix_temp_var: variable assignments preceding special builtins
7515 now act as if an assignment statement had been executed in posix mode
7516 (the Posix `current execution environment') instead of unconditionally
7517 creating a global variable
7520 - clear_pending_traps: new function, just clears the pending traps flag
7526 - execute_in_subshell: check for interrupts and terminating signals
7527 before resetting the terminating signal handlers, and clear all
7528 pending traps -- they're not pending for us and we should not run a
7529 trap handler for them
7530 - execute_in_subshell: enable bush-5.1 change from 11/29/2018 that
7531 resets the signal-in-progress flag if we're running a command in
7532 a subshell, since we're not running the trap command (we are the
7538 - parameter_brace_expand: if we assign the empty string to a variable
7539 using the [:]= expansion in a quoted expansion, make sure we note
7540 we are returning a quoted null string to the caller by setting
7541 W_HASQUOTEDNULL. Fixes bug reported by Martin Castillo
7542 <castilma@uni-bremen.de>
7546 lib/readline/histfile.c
7547 - history_truncate_file: only chown the file if we really need to. From
7548 alex@lisas.de via https://savannah.gnu.org/support/?110207
7551 - rl_unbind_function_in_map: since we are looking for functions, not
7552 key sequences, descend into keymaps attached to the keymap passed
7553 as an argument. From a report from lockywolf@gmail.com back on 2/27,
7557 - MKLOC_ARRAYOK,MKLOC_ASSOCOK: new flags values for
7558 make_local_{array,assoc}_variable so we can avoid hard-coded values
7559 of 1 and make it possible to eventually pass in additional flags
7561 builtins/declare.def
7562 - declare_internal: make_local_array_variable: pass MKLOC_ASSOCOK
7563 - declare_internal: make_local_assoc_variable: pass MKLOC_ARRAYOK
7566 - make_local_{array,assoc}_variable: understand new flags, pass
7567 MKLOC_INHERIT to make_local_variable if it appears in the flags
7570 builtins/declare.def
7571 - declare_internal: add a new -I option for local and declare that
7572 inherits attributes and value from a variable with the same name
7573 at a previous scope. Inspired by netbsd sh
7574 - if -I option is supplied, pass MKLOC_INHERIT to make_local_variable
7575 and its array counterparts make_local_{array,assoc}_variable
7578 - shell_expand_word_list: pass -I to declare if constructing a declare
7579 command with make_local_declare, meaning we have an array or assoc
7580 compound assignment. (Slighty unsatisfactory, but ok for now) Fix
7581 for bug report from Kevin Locke <kevin@kevinlocke.name>,
7582 https://savannah.gnu.org/support/index.php?109669
7586 examples/loadables/basename.c
7587 - basename_builtin: handle -- option without crashing. Report by Peng Yu
7588 <pengyu.ut@gmail.com>
7591 - notify_of_job_status: if in posix-mode shell is started with -c,
7592 jobs should print the status of completed jobs. From a report by
7593 Robert Elz <kre@munnari.oz.au> back in 12/18
7598 - assign_in_env: if we're assigning POSIXLY_CORRECT or POSIX_PEDANTIC
7599 in the temporary environment, save the values of the options
7600 affected by posix mode so we can restore them when we restore the
7601 old value of the variable after the command executes. Suggested by
7602 Martijn Dekker <martijn@inlv.org>
7607 - slashify_in_here_document: add `"' to this list, since POSIX says
7608 that backslashes in here documents behave like backslashes in
7609 double quotes, and backslash can quote a double quote in a double-
7610 quoted string. This means that given P=A,
7620 should output the same thing. From a report from Dan Jacobson
7621 <jidanni@jidanni.org> back in 1/2019.
7626 - string_transform: add `U' (convert to uppercase), `u' (convert
7627 first character to uppercase), and `L' (convert to lowercase)
7628 transformations. Inspired by a discussion with Phil Smith
7629 <phil@philsmith.com> back in May, 2019
7630 - parameter_brace_transform: make sure `u', `U', and `L' are valid
7633 doc/{bush.1,bushref.texi}
7634 - parameter transformation: document new `U', `u', and `L' operators
7637 - execute_prompt_command: if an array variable PROMPT_COMMANDS exists,
7638 prefer it to PROMPT_COMMAND and execute all of the commands contained
7639 as array elements in index order. From a proposal by Daniel
7640 Colascione <dancol@google.com> back in 1/2018
7641 - execute_array_command: function for array_walk to use when executing
7642 commands in PROMPT_COMMANDS
7644 doc/{bush.1,bushref.texi}
7645 - PROMPT_COMMANDS: new array variable
7650 - new -R option, for RLIMIT_RTTIME (max time a real-time process can
7651 run without blocking). Patch from Maciej Wolny
7652 <maciekwolny123@gmail.com> back in 7/2017
7654 doc/{bush.1,bushref.texi}
7655 - ulimit: document new -R option
7657 lib/readline/{display.c,rlprivate.h}
7658 - _rl_clear_screen: now takes an argument saying whether to attempt to
7659 clear the terminal scrollback buffer if the right termcap capability
7662 lib/readline/{text.c,readline.h}
7663 - rl_clear_display: new bindable command that clears the screen and
7666 lib/readline/funmap.c
7667 - clear-display: new bindable command name
7669 lib/readline/emacs_keymap.c
7670 - emacs mode M-C-l now bound to clear-display
7672 doc/bush.1,lib/readline/doc/{readline.3,rluser.texi}
7673 - clear-display: document new function and default emacs mode binding
7676 - assign_assoc_from_kvlist: allow compound assignments to associative
7677 arrays that do not contain words of the form `[key]=value', assume
7678 such lists are of the form (key1 value1 key2 value2). A missing or
7679 empty key is an error; a missing value is treated as NULL. You
7680 cannot mix the two forms. Inspired by a suggestion from Sebastian
7681 Gniazdowski <sgniazdowski@gmail.com> back in 7/2019
7683 doc/{bush.1,bushref.texi}
7684 - documented new associative array assignment syntax
7687 - assoc_to_kvpair: new function that returns a string with quoted
7688 key/value pairs from given associative array
7691 - array_to_kvpair: new function that returns a string with quoted
7692 key/value pairs from given indexed array (for completeness)
7695 - parameter_brace_transform: new operator `K': produces the (possibly
7696 quoted) value of a variable, except for arrays, where it expands to
7697 indexed or associative array assignments in key/value pair form
7698 - string_transform,parameter_list_transform: expand `K' to (possibly
7700 - array_var_assignment: take a new fourth argument saying which kind
7701 of assoc assignment statement to produce; calls array_to_kvpair or
7702 assoc_to_kvpair as appropriate and just returns that value if
7703 necessary without creating a declare command
7704 - array_transform: if the operator is `K', call array_var_assignment
7705 with new argument that will produce a list of key/value pairs
7707 doc/{bush.1,bushref.texi}
7708 - document new 'K' parameter transformation operator
7712 doc/bush.1,lib/readline/doc/{history.3,readline.3}
7713 - some text and formatting cleanups from Bjarni Ingi Gislason
7714 <bjarniig@rhi.hi.is>
7717 - SYSLOG_MAXLEN: increase to 1024, since that seems to be what most
7718 syslog daemons handle
7719 - bush_syslog_history: if the line is longer than SYSLOG_MAXLEN minus
7720 the header length, log it in multiple message with a sequence number
7721 instead of truncating. Inspired by a report from
7722 <sunhuilin@unionpay.com> back in 7/2018
7725 - rl_activate_mark,rl_deactivate_mark,rl_mark_is_active_p,
7726 rl_keep_mark_active: new functions to manage an active region. We
7727 don't do anything with an active region yet. Part of a large patch
7728 for active regions from Daniel Colascione <dancol@google.com>
7729 originally back in 3/2018
7730 - rl_clear_screen: call rl_keep_mark_active to keep the region active
7731 across the screen refresh
7732 - rl_newline: make sure to deactivate the region even though we don't
7733 do any redisplay with it yet
7735 lib/readline/readline.h
7736 - rl_activate_mark,rl_deactivate_mark,rl_mark_is_active_p,
7737 rl_keep_mark_active: new extern function declarations. They are
7738 public functions for now
7740 lib/readline/readline.c
7741 - readline_internal_setup: make sure the region starts out as not
7743 - readline_internal_charloop: make sure to deactivate the mark after
7744 a command, unless the command calls rl_keep_mark_active keep it
7748 - rl_bracketed_paste_begin: set rl_mark before inserting the pasted
7749 text, so the pasted text defines the region
7750 - rl_bracketed_paste_begin: set the region as active after inserting
7754 - _rl_abort_internal: make sure we deactivate the region
7756 lib/readline/{terminal.c,rlprivate.h}
7757 - _rl_cr: new function to just output the term_cr (or '\r'). Part of
7758 the active region patch
7760 lib/readline/display.c
7761 - _rl_cr: use where appropriate to replace MSDOS-dependent code and
7764 lib/readline/terminal.c
7765 - get and store the terminal sequences to enter and exit standout
7766 (usually some background color) mode
7771 - copy_fifo_list: now returns void *
7772 - close_new_fifos: now takes a void * as the first argument, since it's
7773 usually the return value from copy_fifo_list
7774 - close_new_fifos: (named pipes): cast first argument to a char *,
7775 since copy_fifo_list will (someday) return a bitmap
7776 - close_new_fifos: (HAVE_DEV_FD): cast first argument to a pid_t *,
7777 since it takes a copy of dev_fd_list; use that in the loop to
7778 determine whether or not to close file descriptors. First half of
7779 fix for bug reported by Valentin Lab <valentin.lab@kalysto.org>
7780 - unlink_fifo_list: (named pipes): when compacting the list, make sure
7781 to avoid the copy if i == j, and, after copying fifo_list[i] to
7782 fifo_list[j], null out fifo_list[i] so we don't try to access it
7786 - execute_command_internal: don't call reap_procsubs after executing
7787 the command. Rest of fix for bug reported by Valentin Lab
7788 <valentin.lab@kalysto.org>
7789 - execute_command_internal,execute_builtin_or_function: ofifo_list is
7790 now a void * instead of a char *
7794 lib/readline/{terminal.c,rlprivate.h}
7795 - _rl_standout_{on,off}: new functions, to enter and exit terminal
7798 lib/readline/rlprivate.h
7799 - _rl_refresh_line: new extern declaration
7801 lib/readline/display.c
7802 - visible and invisible lines: added members to deal with tracking the
7804 - realloc_line: broke code to manage visible_line and invisible_line
7805 allocation out of init_line_structures, added code to manage arrays
7806 of visible and invisible line face info per character
7807 - invis_{addc,adds,nul}: new functions to add characters to the
7808 invisible line and keep the invisible face data updated with whatever
7810 - set_active_region: keep track of the display region that should be
7812 - rl_redisplay: use invis_addc/adds/nul to update the invisible line
7813 buffer instead of modifying invisible_line directly
7814 - _rl_refresh_line: moved body of function here from text.c
7817 - rl_refresh_line: now just calls _rl_refresh_line and marks the display
7823 - bind_variable_internal: dynamic variables with assignment functions
7824 now honor the readonly attribute by giving an error. Fixes issue
7825 reported by Rob Landley <rob@landley.net>
7826 - assign_seconds: allow seconds to be assigned using an arithmetic
7828 - assign_random: allow RANDOM to be assigned using an arithmetic
7831 doc/{bush.1,bushref.texi}
7832 - HISTCMD: note that assignments to HISTCMD have no effect
7837 - execute_in_subshell: make sure we note that we're not reading our
7838 command input from a buffered stream any more, so we don't
7839 sync the buffered stream backwards in subsequent commands this
7840 subshell runs. Fixes bug reported by OÄuz <oguzismailuysal@gmail.com>
7845 - read_builtin: if a read in posix mode is interrupted by a signal,
7846 make sure to preserve the value of errno around calls to
7847 check_signals and run_pending_traps so any error message isn't quite
7848 as confusing. Issue reported by Stan Marsh <gazelle@xmission.com>
7851 - zread: preserve value of errno (always EINTR) around calls to
7852 check_signals or check_signals_and_traps
7855 - run_debug_trap: allow suppress_debug_trap_verbose being set to
7856 turn off `set -v' temporarily while executing the DEBUG trap (if
7860 - set suppress_debug_trap_verbose so set -v won't be in effect while
7861 the DEBUG trap runs. Most recently reported by Ami Fischman
7862 <ami@fischman.org>; originally raised by Boruch Baum
7863 <boruch_baum@gmx.com> back in 10/2017
7867 lib/readline/display.c
7868 - puts_face,putc_face: new functions to write strings or characters to
7869 the display while handling standout mode
7870 - update_line,_rl_move_cursor_relative: take additional argument(s)
7871 describing the visible and invisible faces corresponding to the
7872 visible and invisible lines, respectively
7874 lib/readline/readline.c
7875 - _rl_enable_bracketed_paste: for the time being, initialize to 1 (on
7879 - run_interrupt_trap: set pending_sigs[SIGINT] and catch_flag to 0
7880 since run_pending_trap usually does these things
7883 - throw_to_top_level: only call the SIGINT trap if there is a SIGINT
7884 trap pending (shouldn't matter, just a check)
7887 - bush_event_hook: try to identify the signal of interest we've
7889 - bush_event_hook: if in posix mode running the read builtin, and we
7890 get a (trappped) SIGINT, throw to top level so we can interrupt
7891 the read. From a report by Robert Elz <kre@munnari.oz.au>
7895 lib/readline/display.c
7896 - update_line: make sure to update and compare face data at the same
7897 time as comparing old and new line data: the lines are only the same
7898 if the face information and character information are identical
7900 - update_line: make sure to copy face data along with line data
7901 - update_line: use puts_face in place of _rl_output_some_chars to
7902 output face data along with line data
7903 - _rl_move_cursor_relative: when we write characters, make sure to take
7904 the face data into account using puts_face
7905 [END OF INTEGRATION OF ACTIVE MARK AND FACE PATCHES from
7906 Daniel Colascione <dancol@google.com>]
7909 - make_child: to avoid installing a handler for SIGTERM in interactive
7910 shells, and avoid race conditions with child processes resetting the
7911 SIGTERM signal handler to the default, block SIGTERM and then
7912 reset the SIGTERM handler to SIG_DFL before fork, then reset the
7913 handler to SIG_IGN and unblock it in the parent after fork() returns.
7914 Fix for readline and SIGTERM handling reported by Chris Down
7915 <chris@chrisdown.name> (original change was back in 2/2013) that
7916 allows a bush waiting in readline() for input to be killed with a
7917 SIGTERM sent by another process
7918 - take out calls to RESET_SIGTERM, no longer needed
7921 - execute_in_subshell,execute_simple_command,execute_disk_command:
7922 remove calls to CHECK_SIGTERM, since we don't install a handler
7925 lib/readline/readline.c
7926 - _rl_enable_bracketed_paste: enabled by default for the time being
7931 - JWAIT_WAITING: new flag for wait functions; means only wait for jobs
7932 with the J_WAITING flag set
7933 - J_WAITING: new job flag, part of arg list to `wait -n'
7934 - IS_WAITING(i): job i has the J_WAITING flag set
7937 - wait_for_any_job: if the flags includes JWAIT_WAITING, we only return
7938 jobs with the J_WAITING flag already set; otherwise we skip them.
7939 For `wait -n args' support
7942 - set_waitlist: take a list of jobspecs and set the J_WAITING flag in
7943 each valid job from the list
7944 - unset_waitlist: turn off the J_WAITING flag for all jobs where it's
7946 - wait_builtin: if -n is supplied with a list of arguments, set the
7947 J_WAITING flag in each job in the list, call wait_for_any_job with
7948 the JWAIT_WAITING flag, and clean up by calling unset_waitlist().
7949 From a suggestion from Robert Elz <kre@munnari.oz.au> back in 3/2019
7950 (originally in 10/2017)
7954 lib/readline/display.c
7955 - update_line: in step 5b of the line wrapping prompt code, make sure
7956 OFDF and NFDF are set before performing a dumb update
7961 - termsig_handler: make sure to restore TOP_LEVEL_SIGMASK before
7962 resending a terminating signal to ourselves, in the event that this
7963 is called in a signal handler context with the terminating signal
7964 blocked. Inspired by a report from <gentoo_eshoes@tutanota.com>
7970 - rl_newline: if the region is active, call rl_redisplay to clear
7971 standout mode before returning
7973 lib/readline/display.c
7974 - norm_face: new function to mark a portion of the invisible face
7975 buffer as normal text (no standout)
7976 - rl_redisplay: if the line consumes more than a screen's worth of
7977 lines, mark the lines that are off the top of the display as having
7983 - LINENO: no longer has the integer attribute, since it does not take
7984 arithmetic expressions on assignment (use $((expr)) instead)
7986 lib/readline/mbutil.c
7987 - _rl_find_prev_utf8char: new function, uses the structure of UTF-8
7988 characters to find the start of the previous one no matter where we
7989 start: at the beginning of the next character, at the end of a
7990 multibyte character, or in the middle of a multibyte character.
7992 - _rl_find_prev_mbchar_internal: for now, call _rl_find_prev_utf8char
7993 if we are in a UTF-8 locale. EXPERIMENTAL
7997 lib/readline/mbutil.c
7998 - _rl_utf8_mblen: changes to handle invalid multibyte sequences better,
7999 even when N means that the sequence would be too short anyway
8001 examples/loadables/csv.c
8002 - csv: new loadable builtin to parse a line of csv data and store it
8003 into an array supplied as an argument
8007 examples/loadables/cut.c
8008 - cut: new loadable builtin
8009 - lcut: new builtin that does what cut does but on a string supplied
8010 as an argument (only one string for now)
8015 - FORK_SYNC,FORK_ASYNC,FORK_NOJOB: new flag values for the second
8016 argument to make_child
8019 - make_child: now takes a set of flags as the second argument
8022 - make_child: change callers to pass FORK_ASYNC instead of a non-zero
8023 value as the second argument
8026 - make_child: change callers to pass FORK_ASYNC instead of a non-zero
8027 value as the second argument
8029 doc/{bush.1,bushref.texi}
8030 - document that the words in a compound array assignment undergo all
8031 the shell word expansions, including filename generation and word
8032 splitting. From a report from E. Choroba <choroba@matfyz.cz>
8037 - command_substitute: use JOB_CONTROL instead of INTERACTIVE in the
8038 test to determine whether or not to give the terminal back to
8042 - make_child: if FORK_NOTERM is set in the flags argument, don't call
8045 {jobs,nojobs}.c,jobs.h
8046 - wait_for: now takes a second argument, a flags word
8048 {execute_cmd,subst}.c
8049 - wait_for: change all callers to add second argument to wait_for
8052 - wait_for: if JWAIT_NOTERM is set in the flags argument, don't call
8058 - command_substitute: block SIGINT around call to read_comsub, so we
8059 let any interrupts affect the command substitution. Fixes issue
8060 reported by DALECKI Léo <leo.dalecki@ntymail.com>
8063 - FILENAME_HASH_BUCKETS: increase to 256
8066 - ASSOC_HASH_BUCKETS: new define, set to 1024
8069 - make_new_assoc_variable,make_local_assoc_variable: call assoc_create
8070 with ASSOC_HASH_BUCKETS as argument. This changes the hash function
8071 and how the array keys are ordered (which is not guaranteed)
8074 - read_builtin: in posix mode, or if the read call returns -1/EINTR,
8075 don't call run_pending_traps until the read command returns. This
8076 allows a trap action to see the same exit status that the read
8077 builtin would return when it exits on a signal (e.g., SIGINT == 130).
8078 From a suggestion by <gentoo_eshoes@tutanota.com>
8083 - hash_rehash: function to rehash a table, after increasing or decreasing
8084 the number of buckets. From patches from Thomas Kremer
8085 (https://savannah.gnu.org/patch/?9850) and Koichi Murase
8086 <myoga.murase@gmail.com>
8087 - hash_grow,hash_shrink: grow or shrink a hash table by a factor of
8088 HASH_REHASH_MULTIPLIER (4)
8089 - hash_insert,hash_search: call hash_grow if necessary
8092 - convert_var_to_{array,assoc}: if the original variable had no value
8093 (it was unset), the array variable should be unset as well. Reported
8094 by andrej@podzimek.org
8099 - set_saved_history: change logic used to decide where in the history
8100 operate_and_get_next should start by using a logical offset into the
8101 history list that is an offset from history_base. This avoids having
8102 to take whether or not the history is stifled and full into account.
8103 Report and fix from Greg Price <gnprice@gmail.com>
8104 - operate_and_get_next: just calculate the logical offset of where we
8105 should be in the history instead of an absolute offset
8107 lib/readline/input.c
8108 - _rl_nchars_available: new function, returns the number of characters
8109 available to be read if FIONREAD is available
8113 lib/readline/{readline.c,rlprivate.h}
8114 - _rl_pending_command: new struct to hold information about a pending
8115 command for readline to execute when the current command completes.
8116 A command can set this up so that it gets executed like a
8117 continuation before redisplay
8119 lib/readline/readline.c
8120 - readline_internal_charloop: after _rl_dispatch returns, check
8121 _rl_command_to_execute, and, if it's non-zero, redisplay and then
8122 execute it as a command
8123 - added a small set of library-private functions for managing the
8124 executing key sequence (not used yet)
8126 lib/readline/isearch.c
8127 - _rl_isearch_dispatch: if we have found an opcode or have added a
8128 character to the search string and searched for it, reset the keymap
8129 and okeymap members of the search context in preparation for reading
8130 another key sequence/opcode
8131 - _rl_isearch_dispatch: if we read a key sequence bound to an editing
8132 command that is not an `opcode', set up _rl_command_to_execute to
8133 execute it after the searching returns and arrange to break out of
8135 - _rl_isearch_dispatch: if we paste in text from bracketed paste, set
8136 the mark as active so we can highlight it when we display the search
8138 - _rl_isearch_dispatch: if we've found the search string, activate the
8139 mark and set rl_point and rl_mark so the search string is highlighted
8140 when we display the search results
8141 - _rl_isearch_dispatch: do translation for keys that map to
8142 rl_do_lowercase_version like we do when dispatching while reading a
8147 lib/readline/isearch.c
8148 - _rl_isearch_dispatch: if bracketed paste mode is enabled and there are
8149 enough characters waiting in the terminal's input queue, try to read
8150 the bracketed paste prefix and jump straight to the opcode execution
8151 if we read it. Otherwise, just go on with the ESC. Inspired by report
8152 from <gentoo_eshoes@tutanota.com>
8155 - parse_comsub: posix-mode shells don't allow a closing right paren to
8156 delimit a pending here-document -- it requires the newline
8159 - POSIX mode: updated posix mode description with the new here-document
8160 delimiter requirement
8162 lib/readline/search.c
8163 - _rl_nsearch_dispatch: if bracketed paste mode is enabled, and we read
8164 an ESC, try to see if we have a bracketed paste op and insert the
8165 pasted next. If we don't, go on with the ESC
8166 - _rl_nsearch_dosearch: experimental code to highlight the search string
8167 when displaying the line found in the history. Only done when we are
8168 not searching for a pattern, since we don't have information on the
8169 end of the matching portion of the line. Experimental because it
8170 changes where we put point and mark if searching is successful
8173 - expr_streval: if find_variable for the case where the string is not
8174 an array reference doesn't find anything, see if we can find
8175 something by using find_variable_last_nameref and use the value
8176 from there in the call to expr_streval, kind of using the expression
8177 recursion to complement the nameref recursion. Report from
8178 Daniel Molina <lluvia@autistici.org>
8183 - {start,stop}_pipeline: don't reset pipeline_pgrp to 0 if it's already
8184 the same as shell_pgrp, since we don't want to reset it in the middle
8185 of a shell started to run a command or process substitution (after
8186 forking a child to run one command, but before forking another, for
8187 instance). Reported by Rob Landley <rob@landley.net>
8192 - function_def: break the productions starting with `function' without
8193 `()' into two productions to avoid a shift-reduce conflict. Report
8194 and patch from Dale R. Worley <worley@alum.mit.edu>
8197 - localvar_inherit: add extern declaration here
8200 - shell_expand_word_list: take out change from 3/17 to pass -I to
8201 make_internal_declare; it generates errors the user will find
8202 confusing if there is a variable with the same name but a different
8203 type at a previous scope
8204 - shell_expand_word_list: check for and note whether or not -I is
8205 supplied to the declaration command, since it changes the default
8206 behavior of a compound assignment without -a or -A
8207 - shell_expand_word_list: if we have a compound assignment that is an
8208 argument to a declaration command, but there are no options supplied
8209 to the command that determine the type of the array, make sure we
8210 call make_internal_declare with either -a (no localvar_inherit or -I)
8211 or at least -- (if we are inheriting), because we don't want the
8212 declare to get skipped before we perform the word assignment. Fixes
8213 bug reported by Ross Goldberg <ross.goldberg@gmail.com>
8218 - expand_declaration_argument: new function, broke code that handles
8219 compound assignments that are arguments to declaration commands out
8220 of shell_expand_word_list into this function. No functional change
8226 - expand_compound_assignment_word: helper function for
8227 expand_declaration_argument: takes NAME[+]=( VALUE ), converts VALUE
8228 to a list of words, then single-quotes each word and reconstructs
8229 the original word. This assumes the result will go to
8230 do_word_assignment, which will remove the single quotes
8231 - expand_oneword: helper function for expand_compound_assignment_word,
8232 takes VALUE and performs the splitting into words, and then the
8233 expansion and single-quoting of each individual word. Indexed and
8234 associative arrays take different code paths, because they undergo
8235 different expansions and associative arrays need special handling to
8236 avoid having to scan for the end of the subscript multiple times
8237 - expand_declaration_argument: call expand_compound_assignment_word to
8238 get the expansion-before-calling-builtins word expansion sequence
8239 correct. Better fix for for bug report from Kevin Locke
8240 <kevin@kevinlocke.name>,
8241 https://savannah.gnu.org/support/index.php?109669
8244 - quote_array_compound_word: take [IND]=VALUE and convert it to
8245 ['IND']='VALUE'. Called by quote_compound_array_list for each word
8247 - expand_and_quote_assoc_qword: take [KEY]=VALUE and convert it to
8248 ['expanded-key']='expanded-value' (or VALUE to 'expanded-value').
8249 Called by subst.c:expand_oneword() for each word in the list
8250 - quote_compound_array_list: take a list of words and convert each
8251 [IND]=VALUE to ['IND']='VALUE' (or just 'VALUE' if there is no
8252 [IND]=). Used for indexed arrays
8255 - expand_and_quote_assoc_word,quote_compound_array_list: new extern
8260 doc/{bushref.texi,bush.1}
8261 - rework description of reserved words a little; add a reserved words
8262 node to bushref.texi. Based on a report from Dale R. Worley
8263 <worley@alum.mit.edu>
8265 builtins/history.def
8266 - history_builtin: if the shell is restricted, don't allow pathnames
8267 with slashes to be read or written. From a report from
8271 - maybe_make_restricted: add HISTFILE to the list of readonly variables
8273 doc/{bushref.texi,bush.1}
8274 - document new restricted shell restrictions
8279 - wait_for: don't try to give the terminal to shell_pgrp if JWAIT_NOTERM
8280 is set in the flags argument
8283 - command_substitute: call make_child with FORK_NOTERM flag so it
8284 doesn't try to set the terminal's process group
8285 - command_substitute: call wait_for with JWAIT_NOTERM so it doesn't
8286 try to set the terminal's process group
8287 - command_substitute: now that wait_for doesn't try to reset the
8288 terminal's process group, remove the code that tries to clean up
8294 - make sure to mention /etc/inputrc as the ultimate default readline
8295 init file, like other documentation does. Update from
8296 Greg Price <gnprice@gmail.com>
8298 lib/readline/readline.c
8299 - if the private startup hook function variable _rl_internal_startup_hook
8300 is set, execute that after any user-specified startup hook
8302 lib/readline/rlprivate.h
8303 - _rl_internal_startup_hook: new extern declaration
8305 bushline.c,lib/readline/{misc.c,readline.h}
8306 - operate_and_get_next: moved to rl_operate_and_get_next so it's
8307 available to all readline programs, uses _rl_internal_startup_hook.
8308 Based on patch from Greg Price <gnprice@gmail.com>
8310 lib/readline/funmap.c
8311 - "operate-and-get-next": now a bindable readline command
8313 lib/readline/emacs_keymap.c
8314 - rl_operate_and_get_next: bound to ^O in emacs mode by default
8316 doc/bush.1,lib/readline/{readline.3,rluser.texi}
8317 - operate-and-get-next: move to readline section of the manuals, out of
8318 bush-specific functions section
8323 - hash_string: use a series of shifts and adds to avoid a multiply by
8324 FNV_PRIME. From Landon Curt Noll's FNV web page
8327 - fc_gethist,fc_gethnum: now take an additional argument indicating the
8328 operating mode: if the arg is 1, fc is listing commands; if it is 0,
8329 fc is executing commands. Affects how -0 is handled (fc_gethnum
8330 returns -1). Changed callers to handle the return value appropriately.
8331 Report from Jason Franklin <jason.franklin@quoininc.com> about
8332 seg fault and core dump
8333 - fc_builtin: if fc_gethnum returns < 0 when setting histbeg or histend,
8334 report a range error
8336 doc/bush.1,lib/readline/doc/hsuser.texi
8337 - fc: document how 0 and -0 are treated for listing and executing
8340 - run_one_command: call parse_and_execute with SEVAL_RESETLINE so the
8341 line number gets set to 1. Reported by Rob Landley <rob@landley.net>
8345 support/config.{guess,sub}
8346 - update to latest versions
8349 - add support for `genode' from Emery Hemingway <ehmry@posteo.net>
8354 - term: fix case where an argument that looks like a unary operator,
8355 but doesn't have enough tokens left to have an argument to that
8356 operator, was not being treated as a one-argument test. Affects
8357 only uses of test with four and greater arguments, which posix says
8358 are unspecified. This is a bug, or at least an incompatibility, at
8360 - test_command: if there are unconsumed arguments, call test_syntax_error
8361 with a `syntax error' argument if the first remaining argument starts
8362 with a `-'. Better than a generic `too many arguments' error
8366 configure.ac,config.h.in
8367 - getrandom: add test, define HAVE_GETRANDOM
8368 - getentropy: add test, define HAVE_GETENTROPY
8371 - get_urand32: use getrandom; provide imperfect emulation that uses
8372 getentropy if available, and falls back to reading /dev/urandom if
8373 that's not available. The idea is to use /dev/urandom as little as
8379 - updated version to 5.1-alpha
8381 lib/readline/readline.h
8382 - updated defines to readline version 8.1
8385 - brand: if shell_compatibility_level is 50 or below, don't xor the
8386 top and bottom halves of the 32-bit random number together, since
8387 previous versions did not
8392 - overhauled and updated the descriptions of the various shopt compatNN
8396 - Shell Compatibility Mode: new section, describes compatibility levels,
8397 BUSH_COMPAT, and the various compatNN shopt options
8402 - added Shell Compatibility mode section
8404 doc/{bush.1,bushref.texi}
8405 - changed shopt section to list the compatibility options and refer
8406 to Shell Compatibility Mode section
8407 - BUSH_COMPAT: overhauled the text, refers to Shell Compatibility Mode
8412 variables.c,/lib/sh/random.c
8413 - moved functions that manage 16-bit and 32-bit random values to
8417 - add_alias: don't bother checking null alias values for ending in
8420 braces.c,include/typemax.h
8421 - move sh_imaxabs and overflow and underflow detection to typemax.h
8422 so the expression evaluation code can use it in the future
8427 - _rl_bracketed_read_mbstring: make sure to fill in mb[0] even if
8428 the locale says MB_CUR_MAX == 1 in case a caller uses it. Partial
8429 fix for bug reported by Phi Debian <phi.debian@gmail.com>
8431 lib/readline/vi_mode.c
8432 - rl_vi_change_char: make sure _rl_vi_last_replacement gets filled in
8433 in the case where MB_CUR_MAX == 1. Rest of fix for bug reported by
8434 Phi Debian <phi.debian@gmail.com>
8435 - _rl_vi_callback_change_char: same fix for _rl_vi_last_replacement
8441 - union mhead: now 16 bytes to force 16-byte alignment; extra 8 bytes
8442 at the end of struct minfo to use for guard bytes. Enabled if
8443 pointers are 64 bits (SIZEOF_CHAR_P == 8)
8444 - if we have 64-bit pointers, prepopulate the 64-byte bin first instead
8445 of the 32-byte bin (pointers and WORD_DESCs still fit into 32 bytes,
8446 but WORD_LISTs are now 36 bytes with malloc overhead). We can still
8447 split 64-byte blocks to satisfy 32-byte requests
8448 - internal_malloc: fill in the new 8 mh_magic8 bytes with MAGIC1 guard
8450 - internal_malloc: print a warning message if the returned pointer is
8451 not aligned according to MALIGN_MASK
8452 - internal_free: detect underflow by checking that mh_magic8 is full
8454 - internal_realloc: detect underflow by checking that mh_magic8 is full
8458 - _print_malloc_stats: slight adjustment for better column alignment
8463 - execute_command_internal: treat a redirection failure with errexit
8464 set as a command failure that exits the shell. Bug report from
8465 Hyunho Cho <mug896@naver.com>
8470 - redirection_error: takes a new argument, FN, which if non-NULL is
8471 the filename to be used in the error message.
8473 redir.[ch],builtins/evalstring.c
8474 - redirection_error: changed extern declaration and callers
8477 - do_redirection_internal: takes a new third parameter, FNP, a char **
8478 to use (*FNP, if non-NULL) to store and return the expanded filename
8479 for those redirections that take one
8480 - do_redirections: pass a char ** (&fn) to do_redirection_internal to
8481 get a pointer to the expanded filename; pass it to redirection_error
8482 if appropriate. Free FN in any case, since do_redirection_internal
8483 won't. Fix for double expansion of filename in certain redirections
8484 reported by OÄuz <oguzismailuysal@gmail.com>
8489 - parse_comsub: while we're reading a here-document, don't perform any
8490 history expansion (set history_expansion_inhibited). Fixes issue
8491 reported by "ladyrick" <ladyrick@qq.com>
8497 - shellstart: struct timeval used to initialize shell starting time;
8498 shell_start_time now initialized from shellstart.tv_sec
8501 - assign_seconds: reset shellstart to set shell starting time
8504 - include posixtime.h instead of <sys/time.h>
8506 lib/sh/{ufuncs,uconvert}.c
8507 - include posixtime.h instead of the inline conditional includes
8510 - BUSH_STRUCT_TIMEVAL: convert to use AC_COMPILE_IFELSE instead of the
8511 deprecated AC_HEADER_EGREP
8514 - struct timeval: if HAVE_TIMEVAL is not defined, provide a replacement
8517 lib/sh/gettimeofday.c
8518 - gettimeofday: replacement function, so we don't have to use
8519 HAVE_GETTIMEOFDAY in the rest of the code
8523 {lots of files}.[ch]
8524 builtins/{lots of files}.{c,h,def}
8525 lib/glob/{lots of files}.[ch]
8526 lib/malloc/{lots of files}.[ch]
8527 lib/sh/{lots of files}.c
8528 include/{lots of files}.h
8529 examples/loadables/{lots of files}.c
8532 doc/{bush.1,bushref.texi}
8533 - SECONDS: clarify that the number of seconds is always determined by
8534 querying the system clock
8539 - if CFLAGS is not supplied in the environment or on the command line,
8540 add the gcc options that suppress warnings about parens and print
8541 formats in a slightly different way that will avoid some collisions
8543 lib/readline/readline.c
8544 - _rl_dispatch_subseq: don't set rl_last_func to rl_vi_arg_digit, just
8545 the same as if it were rl_digit_argument. This allows functions like
8546 rl_yank_last_arg, which behave differently when called multiple times
8547 in a row, to work closer to what is expected. This allows what
8548 Leo Alekseyev <dnquark@gmail.com> reported to work, with caveats
8550 lib/readline/vi_mode.c
8551 - rl_vi_yank_arg: make sure to pass `key' to rl_yank_nth_arg, in case
8552 it needs to use it later
8553 - rl_vi_redo: suppress attempts to redo `.' when the current keymap is
8554 vi_movement_keymap, since that will recursively call vi_redo
8559 - limit HEREDOC_PIPESIZE to 4096 on FreeBSD; that is where it can
8560 handle atomic writes without hanging. Tested on FreeBSD 13
8562 [bush-5.1-alpha frozen]
8567 - do_assignment_internal: call stupidly_hack_special_variables on the
8568 name returned from the variable assignment, in case there was a
8569 nameref expansion, and on the original name only if the assignment
8570 returned NULL. Fixes bug reported by James D. Lin <jamesdlin@gmail.com>
8575 - hash_builtin: don't print anything if the hash table is empty when
8576 listing portably (-l) unless the shell compatibility level is <= 50
8577 Issue originally raised by <beluro@web.de>
8582 - glob_name_is_acceptable: extend GLOBIGNORE to ignore `.' and `..'
8583 as a terminal pathname component instead of just ignoring filenames
8584 that are `.' or `..'. From a suggestion by Ilkka Virta
8590 - MKINSTALLDIRS: deprecated, no longer in AM_INTL_SUBDIR, so we have
8591 to create the variable manually
8593 lib/readline/doc/rltech.texi
8594 - add descriptions of the active mark functions that are available to
8595 applications. I guess they will remain public
8598 - valid_parameter_transform: new function, reject transformations
8599 longer than a single character or invalid transformation operators
8600 - parameter_brace_transform: call valid_parameter_transform
8605 - lbuf: bump size up to ZBUFSIZ (default 4096). From a report by
8606 Jason A. Donenfeld <Jason@zx2c4.com>
8609 - zcatfd: lbuf: bump size up to ZBUFSIZ (default 4096)
8612 - zmapfd: lbuf: bump size up to ZBUFSIZ (default 4096)
8617 - BUSH_FUNC_SBRK: changes for cross-compiling on FreeBSD variants,
8618 from Jessica Clarke <jrtc27@jrtc27.com>
8621 - HAVE_SBRK: use #if instead of #ifdef so we only use it if we think
8624 examples/loadables/finfo.c
8625 - st_dev,st_nlink: cast to unsigned long, report from Jessica Clarke
8629 - unwind_protect_mem_internal: make sure we allocate at least as many
8630 bytes for an entire UNWIND_ELT. Fix from Jessica Clarke
8636 - alrm_catcher: use write(2) instead of fprintf to print the
8637 auto-logout message to the terminal
8640 - UNQUEUE_SIGCHLD: set queue_sigchld to 1 around call to waitchld(),
8641 since it is not being called from a signal handler and so SIGCHLD is
8642 not blocked. Fixes report by Godmar Back <godmar@gmail.com>
8646 doc/{bush.1,bushref.texi}
8647 - read: clarify that without any name arguments, the line assigned to
8648 REPLY is not modified. From a question by M. Nejat AYDIN
8649 <mnaydin@yahoo.com> with input from Eli Schwartz
8650 <eschwartz@archlinux.org>
8654 lib/readline/vi_mode.c
8655 - _rl_vi_done_inserting: make sure to close out all undo groups when
8656 leaving insert mode, so we don't have anything dangling.
8657 Report and fix from David Fries <David@Fries.net>
8661 lib/readline/vi_mode.c
8662 - _rl_vi_domove_motion_cleanup: the `c' and `C' commands should enter
8663 insert mode even if the motion command doesn't delete any text.
8664 From a report by David Fries <David@Fries.net>
8665 - _rl_vi_done_inserting: add a missing rl_end_undo_group when
8666 _rl_vi_doing_insert is set: there should be one begun by
8667 rl_vi_start_inserting and one begun by the command (change or replace).
8668 From a report by David Fries <David@Fries.net>
8669 - rl_vi_replace: set _rl_vi_last_key_before_insert to 'R' explicitly,
8670 since other code checks that and we want to allow users to rebind
8675 lib/readline/vi_mode.c
8676 - rl_vi_{delete,change,yank}_to: if we have a non-null _rl_vimvcxt,
8677 just reinitialize it so we don't have to allocate a new one. This is
8678 a change primarily for callback mode, and fixes a memory leak
8680 builtins/evalstring.c
8681 - optimize_shell_function: try to optimize away the fork in the last
8682 command in a shell function body, under certain conditions
8685 - execute_function: attempt to optimize away forks in a shell function
8686 that is already marked NO_FORK and being executed in a command
8691 {jobs,nojobs,trap,unwind_prot}.c,lib/malloc/{malloc,table}.c
8692 - interrupt_immediately: remove, no longer used
8695 - waitchld: don't perform asynchronous notification if we are currently
8696 executing a builtin (executing_builtin != 0). Inspired by a report
8697 from Godmar Back <godmar@gmail.com>
8701 lib/readline/signals.c
8702 - _rl_handle_signal: block SIGTTOU while handling a SIGTTOU, since we
8703 no longer run this in a signal handling context where SIGTTOIU would
8709 - execute_simple_command: use new variable `cmdflags' instead of using
8710 simple_command->flags directly; initialize from simple_command->flags
8711 - check_command_builtin: take a simple command list of words starting
8712 with `command' and including a command_word argument, and peel off
8713 the `command' and any instances of `-p' and `--' and return the
8715 - execute_simple_command: if the first word of the simple command is
8716 `command', call check_command_builtin to peel off any `command' and
8717 `-p' and `--' and go on to execute the rest of the words as a simple
8718 command. If we're in posix mode, we've got the special builtins
8719 handled before this runs. Fixes complaint about `command' in the
8720 background running an extra bush process from Dmitry Alexandrov
8726 lib/readline/doc/{rltech,hstech,rluser}.texi
8727 lib/readline/doc/{readline,history}.3
8728 - a few small tweaks to make the language gender-neutral
8733 - expand_word_internal: case `:' make sure the shell is either not in
8734 posix mode or W_TILDEEXP is set before turning on W_ITILDE. The old
8735 code would turn it on unconditionally if the W_ASSIGNMENT flag was
8736 set. Fixes bug reported by OÄuz <oguzismailuysal@gmail.com>
8740 builtins/complete.def
8741 - replace macros used to print compspec actions, options, and other
8742 info with a small set of functions that traverse the structs used
8743 to hold that information and print everything instead of eumerating
8744 each option and action separately. From a patch submitted by
8745 Martin Kealey <martin@kurahaupo.gen.nz>
8750 - push_posix_tempvar_internal: restore $SHELLOPTS after restoring the
8751 values of shell options saved by `local -' by calling set_shellopts().
8752 Report from Grisha Levit <grishalevit@gmail.com>
8755 - reset_shell_flags: set histexp_flag to 0 and let bush_history_reinit
8756 take care of setting history_expansion appropriately. Report and fix
8757 from Grisha Levit <grishalevit@gmail.com>
8762 - assignment: if (FLAGS & 1), we are parsing the contents of a compound
8763 assignment, and a word must begin with a `[' and have a valid
8764 subscript terminated by `]' before the `=' to be considered an
8765 assignment statemen and subsequently expanded like one. Report from
8766 Alexey Izbyshev <izbyshev@ispras.ru>
8771 - BRACKMATCH: if the bracket expression is matching simple characters
8772 and not a range, compare the character from the string and the
8773 pattern directly, as required by Posix interp 948
8776 - charcmp_wc: split off code that calls wcscoll from rangecmp_wc,
8777 just return the results of wcscoll
8778 - rangecmp_wc: call charcmp_wc and impose a total ordering
8779 by performing a byte comparison (or wint_t comparison) of C1 and C2
8780 as required by Posix interp 948 (charcmp_wc takes care of the
8781 behavior of FORCECOLL)
8782 - collequiv_wc: call charcmp_wc instead of rangecmp_wc
8783 - charcmp: character comparison code from rangecmp
8784 - rangecmp: call charcmp and impose total ordering as required by
8786 - collequiv: call charcmp instead of rangecmp
8787 - _fnmatch_fallback: ASCII version of fallback for equivalence classes
8788 when there are no multibyte characters in the pattern; just calls
8789 fnmatch with a reconstructed equivalence class pattern
8790 - collequiv: call _fnmatch_fallback if charcmp returns non-zero and
8791 the configure check indicates fnmatch has character class support.
8792 Fixes issue reported by Harald van Dijk <harald@gigawatt.nl>
8796 lib/readline/signals.c
8797 - _rl_handle_signal: since we're not called in a signal handler context
8798 any more, we don't need to explicitly unblock the signal we received
8799 so the application's signal handler will get it when we resend the
8800 signal to ourselves. It doesn't hurt anything to do it, but we don't
8802 - _rl_handle_signal: Set up a framework for any signals that need to
8803 be blocked during cleanup: add the signal to SET (initialized to the
8804 existing set of blocked signals) and set BLOCK_SIG to 1. We block
8805 that set around the call to rl_cleanup_after_signal().
8806 - _rl_handle_signal: on AIX, if the signal is SIGHUP, make sure we
8807 block SIGHUP while running rl_cleanup_after_signal()
8812 - start_job: don't allow `fg' or `bg' in a command substitution to
8813 attempt to start a parent's jobs. Suggested by OÄuz
8814 <oguzismailuysal@gmail.com>
8817 - set_current_options: only call change_flag or SET_BINARY_O_OPTION_VALUE
8818 if the value has changed from what is stored in the bitmap, to avoid
8819 any side effects from setting the options and save time on any
8820 unnecessary function calls. Inspired by report from Grisha Levit
8821 <grishalevit@gmail.com>
8824 - xparse_dolparen: before we jump to top level, check whether we are
8825 still reading from the string (we might have run all the unwind-
8826 protects) and turn off PST_CMDSUBST if we are not. Fixes fuzzing
8827 bug reported by Jakub Wilk <jwilk@jwilk.net>
8832 - process_substitute: set subshell_environment to include SUBSHELL_ASYNC
8833 in the child process, since we passed FORK_ASYNC to make_child. Fixes
8834 DEBUG trap problem reported by Jonathan Rascher <jon@bcat.name>
8837 - unlink_all_fifos: new function, just unconditionally closes and
8838 unlinks (if using FIFOs) each pipe used for process substitution.
8839 There is an open to unblock any child processes sleeping on the
8840 FIFO first. Inspired by a suggestion from "CHIGOT, CLEMENT"
8841 <clement.chigot@atos.net>
8844 - exit_shell: call unlink_all_fifos() instead of unlink_fifo_list()
8847 - termsig_handler: call unlink_all_fifos() instead of
8853 - quote_compound_array_list: turn empty strings into '' instead of
8854 leaving them unmodified. Fixes bug in changes from 4/29 reported
8855 by andy_bush <andy_bush@objectmail.com>
8860 - edit_and_execute_command,bush_execute_unix_command: restore the bush
8861 signal handlers before running parse_and_execute() so bush will catch
8862 and handle signals, instead of letting readline catch them without
8863 any opportunity to run _rl_handle_signal(). Fixes bug reported by
8864 Stan Marsh <gazelle@xmission.com>
8869 - fc_gethnum: return HIST_INVALID for -0 if not in listing mode
8870 - fc_builtin: throw an out-of-range error if histbeg or histend gets
8872 - fc_builtin: don't throw errors for other out-of-range history
8873 specifications, clamp them at the beginning or end of the history
8874 list, as appropriate, per POSIX. Report and fix from Martijn Dekker
8880 - fc_gethnum: return HIST_NOTFOUND (new error) if the string is not a
8881 number and doesn't correspond to any command in the history list
8882 - fc_builtin: print a "no command found" error message if fc_gethnum
8883 returns HIST_NOTFOUND
8888 - no_invisible_vars: removed undocumented `-I' flag
8890 {flags,variables}.c,flags.h,builtins/{declare,setattr.def}
8891 - no_invisible_vars: remove all references
8894 - PF_ALLINDS: new flag, means to expand an array variable name without
8895 a subscript as if it were subscripted by `@' instead of `0'
8898 - parameter_brace_expand_word: if PFLAGS contains PF_ALLINDS, expand
8899 an array variable name as if it were subscripted by "@" instead of
8900 0/"0": a string with the element values separated by " ". Little
8901 nuance; we're just interested in whether or not there are any
8903 - parameter_brace_expand: if we are expanding something like ${foo@a},
8904 pass PF_ALLINDS to parameter_brace_expand_word and
8905 parameter_brace_expand_indir so we don't get tripped up on `nounset'
8906 if foo has an assigned subscript other than 0/"0". Inspired by a
8907 report from Andrew Neff <andrew.neff@visionsystemsinc.com>
8912 - bush_add_history,maybe_add_history: don't need to call shell_comment
8913 if we are in the middle of adding a here-document, since it may
8914 call the parser recursively on data that is not guaranteed to be
8915 valid input. From a report by Hyunho Cho <mug896@gmail.com>
8919 lib/readline/complete.c
8920 - compare_match: compare TEXT from the line buffer and MATCH, a
8921 possible completion for TEXT, after dequoting TEXT if necessary
8922 - rl_complete_internal,rl_menu_complete : if show-all-if-unmodified is
8923 set, use compare_match instead of a straight strcmp to determine if
8924 the match has changed the text to complete, so we can use it for
8925 filenames that require quoting. Report and pointer to fix from
8926 Abon B <gnuabonbon@gmail.com>
8931 - execute_prompt_command: PROMPT_COMMAND can now be an array, subsuming
8932 PROMPT_COMMANDS, which bush no longer looks for. Prompted by a
8933 suggestion from Martijn Dekker <martijn@inlv.org>
8938 - fc_gethnum: now takes a flags word as the third argument, with two
8939 current flag values: HN_LISTING, which means we are listing history
8940 entries, and HN_FIRST, which means we are parsing the first in a
8941 first,last range of history entries
8942 - fc_gethnum: if we have a number >= 0, and it's out of range, return
8943 different values (0 or last history) depending on whether we are
8944 parsing the first or last in a range argument. Based on a report from
8945 Martijn Dekker <martijn@inlv.org>
8950 - grammar: call handle_eof_input_unit from the eof-after-error
8951 production only from interactive top-level shells, so a syntax error
8952 in `eval' doesn't exit an interactive shell. Report and fix from
8953 Koichi Murase <myoga.murase@gmail.com>
8956 - bush_execute_unix_command: if we call parse_and_execute with allocated
8957 memory, make sure not to include SEVAL_NOFREE in the flags so it will
8958 free that command string before returning. Report and fix from
8959 Koichi Murase <myoga.murase@gmail.com>
8962 - array_to_argv: now takes a second argument: COUNTP; returns the number
8963 of elements stored in the strvec
8964 - array_to_argv: don't store array elements with null values; it makes
8965 it hard for callers to walk the whole array reliably
8968 - gen_shell_function_matches: change call to array_to_argv
8971 - execute_array_command: now takes the entire ARRAY * as the first
8975 - execute_array_command: now takes the entire array, puts the elements
8976 into a strvec, and executes each element of the strvevc as a command.
8977 This protects against a command from PROMPT_COMMAND[n] unsetting the
8978 corresponding element of PROMPT_COMMAND.
8979 From a report from Koichi Murase <myoga.murase@gmail.com>
8983 [bush-5.1-beta frozen]
8987 lib/readline/display.c
8988 - _rl_update_final: don't bother doing anything if the line structures
8989 have not been initialized. Report and fix from gary@catalyst.net.nz
8992 - get_histcmd: perform the same adjustment as in prompt_history_number;
8993 make sure to subtract one if we're doing this while executing a
8994 command that has already been saved to the history list. Inspired
8995 by a report from L A Walsh <bush@tlinx.org>
9000 - BUSH_STRUCT_WEXITSTATUS_OFFSET: fix typo in loop condition reported
9001 by Andreas K. Hüttel <dilfridge@gentoo.org>
9004 - slashify_in_here_document: restore previous value that doesn't
9005 include double quote, since it's only special in certain cases
9008 - expand_word_internal: when processing backslash-double quote inside
9009 a ${...} construct inside a here documemt, treat it the same as if
9010 it were double-quoted, as posix says. Fixes report from
9011 Andreas Schwab <schwab@linux-m68k.org>
9016 - added a number of more esoteric signal names from AIX and Solaris
9019 - report_syntax_error: make sure that the exit status is only set to
9020 one of the special builtin exit statuses if we are really executing
9021 a builtin here, not just if parse_and_execute_level > 0. Reported by
9022 Rob Landley <rob@landley.net>
9025 - EX_BADSYNTAX: make sure that gets translated into EX_BADUSAGE (2)
9026 - execute_simple_command: if a function returns a value greater than
9027 EX_SHERRBASE, use builtin_status to translate it, as if a builtin
9029 - builtin_status: make sure a status > EX_SHERRBASE gets translated to
9035 - process_substitute: set up input from /dev/null (standard for an
9036 asynchronous process) only if the shell is interactive and reading
9037 input from the terminal. This allows scripts to use process
9038 substitution to filter stdin. From a report from
9039 Andreas Schwab <schwab@linux-m68k.org>
9043 doc/{bush.1,bushref.texi}
9044 - ENV: a couple of changes clarifying that it's only used when an
9045 interactive shell is started in posix mode. Report from
9046 Reuben Thomas <rrt@sc3d.org>
9048 examples/loadables/asort.c
9049 - asort: loadable builtin to sort an array. Contributed by
9050 Geir Hauge <geir.hauge@gmail.com>
9055 [bush-5.1-rc1 frozen]
9060 - process_substitute: try it without setting the stdin for a process
9061 substitution started from an interactive shell to /dev/null. We will
9062 have to see if this causes problems like those reported back in
9063 9/2019 by Grisha Levit. From a report by Hyunho Cho <mug896@gmail.com>
9065 lib/readline/terminal.c
9066 - _rl_init_terminal_io: if the terminal is unknown, disable bracketed
9067 paste on the assumption it can't handle the enable/disable escape
9072 lib/readline/terminal.c
9073 - _rl_init_terminal_io: if the terminal name is "dumb", disable
9074 bracketed paste mode. Suggested by
9075 Andreas Schwab <schwab@linux-m68k.org>
9080 - set_trap_state: new function to allow other signal handlers to set
9081 the internal state that trap_handler would set to note that the
9082 shell received a trapped signal. Used by sigint_sighandler().
9085 - sigint_sighandler: call set_trap_state to set the pending trap state
9086 for SIGINT if trap_handler is not called. Needed because
9087 throw_to_top_level now checks whether a signal is pending before
9088 running the trap (change from 4/2020)
9091 - trap_builtin: if the shell is interactive (interactive_shell != 0)
9092 but running something like PROMPT_COMMAND that sets
9093 parse_and_execute_level > 0 but interactive == 0, make sure to set
9094 the signal handler to the default interactive shell SIGINT handler
9095 (sigint_sighandler) instead of the default non-interactive one.
9096 Fixes bug reported by Daniel Farina <daniel@fdr.io> with a hint
9097 from felix <felix@f-hauri.ch>
9102 lib/readline/{readline.c,rlprivate.h}
9103 - _rl_enable_active_region: new variable, mirrors value of
9104 _rl_enable_bracketed_paste
9105 - BRACKETED_PASTE_DEFAULT: new define, default initial value of
9106 _rl_enable_bracketed_paste and _rl_enable_active_region
9109 - hack_special_boolean_var: make sure that _rl_enable_active_region
9110 is set appropriately when "enable-bracketed-paste" is modified
9112 lib/readline/isearch.c
9113 - _rl_isearch_dispatch: make sure that we activate the mark on finding
9114 the search string only if _rl_enable_active_region is non-zero, even
9115 if bracketed paste is enabled
9117 lib/readline/search.c
9118 - noninc_dosearch: make sure that we activate the mark on finding
9119 the search string only if _rl_enable_active_region is non-zero, even
9120 if bracketed paste is enabled
9123 - rl_bracketed_paste_begin: make sure we activate the mark only if
9124 _rl_enable_active_region is enabled
9126 lib/readline/isearch.c
9127 - _rl_isearch_dispatch: the requirement for number of available unread
9128 characters (bytes) to trigger the bracketed paste test is now
9129 BRACK_PASTE_SLEN-1, like for non-incremental searches
9134 doc/bush.1,lib/readline/rluser.texi
9135 - enable-bracketed-paste: change to note the the current default is `On'
9140 - wdequote_pathname: if wcsrtombs fails, make sure to check whether it
9141 leaves wpathname set to a non-NULL value before checking whether or
9142 not *wpathname is a null character (indicating an incomplete
9143 conversion). Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972286
9144 with an assist from Bernhard Übelacker <bernhardu@mailbox.org>
9148 lib/readline/isearch.c
9149 - _rl_isearch_dispatch: when checking whether the current character is
9150 one of the isearch `opcodes', only check the multibyte character
9151 member of CXT if we're currently running in a multibyte locale. Don't
9152 assume that other parts of the code will set mb[0] = c and mb[1] = 0.
9153 Report from Detlef Vollmann <dv@vollmann.ch>
9155 [bush-5.1-rc2 frozen]
9159 lib/readline/isearch.c
9160 - _rl_isearch_dispatch: if we are aborting the search, make sure to
9161 call _rl_fix_point and to make sure the point and mark are less
9162 than the new rl_end, in case they got out of sync. Report and fix
9163 from Tillmann Osswald <tosswald@ernw.de>
9166 - unary_test: assume the argument has already been expanded (the code
9167 paths for [[ and [ expand it) and add AV_NOEXPAND to the flags passed
9168 to array_value if assoc_expand_once is enabled. Prompted by a report
9169 from Greg Wooledge <wooledg@eeg.ccf.org>
9171 [bush-5.1-rc3 frozen]
9175 doc/{bush.1,bushref.texi}
9176 - small tweaks to the ulimit description to make it more consistent with
9177 the Posix standard's terminology
9182 [bush-5.1-release frozen]