10 - bashline.o: add dependency on ${DEFDIR}/builtext.h. Report from
11 Fazal Majid <fazal@majid.org>
16 - wait_builtin: don't assign the variable given with -p if there are no
17 jobs to wait for. Report and fix from OÄuz <oguzismailuysal@gmail.com>
20 - kvpair_assignment_p: return non-zero if argument L appears to be a
21 key-value pair associative array compound assignment
22 - expand_and_quote_kvpair_word: run a single word in a key-value pair
23 associative array compound assignment through the appropriate
24 expansions and single-quote the result
27 - kvpair_assignment_p, expand_and_quote_kvpair_word: extern declarations
30 - expand_oneword: detect whether VALUE appears to be a key-value
31 pair compound assignment and call the appropriate function to expand
32 each word in the resulting list. Fixes inconsistency reported by
33 oguzismailuysal@gmail.com
38 - command_substitute: don't reset pipeline_pgrp to shell_pgrp if we
39 are already forked to run a command (SUBSHELL_FORK). Fixes SIGINT
40 in command substitution in here-document in forked child issue
41 reported by oguzismailuysal@gmail.com
46 - execute_pipeline: execute the lastpipe code even if prev == 0. It
47 can only be 0 here if stdin was closed when this function was
49 - execute_pipeline: if prev == 0, set lstdin to a sentinel (-1) that
50 means to close fd 0 after executing the command, and call close(prev)
51 before restoring stdin. restore_stdin now understands -1, and closes
52 fd 0. Fixes issue reported by Tomas Janousek <tomi@nomi.cz>
57 - PROMPT_COMMANDS: clean up a couple of remaining instances of this
58 name. Report from Eli Schwartz <eschwartz@archlinux.org>
63 - command_substitute: make sure that the child process always has
64 pipeline_pgrp == shell_pgrp: if pipeline_pgrp is non-zero when we
65 get to the child, meaning that we're part of an already-forked
66 child that is, for instance, running redirections, we need to reset
67 shell_pgrp to it to preserve the invariant. Fixes bug with terminal
68 being set to the incorrect pgrp reported by oguzismailuysal@gmail.com
72 configure.ac,builtins/shobj-conf,m4/threadlib.m4
73 - midnightbsd: update auto-configuration to treat MidnightBSD like
74 FreeBSD. From https://savannah.gnu.org/patch/?10006
78 examples/loadables/stat.c
79 - stattime: use strftime with a default format or the format supplied
80 with the -F option to format the file time information
81 - stat_builtin: now takes a -F fmt option for a strftime format string;
82 change to function calling sequences to pass the format down to
85 examples/loadables/Makefile.in
86 - stat: now built and installed by default
91 - SUBSHELL_IGNTRAP: new flag value
94 - make_child: set SUBSHELL_IGNTRAP in subshell_environment in the
95 child process, meaning that we should not execute trap handlers for
99 - execute_in_subshell, execute_simple_command, execute_disk_command:
100 make sure to unset SUBSHELL_IGNTRAP after a child process restores
101 the original signal dispositions
102 - execute_simple_command: make sure to set SUBSHELL_IGNTRAP after
103 make_child returns and we're setting subshell_environment directly
106 - command_substitute,process_substitute: unset SUBSHELL_IGNTRAP after
107 the child process has reset the trapped signal dispositions
110 - trap_handler: if we get a signal for which we have set a trap, but
111 SUBSHELL_IGNTRAP is set in subshell_environmnent, make sure we
112 restore the original signal disposition and resend the signal to
113 ourselves. Fixes issue reported by Nikolay Borisov <nborisov@suse.com>
114 (or at least makes the race window much smaller)
117 - initialize_terminating_signal: set the original signal handler from
118 the return value from sigaction; a minor optimization that saves a
124 - declare_internal: make some option combinations that don't make
125 sense errors (e.g., -f and -a/-A/-i/-n)
126 - declare_internal: if we build a new variable name by expanding the
127 value of a nameref variable, make sure to chop the `+' in a `+='
132 doc/{bash.1,bashref.texi}
133 - bind: add an example to the synopsis making it clear that you can
134 use any readline command line as a non-option argument, as it says
135 in the text. From a report from Dan Jacobson <jidanni@jidanni.org>
140 - local_shiftstates -> locale_shiftsates in the non-multibyte code
141 branch. Reported by Henry Bent <henry.r.bent@gmail.com>
144 - expand_compound_assignment_word: make sure to call dispose_words on
145 the WORD_LIST * returned from expand_oneword after turning it back
146 into a string. Fixes memory leak reported by Alexander Mescheryakov
147 <alexander.s.m@gmail.com>
152 - bind_variable_internal: when performing an assignment to a subscripted
153 array variable that was the value of a nameref (used in the original
154 assignment), don't call make_variable_value on the value, since that
155 messes up +=. Just call assign_array_element and let that take care
156 of calling make_variable_value appropriately. Fixes bug reported by
157 Oguz <oguzismailuysal@gmail.com>
162 - search_for_command: if `checkhash' is set, don't add non-executable
163 files to the command hash table, since we will just remove them
167 - get_new_window_size: set *rp and *cp even if READLINE is not defined
172 - get_new_window_size: call rl_set_window_size only if we can determine
173 we're using readline: an interactive shell without no-line-editing,
174 or if we've already initialized readline, presumably in a non-
178 - man2html: add LDFLAGS_FOR_BUILD to the recipe. Report from
179 Jeffrey Walton <noloader@gmail.com>
184 - rl_operate_and_get_next: fix old K&R function declaration. Report
185 from Tom Tromey <tom@tromey.com>
187 lib/readline/readline.c
188 - _rl_internal_char_cleanup: move code that cleans up the active region
189 and deactivates the mark inside this function so callback mode
190 applications get the intended functionality. Report and fix from
191 sparrowhawk996@gmail.com
194 - rl_parse_and_bind: when using the arithmetic comparison operators on
195 the version, make sure to invert the tests so that we stop parsing
196 if the test fails. Report and fix from Tom Tromey <tom@tromey.com>
201 - pipesize.h: add dependency on ${BUILTINS_LIBRARY} to avoid parallel
202 makes trying to create it twice. Report and fix from
203 Richard Purdie <richard.purdie@linuxfoundation.org>
208 - param_expand: if a nameref expands to array[@] or array[*], make sure
209 to call chk_atstar so the right variables are set to split the
210 result. Report from Oguz <oguzismailuysal@gmail.com>
215 - Rewrote to reduce complexity. Still needs some work.
217 lib/readline/*.h, lib/tilde/tilde.h
218 - PARAMS: remove, rely on compilers understanding function prototypes
220 lib/readline/{undo.c,histlib.h}
221 - _hs_replace_history_data: move extern declaration to histlib.h
223 lib/readline/readline.c
224 - _rl_parse_colors: instead of an extern declaration for this, include
225 "parse-colors.h" for it
227 lib/readline/{histfile.c,histlib.h}
228 - _hs_append_history_line: move extern declaration to histlib.h
230 lib/readline/history.h
231 - HS_HISTORY_VERSION: define to 0x0801 (current library version) if
232 it's not already defined. We conditionally define it in case an
233 application has (unwisely) chosen to use it, since the history
234 library doesn't do anything with it yet
236 lib/readine/{rlprivate.h,{search,misc,readline}.c}
237 - _rl_free_history_entry: add extern declaration to rlprivate.h, remove
238 extern declaration from c source files. Use HS_HISTORY_VERSION as a
239 sentinel that it's ok to use HIST_ENTRY in rlprivate.h
241 lib/readline/{rlprivate.h,{isearch,search,undo}.c}
242 - _rl_saved_line_for_history: add extern declaration to rlprivate.h,
243 remove extern declaration from c source files, using HS_HISTORY_VERSION
248 lib/readline/signals.c
249 - _rl_handle_signal: make sure that all sigprocmask calls are protected
250 by HAVE_POSIX_SIGNALS. Report and fix from Tom Tromey <tom@tromey.com>
254 lib/readline/callback.c
255 - rl_callback_read_char: make sure rl_linefunc is non-NULL before
256 calling through the pointer. The line function could have been
257 removed by the application before readline processes any typeahead
258 input. Bug reported by Matthias Klose <doko@debian.org>, pointer
259 to root cause from Koichi Murase <myoga.murase@gmail.com>
262 - skipname,wskipname: put in some additional checks for `.' to ensure
263 that we don't get false positives (or incomplete tests) that can
264 affect the results of extglob patterns. Reported by
265 gregrwm <rhn-users@greatlakedata.com>
270 - extglob_skipname,wextglob_skipname: fixed an off-by-one error (SE
271 was being set to one character before the end of the pattern string,
272 not the null character at the end of the pattern string like other
273 callers of glob_patscan) that caused the last character of the last
274 subpattern to be cut off when calling skipname
275 - extglob_skipname,wextglob_skipname: some cleanups so the code is
276 closer to identical for the single-byte and wide character versions
281 - execute_simple_command: in posix mode, if we have a variable
282 assignment error while assigning into the temporary environment (e.g.,
283 assigning to a readonly variable), a non-interactive shell running a
284 special builtin exits; a non-interactive shell running anything else
285 jumps back to the top level. A shell compiled with -DSTRICT_POSIX
286 exits unconditionally.
287 - execute_simple_command: make sure posix mode sets $? to non-zero
288 if a variable assignment error occurs preceding a non-special builtin
291 - do_assignment_statements: take the code from expand_word_list_internal
292 that performs assignment statements, either standalone or preceding
293 simple command names, and factor it out into this function
294 - expand_word_list_internal: call do_assignment_statements where
300 - dequote_pathname: fix function definition for non-multibyte systems.
301 Report and fix from Marc Aurèle La France <tsi@tuyoix.net>
303 Makefile.in,doc/Makefile.in
304 - for certain targets, remove files before creating them to deal with
305 symlinked build trees.
306 Report and fix from Marc Aurèle La France <tsi@tuyoix.net>
308 examples/loadables/accept.c
309 - include limits.h before typemax.h
310 Report and fix from Marc Aurèle La France <tsi@tuyoix.net>
312 builtins/gen-helpfiles.c
313 - if USING_BASH_MALLOC is defined, make sure to undefine malloc as well
314 as free. Fixes bug reported by George R Goffe <grgoffe@yahoo.com>
317 - install-help: now depends on $(HELPFILES_TARGET) so we make sure the
318 separate helpfiles are created before we try to install them if we
319 don't go through the `all' makefile target
322 - HELPDIR: now ${datadir}/bash/helpfiles
327 - parse_string_to_word_list: before expanding a compound assignment
328 statement body, make sure to save any alias that's currently being
329 expanded. Restore the alias after the compound assignment is parsed.
330 Reported back in 11/2020 by Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
334 lib/readline/histexpand.c
335 - history_expand_internal: when calling the history_inhibit_expansion
336 function, make sure to call it using the string as we've expanded it
337 to that point (RESULT), adding the expansion and next characters
338 temporarily, since we make expansion decisions based on what we've
339 accumulated, not what we started with. This makes things like
340 echo abc!$!$ work, where before the second `!' inhibited expansion
341 because bash_history_inhibit_expansion mistakenly took it as the
342 second character in a `$!' word expansion. Fixes bug reported back
343 in 10/2020 by Paul Fox <paul.d.fox@gmail.com>
346 - array_pop: instead of calling array_dispose_element from this macro,
347 just call array_shift with the AS_DISPOSE flag
352 - shell_comment: move condition to return 0 if the delimiter stack is
353 not empty or the shell is parsing a here document into the function
354 itself, don't have the callers check so the check is in one place.
355 Fixes bug reported by Oguz <oguzismailuysal@gmail.com>
358 - ARRAY_ELEMENT_REPLACE: convenience define for modifying an array
362 - pop_args: a couple of code simplifications
367 - pagesz: at least MALLOC_PAGESIZE_MIN (4096) bytes
368 - union mhead: now 16-byte aligned on all systems, 32-bit and 64-bit
370 - binsizes: since the smallest allocation overhead is now 16 bytes,
371 redo the buckets so binsizes[0] == 32; adjust the thresholds for
372 split/coalesce/prepopulate/mmap (NBUCKETS = 28; STARTBUCK = 0).
373 Sizes stay pretty much the same; indices change
374 - consistently use MALLOC_SIZE_T instead of long/unsigned int/int
375 - use MAGIC8_NUMBYTES as the length of the mh_magic8 buffer, in case
376 it changes later for alignment
377 - internal_remap: new function, calls mremap to reallocate a chunk of
378 memory allocated using mmap(); called from internal_realloc if the
379 old size and new size are both bigger than the mmap threshold
380 - internal_realloc: call internal_remap if the old size and new size
381 are both above the threshold where we use mmap for allocation
386 - new file, declaration for a timer struct to be used by a set of
387 functions to implement timers using SIGALRM or select/pselect
390 - new file, set of functions to manipulate timer objects and timeouts
391 using SIGALRM or select/pselect. Inspired by a patch from
392 Koichi Murase <myoga.murase@gmail.com>. Not used yet
397 - read_builtin: if there is a timeout set, block SIGCHLD around calls
398 to zread and its siblings, or calls to readline for `read -e', so
399 SIGCHLD (and the consequent waitpid) doesn't interrupt the read.
400 Fixes bug reported by Koichi Murase <myoga.murase@gmail.com>, but
401 there may be a different fix coming
403 Makefile.in,builtins/Makefile.in
404 - fix up dependencies, especially on builtins.h and builtext.h
410 - rl_read_key: if we set rl_done == 1, set RL_STATE_DONE as well
411 Reported by Koichi Murase <myoga.murase@gmail.com>
413 lib/readline/isearch.c
414 - _rl_search_getchar: only call _rl_read_mbstring if rl_read_key returns
415 >= 0, avoid some work
417 lib/readline/vi_mode.c
418 - _rl_vi_callback_change_char,_rl_vi_change_char: don't overwrite the
419 last replacement string if _rl_vi_callback_getchar returns -1.
420 It will likely make no difference, since the next read will return
421 an error or EOF, but being careful
422 - rl_vi_overstrike: if _rl_overwrite_char doesn't return 0, break out
426 - _rl_overwrite_char: return 1 if _rl_read_mbstring returns < 0 so
427 we don't try to insert garbage
430 - posix_edit_macros: handle rl_read_key() returning <= 0
435 - read_comsub: make sure to turn on the LEX_RESWDOK flag if we are in
436 a case statement and read a `)', since we can get a valid `esac'.
437 Fixes bug reported by Oguz <oguzismailuysal@gmail.com>
438 - read_comsub: if we're in a case statement, recognize `}' as a
439 reserved word and set the LEX_RESWDOK flag for the next word, since
440 we can get an esac (or another reserved word) after it
445 - reserved_word_acceptable: add ARITH_CMD and COND_END to the list of
446 tokens that can precede a reserved word, so you can use reserved
447 words after ((...)) and [[...]].
448 Reported by Koichi Murase <myoga.murase@gmail.com>
453 - parse_comsub: use new LEX_CASEWD flag to track when we are reading
454 the WORD in `case WORD in' and turn on the LEX_RESWDOK flag when
455 that word ends. This allows $(case x in esac), which no one uses.
456 - parse_comsub: use LEX_PATLIST flag to track when we are reading a
457 case pattern list so `|' doesn't turn on the LES_RESWDOK flag
458 - parse_comsub: case_level: simple counter to count the number of esacs
459 we need to see before we're no longer in a case statement; analog of
460 esacs_needed_count from the lexer
465 - CHECK_FOR_RESERVED_WORD: don't return ESAC if we read `esac' after a
466 left paren in a case pattern list. From an austingroup-bugs discussion
467 about https://www.austingroupbugs.net/view.php?id=1454
468 - parse_comsub: if we read a `(' while looking for a case pattern list
469 and LEX_CKESAC is set, we have a leading left paren in the pattern
470 list and should turn off LEX_CKESAC so (esac) doesn't prematurely
471 terminate the case command. From an austingroup-bugs discussion
472 about https://www.austingroupbugs.net/view.php?id=1454
477 - history_builtin: when checking negative offsets to -d, which are
478 supposed to count back from the end of the history list, check the
479 range against 0 instead of history_base, because the calculation is
480 done against history_length, which is independent of history_base.
481 Report and fix from Christopher Gurnee <chris@gurneeconsulting.net>
486 - replaced a number of uses of @var with a mixture of @env and @dfn
487 to better match up with the texinfo standards
489 doc/{bash.1,bashref.texi}
490 - clarify some aspects of the coproc description, especially the
491 use of NAME and when it's optional
496 - read_comsub: fix off-by-one error in mbrtowc that causes a read one
497 character past the end of buf. Report and fix from
498 Platon Pronko <platon7pronko@gmail.com> in
499 https://savannah.gnu.org/patch/?10035
504 - ulimit_builtin: Posix compatibility: if the last command specified
505 by an option does not have an option argument, but there is an
506 operand remaining after all the options are parsed, treat the
507 operand as an argument to that last command. From an austin-group
508 discussion and a Geoff Clare suggestion back in November, 2020.
509 Austin Group interpretation 1418
512 - a package of shell functions to perform floating-point math entirely
513 in bash. Contributed by Michael Wood <mawood20@gmail.com>. Available
514 at https://github.com/clarity20/shellmath
519 - darwin: take out the -arch-only option in SHOBJ_XLDFLAGS and
520 SHOBJ_ARCHFLAGS; no longer needed
522 doc/{bash.1,bashref.texi}
523 - coprocesses: suggested changes from rms@gnu.org; recommend the
524 `coproc NAME { commands; }' form as the simplest and most flexible
529 - exec_builtin: set last_command_exit_value before calling exit_shell
530 so any exit trap gets the right value for $?. From Matthew Bauer
531 <mjbauer95@gmail.com> via https://savannah.gnu.org/patch/?10039
536 - SHTIMER_ALRMSET: new flag, indicates that there is an active alarm
537 associated with this timer (falarm() was called)
540 - shtimer_set: set the SHTIMER_ALRMSET flag after calling falarm
541 - shtimer_unset: don't call falarm(0,0) unless the SHTIMER_ALRMSET flag
547 - added some BSD convenience defines if they are not present
550 - {save,restore}_parser_state: save and restore shell_eof_token and
551 pushed_string_list; change callers (e.g., xparse_dolparen) so they
552 don't have to manage them
557 - extern declarations for moving to timers (sh_timer) for read builtin
561 - CHECK_ALRM: remove, no longer used
564 - check_signals: call check_read_timeout instead of CHECK_ALRM
567 - bash_event_hook: use read_timeout instead of checking `sigalrm_seen';
568 that no longer exists
569 - bash_event_hook: accommodate readline timing out (not used yet)
572 - zread: call read_builtin_timeout() to check for a timeout before
573 calling a blocking read()
576 - sigalrm,reset_timeout,check_read_timeout,read_builtin_timeout: new
577 and modified functions to use sh_timers for timeouts instead of
578 SIGALRM. Based on work contributed by Koichi Murase
579 <myoga.murase@gmail.com>
580 - read_builtin: use sh_timers for read timeouts (-t N) instead of
582 - edit_line: simulate receiving SIGALRM if readline times out (not
587 lib/readline/readline.c
588 - rl_initialize: call _rl_timeout_init to set things up for any timeout
589 that was set with rl_set_timeout
590 - readline_internal_charloop: if we longjmped because of a timeout,
591 make sure to set rl_done/RL_STATE_DONE and return; we are
592 abandoning this call to readline(). The readline timeout changes
593 were based on work contributed by Koichi Murase
594 <myoga.murase@gmail.com>
596 lib/readline/readline.h
597 - extern declarations for new timeout functions and hook
598 - rl_clear_timeout: new define
600 lib/readline/callback.c
601 - rl_callback_read_char: if we longjmped because of a timeout,
602 make sure to set rl_done/RL_STATE_DONE and return; we are
603 abandoning this call to readline()
606 - _rl_abort_internal: if we time out, don't ring the bell; let the
610 - extern declarations for public and readline-library-private functions
611 and hooks to implement timeouts
612 - rl_set_timeout,rl_timeout_remaining: new public functions
613 - _rl_timeout_select: new function, uses select/pselect to implement
614 read timeouts that take timeouts set with rl_set_timeout into account;
615 calling hook function if a timeout occurs
616 - rl_gather_tyi, _rl_input_available: use _rl_timeout_select, taking
617 any existing timeout into consideration if it expires before the
618 timeout passed as an argument
619 - rl_getc: use _rl_timeout_select and handle any timeouts by calling
621 - set_alarm,reset_alarm: new functions to implement timeouts using
622 SIGALRM for systems that lack a working select/pselect
623 - _rl_timeout_init: new function, sets things up for reading input
624 with a specified timeout
625 - _rl_timeout_handle: a timeout handler; calls any event hook and
626 sets up to abort the current readline() call
627 - _rl_timeout_handle_sigalrm: a timeout handler for systems using
628 SIGALRM to implement timeouts
630 lib/readline/parens.c
631 - rl_insert_close: use _rl_timeout_select to take timeouts into account
633 lib/readline/rlprivate.h
634 - extern declarations for readline-library-private timeout functions
637 - rl_deprep_terminal: don't print a newline after the bracketed paste
638 disable sequence if we timed out
640 lib/readline/signals.c
641 - _rl_handle_signal: if sig is SIGALRM, call _rl_timeout_handle_sigalrm()
643 lib/readline/doc/rltech.texi
644 - rl_set_timeout,rl_timeout_remaining: document new public functions
645 - RL_STATE_TIMEOUT: document new possible state value for rl_readline_state
646 - rl_timeout_event_hook: document new hook function, called when
650 - read_builtin: changes to use the readline timeout functions to
651 implement timeouts with `read -e'; these use rl_set_timeout and
652 sh_timer structs together
657 - expand_string_dollar_quote: new function, expands $'...' and $"..."
658 in a string for those code paths that don't expand it themselves
661 - expand_string_dollar_quote: extern declaration
664 - read_secondary_line: if $'...' or $"..." appears in the line, call
665 expand_string_dollar_quote to expand them. This now returns new
666 memory, need to change callers
669 - make_here_document: account for read_secondary_line returning newly
670 allocated memory, free `full_line' appropriately
673 - shell_expand_line,history_and_alias_expand_line: expand $'...' and
674 $"..." in the line by calling expand_string_dollar_quote, since
675 that happens after history expansion and before alias expansion in
681 - expand_string_dollar_quote: fix out-of-order initialization
684 - {TAGS,tags}: add ETAGS/ETAGSFLAGS/CTAGS/CTAGS flags; make sure to
685 cd to the source directory before running them to get source files
686 that don't have absolute paths. Fix from Mike Jonkmans
687 <bashbug@jonkmans.nl>
690 - xparse_dolparen: don't longjmp if FLAGS includes SX_NOLONGJMP. From
691 a report by Xu Lu <oliver_lew@outlook.com>
696 - process_substitute: set startup_state and parse_and_execute_level
697 to see if we can avoid a fork()
700 - bash_spell_correct_word: bindable command (spell-correct-word) to
701 perform spelling correction on the current `shellword', using the
702 same code as the `cdspell' option and directory spelling correction
703 during completion. Feature suggested by in 10/2020 by
704 Karl Kleinpaste <karl@kleinpaste.org>
705 - bash_spell_correct_word: bound to "C-x s" by default in emacs mode
707 lib/readline/display.c
708 - rl_redisplay: fix redisplay problem that occurs when switching from
709 the rl-digit-argument prompt "(arg: N)" back to the regular prompt,
710 and the regular prompt contains invisible characters
712 doc/bash.1,lib/readline/doc/rluser.texi
713 - spell-correct-word: document new function and its default binding
717 doc/{bash.1,bashref.texi}
718 - cd: slight changes to specify that it sets PWD and OLDPWD
719 - {pushd,popd}: make it clear that these builtins use cd to change
720 the current working directory; change wording to simplify the
721 description and clarify the exit status
726 - execute_disk_command: after performing redirections, call
727 unlink_all_fifos() to remove the FIFOs created as part of
728 expanding redirections. They should have been opened by then, and
729 we're going to call shell_execve right away anyway, so we won't be
730 around to remove the FIFOs. From a report from
731 Michael Felt <aixtools@gmail.com>
736 - alias_expand_token: slight tweak to check for alias expansion: perform
737 expansion unconditionally if PST_ALEXPNEXT is set, and disable it
738 in case statement pattern lists if the previous token indicates a
739 command name is acceptable.
740 From a report by Oguz <oguzismailuysal@gmail.com>
743 - HAVE_MKDTEMP: fix typo
747 lib/readline/terminal.c
748 - look in terminfo for key sequences for page up (kP) and page down
749 (kN) and bind them to history-search-{backward,forward},
750 respectively. From a patch from Xose Vazquez Perez
751 <xose.vazquez@gmail.com>
756 - expand the node describing $"..." string translation with additional
762 - rl_fetch_history: moved here from vi_mode.c
763 - rl_fetch_history: negative arguments count back from the end of
764 the history, instead of taking you to the beginning of the history
766 - rl_fetch_history: in vi mode, an out-of-range argument rings the
767 bell and doesn't change the line
770 - rl_vi_fetch_history: call rl_fetch_history
773 - rl_fetch_history: new extern declaration
775 doc/bash.1,lib/readline/doc/{readline.3,rluser.texi}
776 - rl_fetch_history: add description
779 - show_var_attributes: if a variable's value indicates that it should
780 be ANSI-C quoted, use ansic_quote instead of sh_double_quote to
781 format the value string. From proposal by Greg Wooledge
787 - unbind_array_element: if FLAGS includes VA_ONEWORD, don't use
788 skipsubscript to parse the subscript, just assume the entire SUB is
789 the subcript and that it contains the closing `]', so we just want
790 everything in SUB except the last character.
793 - select_command: use compound_list instead of list, like for_command.
794 Report by Greywolf <greywolf@starwolf.com>
795 - list: move this into compound_list (replacing the instance of `list'
796 in the compound_list production), remove from the grammar
801 - unbind_array_element: use VA_NOEXPAND instead of literal 1
805 lib/readline/funmap.c
806 - default_funmap: add missing `vi-undo' to the list of vi-mode bindable
807 functions. Reported by Xirui Zhao <quinean@icloud.com>
813 - DEFAULT_LOADABLE_BUILTINS_PATH: default value for BASH_LOADABLES_PATH
815 doc/{bash.1,bashref.texi}
816 - enable: note that it uses $BASH_LOADABLES_PATH, and that the default
820 - initialize_shell_variables: initialize BASH_LOADABLES_PATH to the
821 default given in DEFAULT_LOADABLE_BUILTINS_PATH
825 doc/{bash.1,bashref.texi}
826 - add link to git master tar file as a place to get the current version
831 - attempt_shell_completion: use -1 as a sentinel value for
832 in_command_position indicating that we cannot be in a command position
833 (e.g., because we're the target of a redirection) and should not
834 check for a programmable command completion or tell the programmable
835 completion code to use command completion. Report and fix from
836 Marc Aurèle La France <tsi@tuyoix.net>
841 - bind_builtin: reverse sense of strvec_search return value when
842 deciding whether or not to remove a unix-command binding from the
843 cmd keymap. Bug report by Dale Sedivec <dale@codefu.org>
845 lib/readline/doc/rltech.texi
846 - RL_PROMPT_{START,END}_IGNORE: document current values of \001 and
847 \002. Report from Mingye Wang <arthur200126@gmail.com>
852 - assign_assoc_from_kvlist: fix memory leak reported by konsolebox
853 <konsolebox@gmail.com>
858 - W_ITILDE: remove, replace with a variable since it's only used inside
859 a single call to expand_word_internal
863 {subst.c,make_cmd.c,parse.y}
864 - W_DQUOTE: no longer used, use W_NOPROCSUB and W_NOTILDE directly
865 (for arithmetic commands and words in arithmetic for commands)
870 - executable_completion: since this function gets an unquoted filename
871 from rl_filename_completion_function, we need to quote special
872 characters before passing it to bash_directory_completion_hook.
873 Report from Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
877 lib/readline/search.c
878 - _rl_nsearch_abort: move function calls around so _rl_restore_prompt
879 happens before rl_clear_message, like when aborting an incremental
880 search. Suggested by sparrowhawk996@gmail.com
883 - ASS_ALLOWALLSUB: new assignment flag value, means to allow @ and * as
884 valid array subscripts when assigning to existing associative arrays
887 - assign_array_element: allow assignment of key `@' to an existing
888 associative array if the caller passes ASS_ALLOWALLSUB
889 - assign_compound_array_list: allow ( [@]=value ) to an existing
893 - declare_internal: allow assignment of key `@' to an existing
894 associative array by passing ASS_ALLOWALLSUB to assign_array_element
895 as part of local_aflags. This affects declare, local, and typeset
898 - do_assignment_internal: allow a[@]=value to an existing associative
899 array by passing ASS_ALLOWALLSUB to assign_array_element
904 - builtin_bind_var_to_int: wrapper for bind_var_to_int to be used by
905 builtin commands; placeholder for future work
908 - builtin_bind_var_to_int: use instead of bind_var_to_int
911 - builtin_bind_variable: allow assignment of key `@' to an existing
912 associative array by passing ASS_ALLOWALLSUB to assign_array_element.
913 This affects printf and read
915 builtins/variables.[ch]
916 - bind_var_to_int: add third `flags' argument to pass to bind_variable
917 instead of always passing 0
919 redir.c,builtins/common.c,builtins/printf.def
920 - bind_var_to_int: change callers, add third flags argument
923 - builtin_bind_var_to_int: pass ASS_ALLOWALLSUB to bind_var_to_int so
924 builtins like wait can assign to assoc[@] and assoc[*]
929 - command_word_completion_function: make sure to initialize
930 old_glob_ignore_case before trying to restore from it
931 - command_word_completion_function: if we are completing a glob
932 pattern, make sure to set rl_filename_completion_desired, so we get
933 quoting and appending -- we are completing a filename, after all.
934 From a report from Manuel Boni <ziosombrero@gmail.com>
937 - enable-active-region: separate control of the active region and
938 bracketed paste. Still set to the same default value as bracketed
939 paste, and enabling bracketed paste enables the active region.
940 Now you can enable bracketed paste and then turn off the active
943 doc/bash.1,lib/readline/doc/{readline.3,rltech.texi}
944 - enable-active-region: document new bindable readline variable and
950 - W_ARRAYREF: new flag, meaning the word is a valid array reference
951 with subscript, replaces W_DOLLARSTAR, which was unused
954 - expand_subscript_string,expand_array_subscript: new functions to
955 parse and expand-and-quote array subscripts. For future use
960 - mapfile: if the delimiter is a newline, set unbuffered_read = 1
961 for any file descriptor that isn't seekable and lseek sets errno
962 to ESPIPE (pipes, FIFOs, maybe terminal devices). If it's not a
963 newline, only allow buffered reads if the file descriptor is a
964 regular file. Report from Koichi Murase <myoga.murase@gmail.com>
967 - read_builtin: only set unbuffered_read = 1 if the input is coming
968 from a pipe (which we can't seek on) or the input is a terminal and
969 we want to read a specified number of characters or we're using a
970 non-standard delimiter
976 - mapfile: call zsyncfd before calling the callback. Suggested by
977 Koichi Murase <myoga.murase@gmail.com>; we'll see how it goes
982 - expand_subscript_string: extern declaration
985 - expand_subscript_string: replace expand_assignment_string_to_string
986 with calls to this when expanding array subscripts
989 - cond_expand_word: call expand_word_internal with Q_ARITH if `special'
990 says we should quote for an arithmetic expression context
991 - expand_word_internal: call expand_array_subscript when we see `[' in
992 arithmetic or array subscript contexts, make conditional on the
993 compatibility level later
994 - expand_word_internal: make sure W_ARRAYREF makes it through this
995 function and into the returned word
1001 - array_expand_index: call evalexp with a flag of 0 since we call
1002 expand_arith_string with Q_ARITH and we want evalexp to remove
1006 - eval_arith_for_expr,execute_arith_command: now that Q_ARITH has an
1007 effect on array subscripts (it quotes the special expansion
1008 characters), call evalexp with 0 as the flags arg so quote removal
1009 is performed on this quoted argument. Make this conditional on the
1010 shell compatibility level later
1011 - execute_cond_command: make sure to expand the argument to -v by
1012 calling cond_expand_node with Q_ARITH, and correspondingly turn off
1013 assoc_expand_once when calling unary_test with that argument, since
1014 we want it to be expanded again to remove the quotes
1015 - execute_cond_command: expand the arguments to the arithmetic operators
1016 with Q_ARITH and pass TEST_ARITHEXP to binary_test to ensure that
1017 it lets evalexp expand the arguments to remove the quoting
1020 - arithcomp: if TEST_ARITHEXP is in FLAGS, call evalexp with a flag
1021 if 0 to force evalexp to expand the arguments to remove the quoting
1024 - param_expand: since we call expand_arith_string with Q_ARITH, we need
1025 to call evalexp with 0 instead of EXP_EXPANDED for $((...)) expansion
1026 - expand_word_internal: if we recursively call expand_word_internal to
1027 expand the contents of a double-quoted string, make sure we pass
1028 through Q_ARITH if it appears in QUOTED
1029 - verify_substring_values: call expand_arith_string with Q_ARITH and
1030 correspondingly call evalexp with 0 instead of EXP_EXPANDED
1033 - execute_cond_node: if -v is the operator, and the operand is a valid
1034 array reference, pass TEST_ARRAYEXP flag to unary_test
1038 builtins/common.[ch]
1039 - set_expand_once: set array_expand_once to the value passed as the
1040 first argument, returning the original value
1043 - ARRAYREF_BUILTIN: new flag for shell builtins, means that the builtin
1044 can take array references, with subscripts, as arguments
1046 builtins/mkbuiltins.c
1047 - set ARRAYREF_BUILTIN flag on builtins given in the arrayvar_builtins
1051 - execute_cond_node: use set_expand_once to set array_expand_once to 0
1052 before calling unary_test with -v (see change from 5/6)
1055 - unbind_array_element: allow the caller to choose whether or not a
1056 subscript of `*' or `@' unsets the entire array by passing
1057 VA_ALLOWALL in FLAGS. Right now, since the unset builtin doesn't
1058 pass VA_ALLOWALL, those subscripts unset individual elements for
1059 associative arrays. We preserve the old behavior of unsetting
1060 indexed arrays for the time being with new indexed-array-specific
1067 - expand_once_flag: "assoc_expand_once" option now sets this flag,
1068 calls set_assoc_expand on change
1069 - set_assoc_expand: sets assoc_expand_once to mirror expand_once_flag;
1070 placeholder for future changes
1073 - expand_once_flag: extern declaration
1077 doc/{bash.1,bashref.texi}
1078 - note that case patterns undergo quote removal. Reported by
1079 AlvinSeville7cf <alvinseville7cf@gmail.com>
1084 builtins/bashgetopt.c
1085 - list_optflags: flags associated with the word corresponding to
1086 list_optarg, assuming list_optarg is a separate argument
1088 builtins/bashgetopt.h
1089 - list_optflags: extern declaration
1092 - unset_builtin: set VFLAGS each time through the loop, since we take
1093 whether or not the word has W_ARRAYREF set into account
1094 - unset_builtin: don't pass VA_ALLOWALL to unbind_array_element for
1098 - unary_test: in the -v case, use assoc_expand_once in the first call
1099 to valid_array_reference ()
1102 - printf_builtin: only set VA_ONEWORD if the option argument to -v has
1103 W_ARRAYREF set (look at list_optflags)
1109 - expand_array_subscript: don't quote @ or * in the expanded subscript
1110 at all, even when they are the only character in the subscript. See
1111 how this works out -- it might uncover places where we need to allow
1112 `*' and `@' as subscripts where they are not allowed now
1115 - expr_bind_variable: pass ASS_ALLOWALLSUB to bind_int_variable so we
1116 can allow (( A[@]=value )) when A is an existing associative array
1119 - AV_ATSTARKEYS: new flag value, means to accept a[@] and a[*] but
1120 treat them as keys/expressions and not special values
1123 - array_value_internal: check AV_ATSTARKEYS and don't treat them as
1124 ALL_ELEMENT_SUB values; they fall through to use as keys/indices
1127 - unary_test: if -v is passed an array reference, add AV_ATSTARKEYS to
1128 the flags passed to array_value so we treat @ and * as keys for an
1129 existing associative array
1135 - expand_cond_word: if SPECIAL == 3 (arithmetic expression), dequote the
1136 resulting WORD_LIST * as if special == 0, because we don't want to
1137 quote the list for pattern matching. Report from
1138 Adjudicator Darren <adjudicatordarren@protonmail.com>
1143 - expand_array_subscript: add double quote (") to the list of characters
1144 that are backslash-quoted in subscripts after word expansion.
1145 skipsubscript treats them specially, so you have to quote them to
1146 do things like `key='"' ; array[$key]=1 ; [[ -v array[$key] ]]'
1152 - wait_builtin: if we longjmp to wait_intr_buf, call unset_waitlist if
1153 we have called set_waitlist (wflags & JWAIT_WAITING). Fixes bug with
1154 wait -n interrupted by a trapped signal (not SIGINT) reported by
1155 Jonas Alfredsson <jonas.alfredsson@protonmail.com>
1158 - wait_sigint_cleanup: restore the old sigint handler before we longjmp
1159 out by calling restore_sigint_handler()
1164 - bind_read_variable: now takes an additional argument, flags to pass
1165 to builtin_bind_variable; change callers
1166 - SET_VFLAGS: set vflags and bindflags
1167 - read_builtin: call SET_VFLAGS to set vflags and bindflags from each
1168 word before calling valid_array_reference and bind_read_variable
1171 - builtin_bind_variable: set vflags (for valid_array_reference) and
1172 bindflags (for bind_variable/assign_array_element) separately for
1176 - assign_array_element: sanity check: make sure that the subscript
1177 returned by array_variable_name consumes the entire NAME, otherwise
1178 flag it as a subscript error. This keeps things like
1179 `KEY=' ]'; read assoc[$KEY] <<< hello' from assigning to incomplete
1183 - printf_builtin: if LIST_OPTFLAGS includes W_ARRAYREF, set VA_NOEXPAND
1189 lib/readline/complete.c
1190 - compute_lcd_of_matches: move a couple of strlen calls out of a loop
1191 in calls to mbrtowc; performance improvement only. Report and fix
1192 from sparrowhawk996@gmail.com
1195 - rl_trim_arg_from_keyseq: take a key sequence and its length and
1196 return the index into the key sequence following any initial numeric
1197 argument. Return -1 if there is no numeric argument (the caller is
1198 expected to make sure) or if the key sequence consists *only* of
1199 the numeric argument. The caller should use the remainder of the
1200 key sequence to look up the desired key binding.
1202 lib/readline/readline.h
1203 - rl_trim_arg_from_keyseq: extern declaration
1206 - bash_execute_unix_command: if the argument count is > 1 or we have
1207 an explicit argument, call rl_trim_arg_from_keyseq to get past the
1208 numeric argument and deal with the rest of the key sequence. We still
1209 need a way to pass it to the invoked program or function. From
1210 a report from Jesper Nygards <jesper.nygards@gmail.com>
1216 - bash_execute_unix_command: if the user supplied a numeric argument
1217 when invoking bash_execute_unix_command, pass it to the command in
1218 the READLINE_ARGUMENT variable
1220 lib/readline/readline.[ch]
1221 - _rl_del_executing_keyseq: convenience function to `delete' the last
1222 character added to the executing key sequence. Intended to be used
1223 before calling rl_execute_next or similar functions that push input
1226 doc/{bash.1,bashref.texi}
1227 - READLINE_ARGUMENT: documented new variable available for commands
1228 defined using `bind -x' keybindings
1230 lib/readline/doc/rltech.texi
1231 - rl_trim_arg_from_keyseq: documented new function
1236 builtins/evalstring.c
1237 - should_suppress_fork: suppress the fork if we're in a process
1238 substitution subshell, in addition to being a simple command
1239 without redirections. From a report back in 10/2020 from
1240 Hyunho Cho <mug896@gmail.com>
1243 - command_word_completion_function: if we're trying to complete an
1244 absolute program (one containing a slash), don't run strcmp or
1245 strcasecmp on the return value from rl_filename_completion_function,
1246 since that duplicates work the filename completion function already
1247 does. From a report back in 1/2021 by awa54@cdak.net
1252 - CHECK_FOR_RESERVED_WORD: if we are returning an ESAC and unsetting
1253 PST_CASESTMT, decrement esacs_needed_count
1256 - sh_parser_state_t: save and restore esacs_needed_count and
1257 expecting_in_token in the shell parser state struct and
1258 save_parser_state/restore_parser_state
1261 - print_simple_command: don't bother to call command_print_word_list
1263 - print_simple_command: don't print a space before a redirection list
1264 if there weren't any command words to print
1269 lib/sh/input_avail.c
1270 - nchars_avail: make sure SET and OSET are declared on systems with
1271 select(2). Reported by Larkin Nickle <me@larbob.org>
1274 - cond_term: if we read a `!' toggle CMD_INVERT_RETURN instead of
1275 setting it unconditionally. Report and patch from
1276 Vincent Menegaux <vincent.menegaux@gmail.com> via
1277 https://savannah.gnu.org/patch/?10070
1281 doc/{bash.1,bashref.texi}
1282 - test: add the ( $2 $3 ) case to the description of the four-argument
1283 behavior. Inspired by a discussion with Christoph Anton Mitterer
1284 <calestyo@scientia.net>
1289 - replace most of the GNU parallel section with a reference to the
1293 - GX_NEGATE: new flag; indicates whether the pattern is being negated
1294 as part of an extglob pattern. Not used yet
1297 - extglob_skipname,wextglob_skipname: pass GX_NEGATE to the skipname
1298 functions if the pattern is being negated. Not checked yet
1302 doc/{bash.1,bashref.texi}
1303 - dotglob: add text to clarify that `.' and `..' have to be matched by
1304 a pattern beginning with `.' or -- and this is the sketchy part --
1305 that a pattern beginning with `.' has to be one of the patterns in
1306 an extended glob expression
1309 - skipname,wskipname: perform the special checks for `.' only if the
1310 pattern is not being negated
1315 - eol_ungetc_lookahead: save and restore as part of the parser state
1316 included in {save,restore}_parser_state
1320 lib/readline/display.c
1321 - puts_face: make sure to cast each member of STR to unsigned char, so
1322 it's not misinterpreted as EOF, which putc_face does not display.
1323 Report and fix from Volodymyr Prodan <vovcat@gmail.com> in
1324 https://savannah.gnu.org/patch/?10076
1327 - aix*gcc: change SHOBJ_LD to ${CC}, prefix the SHOBJ_LDFLAGS flags
1328 with -Wl, so gcc will pass them to the linker. Report from
1329 lehel@maxer.hu in https://savannah.gnu.org/support/?110505
1333 doc/{bash.1,bashref.texi}
1334 - cd: additional arguments are not ignored; they raise an error.
1335 Report from Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
1338 - FNM_DOTDOT: enable special handling for `.' and `..': if FNM_PERIOD
1339 is not set, `.' and `..' at the start of a string or as a pathname
1340 component need to be matched by a `.' in the pattern and cannot be
1341 matched by `?', `*', or a bracket expression
1344 - glob_vector: pass FNM_DOTDOT to strmatch() if noglob_dot_filenames
1345 is not set to enable special handling of `.' and `..'. Prompted by a
1346 discussion with Nora Platiel <nplatiel@gmx.us>
1347 - skipname,wskipname: remove special checks for `.' and (disabled)
1351 - GMATCH: implement special handling for FNM_DOTDOT and `.' and `..':
1352 make sure they can't be matched by any special glob characters at
1353 the start of the string or as a pathname component (if FNM_PATHNAME
1354 is set). This also means that !(pattern) won't return `.' or `..'
1356 - GMATCH,EXTMATCH: don't pass FNM_DOTDOT down to recursive calls, like
1357 FNM_PERIOD, once we process the first character in the string or
1361 - ISDIRSEP,PATHSEP,SDOT_OR_DOTDOT,PDOT_OR_DOTDOT: provide definitions
1362 for single-byte or wide character strings for sm_loop.c to use
1367 doc/{bash.1,bashref.texi},lib/readline/doc/{rluser,rltech}.texi
1368 - slight wording changes to rewrite gender-specific language. From a
1369 report by Vipul Kumar <kumar+bug-bash@onenetbeyond.org>, suggested
1370 language from G. Branden Robinson <g.branden.robinson@gmail.com>,
1371 Lawrence Velázquez <vq@larryv.me>,
1372 and Andrew Church <achurch+bash@achurch.org>
1375 - fc_builtin: make sure an entry in the history list is non-null
1376 before trying to write it to stdout or the temporary file. From a
1377 report from Sibo Dong <sibo.dong@outlook.com>
1379 builtins/common.[ch]
1380 - builtin_arrayref_flags: given a WORD_DESC * (which includes flags)
1381 and a base set of flags, return a set of flags to pass to
1382 valid_array_reference and similar functions
1385 - unset_builtin: call builtin_arrayref_flags to set vflags
1391 - parse_comsub: rewrite to recursively call the parser (yyparse()) and
1392 return a string constructed from the resulting parse tree. Probably
1393 will only work with bison. Error reporting is more accurate about
1394 line numbers and invalid tokens, and command substitution errors
1395 are caught earlier, before expansion
1396 - DOLPAREN: new token, never created by yylex; only ever set by
1397 parse_comsub and xparse_dolparen to indicate we're recursively
1398 calling the parser for a command substitution
1399 - comsub: new grammar production that's triggered by DOLPAREN and
1400 parses a command substitution, returning a <command>. It's one of
1401 the possible end states for the top-level parser
1402 - grammar: only call rewind_input_string if the shell's input is
1403 coming from a string
1404 - shell_ungets: push a string back onto the shell input; only used by
1405 make_here_document for backwards compatibility -- allowing a here-
1406 document to be terminated by a token at the end of a command
1408 - yylex: don't need any more special handling when returning
1409 shell_eof_token, but we keep the clause for future work
1410 - read_token_word: don't handle backslashes (leave them in the input
1411 stream) if we are reading a command substitution (PST_NOEXPAND)
1412 - reserved_word_acceptable: allow reserved words after DOLPAREN
1413 - report_syntax_error: better error handling if we hit EOF while
1414 looking for the ending right paren in a command substitution
1415 - parse_string_to_word_list,parse_compound_assignment: make sure to
1416 turn off parse_comsub sentinel temporarily
1419 - make_here_document: backwards compatibility: if we end a here
1420 document on the same line as the end of a command substitution,
1421 allow the token to terminate the here document (without requiring
1422 a newline) and push the remainder of the line back for the parser
1423 to consume and terminate the command substitution
1425 builtins/evalstring.c
1426 - parse_string: if we read shell_eof_token and use it to terminate a
1427 command, rewind the input string here before returning, instead of
1428 guessing where to rewind it in the caller
1434 - do_redirection_internal: if VARASSIGN_REDIR_AUTOCLOSE is non-zero,
1435 add a redirect to automatically close {var}<fn and other styles of
1436 varassign redirection. It's zero by default
1439 - varredir_close: new shell option, mirrors the value of
1440 varassign_redir_autoclose. Suggested multiple times by multiple
1443 doc/{bash.1,bashref.texi}
1444 - varredir_close: document new shell option (the name is tentative)
1450 - yylex: if read_token returns a value < 0, return YYerror to the
1452 - parse_comsub: if the current_token is not shell_eof_token when
1453 yyparse returns, return an error to read_token_word instead of
1454 trying to keep parsing. Fixes interactive-only (?) bug reported by
1455 Koichi Murase <myoga.murase@gmail.com>
1458 - PST_NOERROR: don't print error messages in yyerror(), just reset
1459 the parser and return
1462 - yyerror: if parser_state & PST_NOERROR, don't print an error message
1463 - xparse_dolparen: if the flags includes SX_COMPLETE, add PST_NOERROR
1464 to parser_state, to inhibit error messages. Fixes bug with adding
1465 lines with incomplete command substitutions to the history list
1466 reported by Koichi Murase <myoga.murase@gmail.com>
1469 - skip_matched_pair: make sure to pass the SX_COMPLETE flag to
1470 extract_delimited_string
1476 - rl_trim_arg_from_keyseq: handle rl_vi_arg_digit if VI_MODE is
1477 defined. Report and fix from Koichi Murase <myoga.murase@gmail.com>
1478 - rl_trim_arg_from_keyseq: rework to handle case where the digit
1479 argument is given as a discrete sequence of multiple rl_digit_argument
1480 commands (e.g, "M-1 M-2" instead of "M-1 2"). Report and fix from
1481 Koichi Murase <myoga.murase@gmail.com>
1484 - pat_subst: avoid calling RESIZE_MALLOCED_BUFFER with STRLEN(s) as an
1485 argument, since it ends up going into a loop. Report and fix from
1486 Koichi Murase <myoga.murase@gmail.com>
1489 - cval: take the string length as an argument, to avoid having to call
1490 strlen every time (in HANDLE_MULTIBYTE mode). The caller already has
1491 this info. Report and fix from Koichi Murase <myoga.murase@gmail.com>
1493 builtins/complete.def
1494 - print_cmd_name: single-quote the command name if it contains any
1495 shell metacharacters
1496 - print_one_completion: call print_arg with a second arg of 1 if the
1497 function name contains shell metacharacters. Report and fix from
1498 Koichi Murase <myoga.murase@gmail.com>
1504 - substitute BASE_CFLAGS_FOR_BUILD and STYLE_CFLAGS into Makefile
1506 - take STYLE_CFLAGS out of the CFLAGS_FOR_BUILD variable that gets
1508 - remove STYLE_CFLAGS from CFLAGS
1509 - use `:+' expansion to set variables based on whether $GCC is set
1510 or null, since configure can do GCC=
1513 - man2html: remove CCFLAGS_FOR_BUILD from the recipe, leaving only
1514 LDFLAGS_FOR_BUILD. Report from Jay K <jayk123@hotmail.com>
1515 - gen-helpfiles: remove CCFLAGS_FOR_BUILD from the recipe, leaving
1516 only LDFLAGS_FOR_BUILD
1517 - man2html: use $(STYLE_CFLAGS) in BASE_CCFLAGS variable for C file
1520 {,builtins}/Makefile.in, lib/{sh,readline,malloc,glob}/Makefile.in
1521 - use STYLE_CFLAGS so specifying CFLAGS=-g to make doesn't clutter the
1522 output with warnings about parens and format strings
1526 lib/readline/search.c
1527 - make_history_line_current: call _rl_free_saved_history_line to clean
1528 up _rl_saved_line_from_history and get all the code that frees it
1532 - _rl_free_saved_history_line: if rl_undo_list points to the data
1533 member of _rl_saved_line_from_history, set it to NULL to avoid having
1534 it point to freed memory, since the next thing we do now is to free
1535 the undo list the data member points to
1536 - _rl_start_using_history: call _rl_free_saved_history_line instead of
1537 calling _rl_free_history_entry directly. Fixes memory leak reported
1538 by Trung Dam <trungdam@yahoo.com>
1542 lib/readline/search.c
1543 - make_history_line_current: free rl_undo_list before replacing the
1544 current line with the line from history, since it is a private
1545 undo list from reading the search string
1547 lib/readline/rlmbutil.h
1548 - Since wchar_t/mbrtowc/wcrtomb are limited to 16 bits on Windows
1549 with MSVC, start abstracting the differences using WCHAR_T/
1555 lib/readline/{complete,display,input,text,util,vi_mode}.c
1556 - use WCHAR_T/MBRTOWC/WCRTOMB. Part of a set of Windows MSVC fixes
1557 from sparrowhawk996@gmail.com
1559 builtins/{enable,hash,help}.def
1560 - enable_builtin: use sh_chkwrite after output to check for write errors
1565 - quote_compound_array_word: free SUB and VALUE after assigning from
1566 sh_single_quote(). From a coverity report from
1567 Siteshwar Vashisht <svashisht@redhat.com>
1570 - bash_remove_history_range: free DISCARD_LIST after freeing its
1574 - bash_directory_expansion: add code to free D as a separate branch,
1575 though it's never hit in practice
1578 - showtrap: free T even if show_default == 1 if it's a non-default
1584 - execute_coproc: free NAME on invalid identifier error
1587 - glob_vector: make sure NEXTLINK is allocated using malloc before
1588 passing it to free()
1589 - glob_filename: free RESULT before returning glob_error_return when
1590 there is only a filename
1593 - indirection_level_string: make sure we free PS4 after calling
1594 decode_prompt_string if *ps4 == 0
1597 - parameter_brace_transform: if vtype == VT_VARIABLE, we need to free
1601 - assign_in_env: if NAME is not a valid shell identifier, free it
1602 after printing the error message and before returning. These are
1603 the rest of the fixes from Siteshwar Vashisht <svashisht@redhat.com>
1608 - main: set dollar_vars[0] to shell_script_filename before calling
1609 run_startup_files() in the non-interactive case. Restore it after
1610 run_startup_files returns so we can get better error messages if
1611 we can't open a script file. Suggested by several people, originally
1612 by Marc Aurèle La France <tsi@tuyoix.net> back in 2/2021 (in a
1613 different form) and most recently by Tapani Tarvainen
1614 <bash@tapanitarvainen.fi>
1619 - any_signals_trapped: return that a signal is trapped only if it's
1620 not ignored. This is an additional opportunity for optimization,
1621 reported in https://bugzilla.redhat.com/show_bug.cgi?id=1981926
1625 examples/loadables/sleep.c
1626 - main: if the uconvert conversion fails, but the argument appears to
1627 contain a GNU-like interval specifier like "1m30s", return
1628 EX_DISKFALLBACK so the execute_builtin code tries to run the
1632 - enable_shell_builtin: if the builtin isn't found, return EX_NOTFOUND
1633 to allow the caller (enable_builtin) to react differently if it
1635 - dyn_load_builtin: if the shared object isn't found, return EX_NOTFOUND,
1636 change enable_builtin to deal with it
1637 - enable_builtin: if there are no supplied options, and we attempt to
1638 enable a non-existent builtin, try modifying `enable name' to the
1639 equivalent of `enable -f name name' and return success if we
1640 successfully load a builtin from a shared object. Proposed several
1641 times, most recently by Robert Elz <kre@munnari.OZ.AU>
1643 doc/{bash.1,bashref.texi}
1644 - enable: document new behavior of `enable NAME' when NAME is not a
1645 current shell builtin
1650 - GMATCH: check for interrupts or terminating signals each time through
1651 the loop and return FNM_NOMATCH immediately if received. Let the
1652 higher layers deal with interrupting the match and jumping out.
1653 Inspired by a report from andrej@podzimek.org
1658 - {parameter_brace_remove_pattern,parameter_brace_transform,
1659 parameter_brace_substring,parameter_brace_casemod,
1660 parameter_brace_patsub}: make sure the IND argument is of type
1661 arrayind_t to handle the full range of subscripts. Reported by
1665 - printf_builtin: take new format specifier: %Q. This acts like %q
1666 but applies any supplied precision to the original unquoted
1667 argument, then quotes that result and outputs the entire quoted
1668 string, preserving the original field width. Originally suggested
1669 back in 4/2020 by Sam Liddicott <sam@liddicott.com>
1672 - char_is_quoted: check whether or not we are on the second or later
1673 line of a command with an unclosed quoted string from a previous
1674 line. If we are, see if it's closed before the character we're
1675 checking, so we don't interpret a closing quote as starting a new
1676 quoted string. Reported several times, most recently by
1677 Phi Debian <phi.debian@gmail.com> in 6/2021.
1682 - locale_expand: if the variable SINGLEQUOTE_TRANSLATIONS is non-zero,
1683 single-quote the translated result of $"..." (if it's different from
1684 the untranslated string)
1687 - noexpand_translation: new option to expose the value of
1688 SINGLEQUOTE_TRANSLATIONS
1692 doc/{bash.1,bashref.texi}
1693 - noexpand_translation: add description of new option
1698 - printf_builtin: initialize retval after parsing arguments, since we
1699 use it for the `v' option. Bug report from Keith Thompson
1700 <Keith.S.Thompson@gmail.com>
1703 - u32tocesc: fix typo that returned \uXXXXXXXX instead of \UXXXXXXXX.
1704 From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992257 by
1705 <nabijaczleweli@nabijaczleweli.xyz>
1710 - include command.h before general.h for PARAMS and prototypes. Report
1711 from Osipov, Michael (LDA IT PLM) <michael.osipov@siemens.com>
1715 lib/readline/colors.c
1716 - S_ISBLK: make sure it's defined before we use it, like in complete.c
1718 lib/readline/complete.c,{bashline,variables}.c
1719 - minor changes to prep for making rl_completer_word_break_characters
1722 subst.[ch],pcomplete.c
1723 - split_at_delims: the DELIMS argument is now `const'; change callers
1725 lib/readline/rlmbutil.h
1726 - _rl_wcwidth: add function prototype for inline function declaration
1729 - _rl_get_keyname: print keys greater than 160 (which are valid UTF-8)
1730 as octal escape sequences
1733 - do_lowercase_version: return 99999 to prevent the linker from
1734 combining it with _rl_null_function and optimizing away the separate
1735 copy. That messes with function pointer comparisons. Part of this
1736 batch of fixes from sparrowhawk996@gmail.com
1740 complete.c,readline.c,readline.h
1741 - rl_completer_word_break_characters: now const char * like
1742 rl_basic_word_break_characters; element of readline state struct
1743 used to save it also const. THIS IS AN API CHANGE
1746 - orig_rl_completer_word_break_characters: now const char * like
1747 rl_completer_word_break_characters
1752 - bash_directory_completion_hook: if direxpand and dirspell are both
1753 set while trying to complete an absolute pathname as a command, don't
1754 take a spell-corrected directory name that is shorter than the
1755 original hint. https://bugzilla.redhat.com/show_bug.cgi?id=1782809
1757 builtins/common.[ch]
1758 - sh_noassign: convenience function to print an error message when a
1759 user attempts an assignment to a "noassign" variable. Not used yet
1762 - assoc_to_kvpair_list: new function, returns a WORD_LIST containing
1763 key-value pairs as separate words
1766 - array_to_kvpair_list: new function, returns a WORD_LIST containing
1767 index-value pairs as separate words
1770 - string_transform: handle '@k' transform like '@K'
1771 - valid_parameter_transform: 'k' is a valid transform operator
1772 - array_transform: handle '@k' transformation by calling one of
1773 array_to_kvpair_list or assoc_to_kvpair_list and treating the
1774 result as if expanding the array depending on whether the index is
1775 `@' or `*' with the usual meanings
1777 doc/{bash.1,bashref.texi}
1778 - document new '@k' parameter transformation operator
1783 - rl_unix_filename_rubout: handle pathnames that consist only of one
1784 or more slashes. The old code went too far and deleted the previous
1785 word as well. From dabe@dabe.com
1790 - STRING_SAVER: now save and restore shell_input_line_len; not sure
1791 why it wasn't done before; fix push_string and pop_string accordingly
1792 - prompt_again: now takes a parameter FORCE; not used yet (every
1793 caller passes 0), needs more thought
1795 builtins/evalstring.h
1796 - open_redir_file: broke code that expands the redirection and opens
1797 the resultant filename into a new function, called from cat_file
1800 - open_redir_file: extern declaration here for now
1802 builtins/evalstring.c
1803 - parse_string: takes a new argument: COMMAND **cmdp; if non-null, saves
1804 the parsed command to *cmdp and lets the caller manage it itself.
1805 global_command is still not modified. Changed callers in parse.y
1810 - parse_string_to_command: stripped-down version of xparse_dolparen
1811 that takes a string, runs it through the parser, and returns the
1812 resultant COMMAND *; uses parse_string with the new argument
1815 - parse_string_to_command: extern declaration
1817 builtins/evalstring.c
1818 - can_optimize_cat_file: new function, takes a COMMAND * argument and
1819 returns true if the command can be optimized like $(<file); changed
1820 parse_and_execute to call it
1823 - optimize_cat_file: new function, optimizes $(<file) without creating
1824 a new process. Uses redir_open to open the redirection file, after
1825 expansion, and calls read_comsub to read from it directly
1826 - read_comsub: now reads into a 4096 byte buffer (COMSUB_PIPEBUF)
1827 - command_substitute: if the string begins with a `<' and isn't followed
1828 by any of "<>&", see if we can optimize the command and call
1829 optimize_cat_file to do it if we can.
1833 configure.ac,config.h.in,lib/sh/setlinebuf.c
1834 - SETVBUF_REVERSED: remove all references
1836 configure.ac,aclocal.m4
1837 - AC_OUTPUT: move created files and commands to AC_CONFIG_FILES and
1838 AC_CONFIG_COMMANDS; call AC_OUTPUT without any arguments
1839 - require autoconf version 2.63
1840 - AC_HELP_STRING -> AS_HELP_STRING
1841 - replace references to $ac_cv_prog_gcc with $GCC
1842 - AC_C_LONG_DOUBLE -> AC_TYPE_LONG_DOUBLE
1843 - enable-alt-array-implementation: new configure option, placeholder
1847 - stddef.h: include if HAVE_STDDEF_H is defined, not STDC_HEADERS
1850 - memory.h: don't include any more; assume <string.h> has all the
1854 - AC_HEADER_STDC: remove AC_REQUIRE calls to this; change tests to use
1855 appropriate checks instead of STDC_HEADERS
1859 configure.ac,config.h.in
1860 - AC_TYPE_SIGNAL,BASH_TYPE_SIGHANDLER: remove calls, remove mention of
1861 RETSIGTYPE and VOID_SIGHANDLER
1862 - AC_USE_SYSTEM_EXTENSIONS: use this instead of AC_ISC_POSIX (which is
1863 well and truly obsolete) and AC_MINIX (which just calls it anyway).
1864 All the right defines are already present
1865 - AC_HEADER_TIME: removed
1866 - AC_HEADER_STDC: removed
1867 - AC_DECL_SYS_SIGLIST: replaced with BASH_DECL_SYS_SIGLIST
1868 - BASH_FUNC_CTYPE_NONASCII: removed
1870 sig.h,lib/readline/signals.c
1871 - RETSIGTYPE -> void, SIGHANDLER_RETURN -> return
1874 - don't bother with TIME_WITH_SYS_TIME, just include <sys/times.h> if
1875 we have it and include <time.h> unconditionally
1877 include/chartypes.h,lib/readline/chardefs.h
1878 - IN_CTYPE_DOMAIN: no longer uses STDC_HEADERS define, checks against
1879 CHAR_MAX for non-C89 systems, still a no-op on C89 systems
1881 lib/readline/chardefs.h
1882 - memory.h: don't include, no need for STDC_HEADERS; assume the mem*
1883 functions are defined in <string.h> as in C89
1884 - now that we assume IN_CTYPE_DOMAIN bounds its argument to unsigned
1885 chars, we don't need NON_NEGATIVE checks at all
1887 lib/readline/chardefs.h,util.c
1888 - ALPHABETIC -> _rl_alphabetic_p
1894 - include <posixtime.h> after reworking above; include <sys/types.h>
1895 unconditionally in case it defines time_t. From a report by
1896 Ori Sky Farrell <bash@ori.mx>
1900 lib/readline/search.c
1901 - rl_history_search_internal: set rl_undo_list to NULL after calling
1902 rl_maybe_save_line, since it will be restored one way or another
1903 after the search completes, and we don't want it to be freed twice
1904 - rl_history_search_internal: leave the current history offset at the
1905 position of the last matching history entry. This means that things
1906 like ^P will start back from that history entry, ^N will move
1907 forward from there, and operate-and-get-next will work like it does
1908 with incremental searches. Reported by Vandrus Zoltán
1909 <vandrus.zoltan@gmail.com>
1914 - BASH_C_LONG_LONG: removed
1915 - BASH_TYPE_LONG_DOUBLE: removed
1916 - BASH_TYPE_LONG_LONG,BASH_TYPE_UNSIGNED_LONG_LONG: removed
1917 - BASH_FUNC_CTYPE_NONASCII: removed
1918 - BASH_SYS_SIGNAL_VINTAGE,BASH_SYS_REINSTALL_SIGHANDLERS: don't
1919 require AC_TYPE_SIGNAL, use void instead of RETSIGTYPE
1920 - BASH_TYPE_SIGHANDLER: removed
1922 configure.ac,aclocal.m4,config.h.in
1923 - BASH_TYPE_LONG_LONG: removed, call AC_TYPE_LONG_LONG_INT directly,
1924 change #define to HAVE_LONG_LONG_INT
1925 - BASH_TYPE_UNSIGNED_LONG_LONG: removed, call AC_TYPE_UNSIGNED_LONG_LONG_INT
1926 directly, change #define to HAVE_UNSIGNED_LONG_LONG_INT
1928 externs.h,include/typemax.h,lib/sh/{fmtullong,snprintf,strtoimax,strtoll,
1929 strtoull,strtoumax}.c
1930 - HAVE_LONG_LONG -> HAVE_LONG_LONG_INT
1931 - HAVE_UNSIGNED_LONG_LONG -> HAVE_UNSIGNED_LONG_LONG_INT
1934 - AC_TRY_COMPILE -> AC_COMPILE_IFELSE
1935 - BASH_CHECK_TYPE (intmax_t) -> AC_TYPE_INTMAX_T
1936 - BASH_CHECK_TYPE (uintmax_t) -> AC_TYPE_UINTMAX_T
1937 - BASH_CHECK_TYPE (sig_atomic_t): removed
1940 - BASH_FUNC_STRSIGNAL: changed to use AC_LINK_IFELSE
1941 - BASH_FUNC_LSTAT: changed to use AC_LINK_IFELSE
1942 - BASH_FUNC_SBRK: changed to use AC_LINK_IFELSE and AC_RUN_IFELSE,
1944 - BASH_CHECK_SPEED_T: changed to use AC_COMPILE_IFELSE
1945 - BASH_TYPE_SIG_ATOMIC_T: use BASH_CHECK_TYPE instead of AC_CHECK_TYPE
1946 - BASH_STRUCT_DIRENT: new macro, like _AC_STRUCT_DIRENT but public and
1947 sets a different bash-specific shell variable
1948 - BASH_STRUCT_DIRENT_D_{INO,FILENO,NAMLEN}: call BASH_STRUCT_DIRENT
1949 with a different first argument instead of using inline code and
1954 [prayers for the victims of 9/11/2001]
1957 - BASH_CHECK_DECL: just call AC_CHECK_DECLS and use the default
1958 includes, which includes the files we used to specify
1959 - BASH_FUNC_INET_ATON: changed to use AC_LINK_IFELSE
1960 - BASH_STRUCT_WEXITSTATUS_OFFSET: changed to use AC_RUN_IFELSE
1961 - BASH_FUNC_OPENDIR_CHECK: changed to use AC_RUN_IFELSE
1962 - BASH_FUNC_ULIMIT_MAXFDS: changed to use AC_RUN_IFELSE
1963 - BASH_UNDER_SYS_SIGLIST: changed to use AC_RUN_IFELSE
1964 - BASH_SYS_SIGLIST: changed to use AC_RUN_IFELSE
1965 - BASH_FUNC_DUP2_CLOEXEC_CHECK: changed to use AC_RUN_IFELSE
1966 - BASH_FUNC_GETENV: changed to use AC_RUN_IFELSE
1967 - BASH_FUNC_GETCWD: changed to use AC_RUN_IFELSE
1968 - BASH_FUNC_FNMATCH_EXTMATCH: changed to use AC_RUN_IFELSE
1969 - BASH_FUNC_POSIX_SETJMP: changed to use AC_RUN_IFELSE
1970 - BASH_FUNC_STRCOLL: changed to use AC_RUN_IFELSE
1971 - BASH_FUNC_PRINTF_A_FORMAT: changed to use AC_RUN_IFELSE
1972 - BASH_SYS_PGRP_SYNC: changed to use AC_RUN_IFELSE
1973 - BASH_SYS_SIGNAL_VINTAGE: changed to use AC_RUN_IFELSE
1974 - BASH_SYS_NAMED_PIPES: changed to use AC_RUN_IFELSE
1975 - BASH_CHECK_RTSIGS: changed to use AC_RUN_IFELSE
1976 - BASH_CHECK_MULTIBYTE: changed to use AC_RUN_IFELSE
1977 - RL_LIB_READLINE_VERSION: changed to use AC_RUN_IFELSE
1978 - BASH_CHECK_WCONTINUED: changed to use AC_RUN_IFELSE
1979 - BASH_FUNC_SNPRINTF: changed to use AC_RUN_IFELSE
1980 - BASH_FUNC_VSNPRINTF: changed to use AC_RUN_IFELSE
1981 - BASH_FUNC_FNMATCH_EQUIV_FALLBACK: changed to use AC_RUN_IFELSE
1982 - BASH_DECL_PRINTF: changed to use AC_RUN_IFELSE
1983 - BASH_TYPE_RLIMIT: rewrote to avoid quad_t, now uses AC_COMPILE_IFELSE
1984 to determine whether rlim_t is available, otherwise determines the
1985 value of RLIMTYPE based on sizeof(rlim.rlim_cur): int, long, or
1987 - BASH_SIZEOF_RLIMIT,BASH_SIZEOF_QUAD_T: helper macros for
1988 BASH_TYPE_RLIMIT in the case that rlim_t is not present
1991 - BASH_CHECK_DECL -> AC_CHECK_DECLS
1992 - quad_t: use AC_CHECK_TYPE (new style) instead of BASH_CHECK_TYPE
1998 - time_command: if we longjmp back to the top_level we saved, make sure
1999 we're in the same subshell environment before printing the timing
2000 stats. We could have longjmped back from a child process of the
2001 command or pipeline we want to time. From a report by
2002 Sergej Alikov <sergej@alikov.com>
2003 - time_command: restore command->flags even if we longjmp back
2006 - check_binary_file: if the first line of the ENOEXEC file starts with
2007 a `#!', check the rest of the buffer for NULs to determine whether
2008 this is a binary file. Since we only check the first line, a #! line
2009 followed by binary data could be confused for a shell script
2014 - EXITBLTIN: new longjmp `code' value: used by the exit builtin
2016 {execute_cmd,shell,subst,trap}.c,builtins/evalstring.c
2017 - treat EXITBLTIN exactly the same as EXITPROG (for now)
2020 - exit_builtin: jump_to_top_level with value EXITBLTIN
2022 builtins/evalstring.c
2023 - parse_and_execute: EXITBLTIN has its own case, with the same contents
2028 builtins/evalstring.c
2029 - parse_and_execute: change EXITBLTIN case to avoid running the
2030 unwind-protect stack to the `pe_dispose' tag (which has the effect
2031 of running all the unwind-protects installed by the commands in
2032 the string) if we're executing in a function and EXIT is trapped.
2033 This has the effect of running the EXIT trap in the function context,
2034 which is what we do when we're not in parse_and_execute (eval,
2035 bash -c, command substitution, etc.)
2040 - expand_and_quote_kvpair_word,quote_compound_array_word,
2041 expand_and_quote_assoc_word,quote_compound_array_list: make sure
2042 the value has CTLESC characters doubled even when being single-
2043 quoted, since that's what the parser does with standalone assignment
2044 statements. From https://savannah.gnu.org/support/?110538
2049 - AC_TRY_COMPILE -> AC_COMPILE_IFELSE (AC_TRY_LINK calls left to
2050 modify to avoid obsolete warnings)
2051 - BASH_STRUCT_WINSIZE: broke out checks for separate headers into new
2052 macros, call them and work with the results; needed to avoid two
2053 calls to AC_TRY_COMPILE
2054 - BASH_CHECK_KERNEL_RLIMIT: avoid multiple calls to AC_TRY_COMPILE by
2055 breaking basic test for RLIMIT_ defines into a separate test and
2056 calling the HPUX-specific _KERNEL test only if that fails
2058 m4/gettext.m4,configure.ac
2059 - AM_GNU_GETTEXT -> BASH_GNU_GETTEXT: remove deprecation warning, since
2060 [no-libtool] is how we use this; rename to avoid someone's local
2061 copy from overriding ours
2066 - BASH_CHECK_MULTIBYTE: take out code that checks for nl_langinfo(CODESET)
2067 since that's already provided by AM_LANGINFO_CODESET, which is
2068 called by BASH_GNU_GETTEXT. We AC_REQUIRE it here, though, to avoid
2069 problems from future changes
2070 - BASH_SYS_SIGNAL_VINTAGE: broke the code that checks for the different
2071 signal vintages into different AC_DEFUNed macros, changed
2072 BASH_SYS_SIGNAL_VINTAGE to stitch them together with shell code
2073 testing the cached variables
2074 - AC_TRY_LINK -> AC_LINK_IFELSE: there are no more autoconf warnings
2079 - array_from_argv: new convenience function
2082 - num_elements: now an arrayind_t, since that's the type of indices, it
2083 makes sense to allow that many elements
2087 lib/readline/terminal.c
2088 - rl_term_kP: fix typo. Fix from Koichi Murase <myoga.murase@gmail.com>
2092 lib/readline/display.c
2093 - rl_clear_visible_line: call _rl_clear_to_eol with _rl_screenwidth as
2094 the argument so we clear out the entire line even if the terminal
2095 doesn't have a clear-to-eol sequence; make sure to add a call to
2096 rl_cr after that so we know we're always in column 0
2097 - _rl_redisplay_after_sigwinch: just call rl_clear_visible_line instead
2098 of erasing the last line of the display
2099 - _rl_redisplay_after_sigwinch: if the prompt is longer than the screen
2100 width, make sure to call _rl_reset_prompt to recalculate the
2101 local_prompt_newlines array. Should fix issue from
2102 https://savannah.gnu.org/support/index.php?110543
2105 - do_redirection_internal: if given [N]<&WORD- or [N]>&WORD- and WORD
2106 expands to null, make it identical to <&- or >&- and close file
2107 descriptor N (default 0). From a discussion back in 5/2021
2112 - expand_compound_array_assignment: since we run the string through
2113 the parser to turn it into a list (so we can make sure all shell
2114 metacharacters are properly quoted), we need to remove the CTLESC
2115 the parser uses to quote CTLESC and CTLNUL in *unquoted* words.
2116 The rest of the code assumes this has been done, and assumes that
2117 any CTLESC characters passed to expansion are part of the original
2118 word and should themselves be quoted, doubling the number of CTLESCs
2123 - expand_and_quote_kvpair_word,quote_compound_array_word,
2124 expand_and_quote_assoc_word,quote_compound_array_list: if we are
2125 single-quoting associative array subscripts and associative and
2126 indexed array values, we need to quote CTLESC characters, because
2127 that's how they come out of the parser and how the assignment
2128 statement code expects to see them.
2129 Fixes https://savannah.gnu.org/support/index.php?110538
2134 - parameter_brace_transform: invalid transformation operators are now
2135 fatal errors in non-interactive shells, as with the other word
2136 expansions. Reported by Martin Schulte <gnu@schrader-schulte.de> in
2137 https://lists.gnu.org/archive/html/bug-bash/2020-10/msg00026.html
2140 - execute_disk_command: if we're optimizing out the fork (nofork) and
2141 not directly in a pipeline (pipe_in == pipe_out == NO_PIPE), only
2142 modify shell_level if subshell_environment says we're not already in
2143 a pipeline. Reported by Paul Smith <psmith@gnu.org> 10/11/2020
2147 - should_suppress_fork: remove #if 1 for code that tries to suppress
2148 the fork in a process substitution subshell
2152 builtins/mapfile.def
2153 - do_chop: make sure we're comparing unsigned chars when checking
2154 whether the delim is the last character on the line. Reported by
2155 Greg Wooledge <greg@wooledge.org>
2159 lib/readline/rltty.c
2160 - rl_deprep_terminal: if we're not echoing to the terminal
2161 (_rl_echoing_p == 0), and we just output the bracketed paste end
2162 sequence, output a newline to compensate for the \r at the end of
2163 BRACK_PASTE_FINI, since redisplay didn't do it for us. Reported by
2164 Siteshwar Vashisht <svashisht@redhat.com>
2167 - MATCH_EXPREP: new matching flag, understood only by pattern
2168 substitution; means to expand unquoted `&' in the replacement
2169 STRING to the match of PATTERN
2172 - shouldexp_replacement: uncommented
2173 - pat_subst: we expand & in the replacement string if MATCH_EXPREP
2175 - parameter_brace_patsub: push call to shouldexp_replacement out here,
2176 after the replacement string is expanded; set MATCH_EXPREP if there
2177 is an unquoted `&' (by backslash) in the expanded replacement
2180 doc/{bash.1,bashref.texi}
2181 - pattern substitution: overhauled the description, moved each of the
2182 possible forms to be tags in the tagged paragraph. The description
2183 now specifies the expansions that the replacement string undergoes
2184 - pattern substitution: documented new behavior of unquoted & in the
2190 - include <malloc/shmalloc.h> if we're debugging malloc (MALLOC_DEBUG)
2191 so we can get an extern declaration of trace_malloc_stats
2196 - expand_subscript_string: allocate new memory for td.word, copying
2197 STRING, in case it gets freed on error by expand_word_internal.
2198 Report and fix from Koichi Murase <myoga.murase@gmail.com>
2201 - malloc_usable_size: return the allocated size instead of the chunk
2202 size, since writing over the bounds checking will cause fatal errors.
2203 Reported by Julien Moutinho <julm+bash@sourcephile.fr>, fix from
2204 Dominique Martinet <asmadeus@codewreck.org>
2207 - unbind_array_elememnt: pass (flags&VA_NOEXPAND) to skipsubscript(),
2208 instead of unconditionally passing 1 if we're operating on an
2209 associative array. This is consistent with how valid_array_reference
2210 determines the length of the subscript.
2211 Report and fix from Koichi Murase <myoga.murase@gmail.com>
2217 - skip_to_delim: add a new value for FLAGS. If FLAGS&2, we assume that
2218 START is one character after the opening OPEN. If not, we assume that
2219 START is at OPEN, and needs to be incremented past it. Part of fix
2220 from Koichi Murase <myoga.murase@gmail.com>
2223 - unbind_array_element: make sure to pass FLAGS to skipsubscript with
2224 bit 2 set, since we are passed a SUB index that's one past the
2225 opening bracket. Rest of fix from
2226 Koichi Murase <myoga.murase@gmail.com>
2227 - array_variable_name: make sure we pass (FLAGS&1) to skipsubscript, so
2228 we don't inadvertently pass a value with bit 2 set, which would
2229 cause an off-by-one error in subscript parsing
2234 - restore_traps: inverse of reset_signal_handlers. This understands
2235 how reset_signal_handlers changes the signal disposition while
2236 leaving the trap string in place, and knows how to restore flags
2237 and state based on that preserved trap string and whether or not
2238 the signal is "special" to the shell.
2241 - exec_builtin: instead of using restore_original_signals to completely
2242 cancel the traps, call reset_signal_handlers so the trap strings are
2243 preserved. Then if the exec fails (and we're not exiting) we can
2244 look at the trap strings and see how to restore the trap state.
2245 This calls restore_traps after reinitializing the shell signal
2246 handlers, using the trap strings saved by reset_signal_handlers.
2247 Fixes issue with not exiting after a failed exec clearing the EXIT
2248 trap reported by Mark March <march@systempad.org>, using the
2249 approach suggested by Robert Elz <kre@munnari.OZ.AU>
2252 - expand_declaration_argument: when parsing options that modify
2253 attributes that affect how the value is handled (i, c, u, etc.),
2254 make sure to create an option string and call make_internal_declare
2255 with options that start with a `+' so the attribute is off when
2256 the assignment is performed and changes how the value is expanded.
2257 From a report by Léa Gris <lea.gris@noiraude.net>
2259 lib/readline/complete.c
2260 - rl_display_match_list: even if _rl_completion_prefix_display_length
2261 is set to a non-zero value, pass the common prefix length to
2262 fnprint if we've turned on colored completion prefixes; passes
2263 through to fnprint via print_filename
2264 - fnprint: add the ellipsis if prefix_bytes exceeds the
2265 _rl_completion_prefix_display_length, add explicit check for
2266 prefix_bytes being longer since print_filename passes it through
2267 if colored-completion-prefix is set. This means that while
2268 completion-prefix-display-length still has precedence over
2269 colored-completion-prefix, it doesn't override it if both are set
2270 and the common prefix length is shorter than
2271 completion-prefix-display-length. From a report by
2272 Christoph Anton Mitterer <calestyo@scientia.net>
2277 - parse_dparen: if the last token is FOR, increment word_top and assign
2278 word_lineno like for other for loops. Fixes bug with LINENO after
2279 arithmetic for commands reported by
2280 Tom Coleman <thomas.james.coleman@gmail.com>
2285 - shell_execve: if execve fails with ENOENT, but executable_file()
2286 succeeds, display a slightly more descriptive error message. Prompted
2287 by a report from Andrea Monaco <andrea.monaco@autistici.org>
2290 - strcreplace: allow backslash to escape a backslash, since we allow it
2296 - COMPLETE_HASH_BUCKETS: double to 512
2299 - strcreplace: the last argument is now a flags argument. 1 has its
2300 previous meaning (glob); 2 means to allow backslash to escape a
2301 backslash (as added on 10/11)
2304 - pat_subst: call strcreplace with 2 as the flags value
2309 - updates to Installation section
2311 doc/{mkposix,mkinst,mkrbash},doc/Makefile.in
2312 - changes to allow scripts to be run outside the source directory
2317 - patsub_replacement: controls whether pattern substitution expands `&'
2318 in the replacement string. Initialized to 1 by default
2322 doc/{bash.1,bashref.texi}
2323 - document bash's WCE SIGINT behavior when job control is not enabled
2324 and the shell receives a SIGINT while waiting for the foreground
2325 command to complete. Added at Red Hat's request. A complete
2326 discussion is at https://www.cons.org/cracauer/sigint.html
2331 - patsub_replacement: new shell option, exposes patsub_replacement
2332 variable controlling whether pattern substitution expands `&' in
2333 the replacement string. Still enabled by default.
2335 doc/{bash.1,bashref.texi}
2336 - patsub_replacement: document new shopt option
2340 lib/readline/display.c
2341 - expand_prompt: group runs of invisible characters at the right edge
2342 of the screen with the previous physical characters when setting
2343 local_prompt_newlines, since that's how update_line() expects to
2344 get it. Fix from sparrowhawk996@gmail.com.
2346 lib/readline/macro.c
2347 - rl_end_kbd_macro: make sure current_macro_index is > 0 after
2348 subtracting the key sequence length, clamp it to 0 before writing
2349 the ending NULL. From a fuzzing report by
2350 Tillmann Osswald <tosswald@ernw.de>
2352 lib/readline/isearch.c
2353 - _rl_isearch_dispatch: in the bracketed paste case, don't assume the
2354 pasted text is null-terminated, so use memcpy instead of strcpy for
2355 the length of the pasted text, then make sure the search string is
2356 null-terminated. From a fuzzing report by
2357 Tillmann Osswald <tosswald@ernw.de>
2360 - rl_transpose_words: make sure to preserve the value of rl_end from
2361 the beginning to the end of the function. From a fuzzing report by
2362 Tillmann Osswald <tosswald@ernw.de>
2364 lib/readline/vi_mode.c
2365 - rl_vi_delete_to,rl_vi_change_to,rl_vi_yank_to: if we are redoing a
2366 command (_rl_vi_redoing == 1), save the old _rl_vimvcxt, allocate a
2367 new one, and restore the old one before returning. Prevents some
2368 pointer aliasing problems. From a fuzzing report by
2369 Tillmann Osswald <tosswald@ernw.de>
2374 - tokenize_array_reference: take valid_array_reference and add a third
2375 argument (char **SUBP), which, if non-NULL, gets the null-terminated
2376 subscript parsed from the NAME argument. If it's NULL, the caller
2377 gets the old valid_array_reference behavior. Fix from
2378 Koichi Murase <myoga.murase@gmail.com>
2379 - valid_array_reference: just call tokenize_array_reference with a
2381 - unbind_array_element: assume the caller (unset_builtin) passes a
2382 null-terminated SUB that's already been validated by a call to
2383 tokenize_array_reference so we don't need to call skipsubscript() or
2384 check VA_ONEWORD. Fix from Koichi Murase <myoga.murase@gmail.com>
2387 - tokenize_array_reference: extern declaration
2390 - unset_builtin: use tokenize_array_reference to figure out T and pass
2391 that to unbind_array_element. Fix from
2392 Koichi Murase <myoga.murase@gmail.com>
2393 - unset_builtin: pass non-null argument to array_variable_part to get
2394 the length of the subscript (T), then cut off any final `]' before
2395 passing it to unbind_array_element, since that's what it now
2399 - expand_string_for_rhs,expand_string_for_pat: assign td.word from
2400 newly-allocated memory in case it gets freed on error during the
2401 call to call_expand_word_internal(); free it manually when that
2407 - search_for_command: if FLAGS includes CMDSRCH_STDPATH, don't look in
2408 the hash table for the command name. Prompted by a report from
2409 Roger Morris <roger.morris@gmail.com>
2412 - BASH_FUNC_POSIX_SETJMP: add a check by fetching the signal mask
2413 after the siglongjmp and making sure that SIGINT is not blocked,
2414 indicating we restored the original signal mask
2419 - expand_string_assignment: make sure to add W_TILDEEXP to the flags so
2420 expand_word_internal performs the right tilde expansion on tildes
2421 following an unquoted colon. Report from Anders Kaseorg
2428 - BASH_FUNC_POSIX_SETJMP: if cross-compiling, default to `present' if
2429 we've determined we have posix signal functions
2434 - SET_LINE_NUMBER: set line_number, but don't set line_number_for_err_trap
2435 if we're already running the ERR trap
2436 - GET_LINE_NUMBER: evaluates to line_number_for_err_trap if we're
2437 running the ERR trap and executing_line_number() otherwise
2438 - execute_function: use GET_LINE_NUMBER to push the value for the line
2439 number into the BASH_LINENO array
2440 - execute_command_internal,execute_arith_command,execute_cond_command:
2441 use SET_LINE_NUMBER to avoid overwriting line_number_for_err trap
2442 while executing the ERR trap. Tentative fix for `caller' problem
2443 reported by Quinn Grier <quinn@quinngrier.com>
2445 configure.ac,patchlevel.h
2446 - set bash version to 5.2-devel, meaning shell_compatibility_level = 52,
2447 which required updating tests (array.tests, array21.sub,
2448 quotearray3.sub, new-exp10.sub, history2.sub). The first three are
2449 because bash-5.2 flushes an indexed array but does not unset the
2450 variable when given `unset a[@]' or `unset[*]' (that is, it acts
2451 like `a=()' instead of `unset a'); the other two are because the
2452 version number changed
2457 - bash.info: use `makeinfo -o' instead of calling infopost.sh to edit
2458 the filename, since the tags table includes absolute byte offsets to
2459 nodes. From https://savannah.gnu.org/support/?110557
2463 examples/loadables/realpath.c
2464 - add -a NAME argument to put canonicalized pathnames into an indexed
2465 array instead of displaying them on stdout. Suggested by
2468 lib/readline/colors.c
2469 - _rl_custom_readline_prefix: new function, looks in $LS_COLORS for a
2470 custom extension (*.readline-colored-completion-prefix) and uses that,
2471 if found, as the default color for the common prefix displayed when
2472 `colored-completion-prefix' is set. Suggested by
2473 Christoph Anton Mitterer <calestyo@scientia.net>
2474 - _rl_print_prefix_color: try the return value from _rl_custom_readline_prefix
2475 before defaulting to the C_PREFIX (C_SOCK) color. Suggested by
2476 Christoph Anton Mitterer <calestyo@scientia.net>
2478 lib/readline/doc/{readline.3,rluser.texi},doc/bash.1
2479 - readline-colored-completion-prefix: document new custom suffix for
2480 readline's colored-completion-prefix color
2484 doc/{bash.1,bashref.texi},builtins/set.def
2485 - set: modify usage synopsis slightly, based on
2486 https://bugzilla.redhat.com/show_bug.cgi?id=2022324
2489 - unset_builtin: add shell compatibility level check <= bash-5.1 to
2490 force `unset a[@]' to unset array variable `a', like in previous
2491 versions, instead of unsetting associative array element `@' or
2492 removing all elements of an indexed array without unsetting the
2496 - set_expand_once: now a no-op if the shell compatibility level is
2497 <= bash-5.1, preserving the previous versions' behavior for [[ -v
2498 (dependent on assoc_expand_once instead of forcing it)
2501 - parameter_brace_expand_rhs: make sure that the final value assigned
2502 is always returned from ${a:=b}, even when `a' has a variable
2503 attribute that modifies the value on assignment. Reported back on
2504 1/20/2021 by oguzismailuysal@gmail.com; bash-5.2 tag removed
2508 doc/{bashref.texi,bash.1}
2509 - unset: change the description of `unset name[@]' (unset name[*])
2510 to reflect the new behavior (unset associative array subscripts or
2511 remove all elements from an indexed array) and the difference from
2513 - set: document -r for restricted shell mode
2514 - restricted shell: change occurrences of `set +o restricted' to
2515 `shopt -u restricted_shell'. From a report from
2516 Jin Xiang <jxiang.sd@gmail.com>
2517 - read: note that read -t0 may return 0 if a subsequent read will
2518 return EOF. From a suggestion by Dale R. Worley
2519 <worley@alum.mit.edu>
2522 - execute_arith_command,eval_arith_for_expr: don't pass EXP_EXPANDED
2523 to evalexp if shell_compatibility_level > 5.1, assuming that the
2524 expression has been quoted by Q_ARITH handling
2527 - test_arithcomp: if we're being called by the conditional command
2528 code and treating the arguments to the arithmetic operators as
2529 expressions, don't pass EXP_EXPANDED to evalexp if the shell
2530 compatibility level is > 5.1, assuming that the expression has been
2531 quoted by Q_ARITH handling
2535 examples/loadables/getconf.[ch]
2536 - getconf: new implementation of loadable builtin, based on glibc
2539 examples/loadables/sleep.c
2540 - parse_gnutimefmt: parse GNU interval format (2m30s), returning
2541 seconds and microseconds like uconvert
2542 - sleep: use parse_gnutimefmt if uconvert can't parse the format right
2543 away and "dhms" appears in the format string. Don't return
2544 EX_DISKFALLBACK under any circumstances
2550 - wait_builtin: refer to unset_waitlist only if JOB_CONTROL is enabled.
2551 Report from Joel Ebel <jbebel@google.com>
2553 parse.y,builtins/set.def
2554 - changes for minimal config restrictions
2556 configure.ac,config.h.in
2557 - --enable-translatable-strings: new configuration option to allow
2558 $"..." support to be compiled in or out; not included in the minimal
2562 - main: don't include any of the dump-strings options if
2563 TRANSLATABLE_STRINGS is not defined
2566 - sh_backslash_quote_for_double_quotes: needed for translatable strings
2569 - support for translating $"..." strings now conditional on
2570 TRANSLATABLE_STRINGS
2573 - locale_expand: now conditional on TRANSLATABLE_STRINGS
2576 - expand_string_dollar_quote: support for $"..." now conditional on
2577 TRANSLATABLE_STRINGS
2580 - --enable-translatable-strings: document new configuration option
2585 - verify_substring_values: now that the default compatibility level is
2586 52, and the Q_ARITH code is enabled, make the EXP_EXPANDED flag for
2587 evalexp() dependent on the compatibility level
2588 - param_expand: arithmetic substitution: make EXP_EXPANDED flag
2589 for evalexp() dependent on the compatibility level
2590 - expand_word_internal: don't call expand_array_subscript if the
2591 shell compatibility level is 51 or below (Q_ARITH)
2594 - test_unop: if the shell compatibility level is > 51, using [@] with
2595 an existing associative array will report on a key of `@'
2598 - array_expand_index: if the compatibility level is > 51, Q_ARITH is
2599 used and we don't pass EXP_EXPANDED to evalexp()
2601 COMPAT,doc/bashref.texi
2602 - shell compatibility mode: document effects of setting the
2603 compatibility mode to 51
2608 - mremap: only use if MREMAP_MAYMOVE is defined, since we use the Linux
2609 version of the function signature
2614 - bash_add_history: if we're parsing a here-document (PST_HEREDOC), only
2615 suppress adding the newline between lines if we're not at the first
2616 line of the here-document (here_doc_first_line != 0). From a report
2617 by S0AndS0 <strangerthanbland@gmail.com>
2621 lib/readline/colors.c
2622 - _rl_custom_readline_prefix: use STREQN to check for the extension
2623 string in $LS_COLORS, since it's not necessarily null-terminated.
2624 From https://savannah.gnu.org/patch/?10158
2629 - set_int_value,set_string_value: broke common code for setting int
2630 and string dynamic variable values out into separate functions;
2631 changed all callers to use them where appropriate. set_int_value
2632 takes a flags argument saying whether or not to force the integer
2634 - assign_random: store the value assigned as the variable value so
2635 things like RANDOM=42; RANDOM+=7 generate consistent sequences
2637 - assign_seconds: store the value assigned as the variable value so
2638 things like SECONDS=42 ; SECONDS+=7 generate what's expected
2641 - changes to allow man pages that include others (.so FN) to be built
2642 outside the source tree
2647 - assign_array_element_internal: take an additional argument: char **NVALP.
2648 If non-null, it gets the value eventually assigned to the array
2650 - assign_array_element: take an additional NVALP argument; pass it to
2651 assign_array_element_internal
2654 - assign_array_element: new extern function declaration
2656 {subst,variables}.c,builtins/{common.c,declare.def}
2657 - assign_array_element: change callers
2660 - parameter_brace_expand_rhs: for the ${param:=value}, use the value
2661 returned by assign_array_element in NVALP as the return value, since
2662 it's the value ultimately assigned to the variable after possible
2663 modification (e.g., arithmetic evaluation). Reported by
2664 oguzismailuysal@gmail.com after flawed fix applied 11/16
2669 - array_eltstate_t: an object that encapsulates an array element's
2670 state (type, index, key, value) whether it's an indexed or
2674 - {init,flush}_eltstate: new functions to initialize and flush any
2675 allocated memory from array_eltstate_t objects. No allocation/
2676 deallocation functions yet; the only use is with a static instance
2677 - assign_array_element_internal: take an array_eltstate_t * instead of
2678 a char ** as the final argument, so we can return keys/indices and
2679 values depending on the type of array; populates it with the
2681 - assign_array_element: take array_eltstate_t * as final argument
2682 instead of a char **; pass it to assign_array_element_internal
2684 {subst,variables}.c,builtins/{common.c,declare.def}
2685 - assign_array_element: change callers to modify final argument
2690 - array_value_internal: now takes an array_eltstate_t * as the final
2691 argument; there is no more `rtype' argument in favor of the
2692 `subtype' member; returns the appropriate values in its members
2693 - array_value: changed to pass array_eltstate_t to array_value_internal,
2694 saves and fetches its `ind' member into *indp; saves `subtype'
2696 - get_arrary_value: changed to take array_eltstate_t as third argument,
2697 passes it to array_value_internal
2700 - get_array_value: changed callers; initializing the array_eltstate_t
2701 argument as necessary
2704 - test_builtin: changed to use get_array_value, adding AV_ALLOWALL to
2705 the flags, since it didn't use any QUOTED argument. Pass
2706 array_eltstate_t * as final argument and get subtype from it (the
2707 only thing we're interested in, to deallocate memory)
2712 - array_value: now takes a final argument of array_eltstate_t *, which
2713 it passes to array_value_internal; no more rtype and indp args.
2714 Callers are responsible for marshalling values into estatep
2717 - array_value: changed function signature
2720 - get_var_and_type,parameter_brace_expand_word: changed calls to
2721 array_value to use array_eltstate_t argument and initialize it
2722 appropriately. Copy values back from it to the parameters we need
2726 - assign_lineno: call set_int_value to store the value, like with
2727 RANDOM and SECONDS (from 12/10)
2731 {eval,execute_cmd}.c
2732 - when bypassing a parsed command because read_but_dont_execute is
2733 set, don't modify last_command_exit_value. From a report by
2734 Robert Elz <kre@munnari.OZ.AU>
2737 - parse_comsub: make sure the first call to shell_getc to check whether
2738 or not it's an arithmetic expansion skips a quoted newline. From a
2739 report by Robert Elz <kre@munnari.OZ.AU>
2744 - parameter_brace_remove_pattern,parameter_brace_patsub,parameter_brace_casemod,
2745 parameter_brace_transform,parameter_brace_substring: now take an
2746 array_eltstate_t * argument in place of the arrayind_t argument, pass
2747 it to get_var_and_type; this generalizes the indexed array behavior
2748 of expanding array subscripts once to associative arrays via an
2749 eventual call to array_value_internal with a non-null KEY member
2750 - get_var_and_type: now takes an array_eltstate_t * argument in place
2751 of the arrayind_t argument; use it in calls to array_value so we
2752 can only expand array subscripts once whether they are indexed or
2754 - parameter_brace_expand_word: take an array_eltstate_t * argument in
2755 place of the arrayind_t * argument; pass it to array_value; use a
2756 static version (which we init and flush) if the argument passed is
2757 NULL so we can get the right state passed back and forth
2758 - parameter_brace_expand: pass a pointer to a static array_eltstate_t
2759 to parameter_brace_expand_word, and use that in the various calls to
2760 parameter_brace_XXX functions that perform specific expansions in
2761 place of the old arrayind_t argument; make sure to flush it before
2762 returning, even on errors
2767 - internal_warning: calls changed to use translatable strings
2771 - internal_debug: new function, prints a message like internal_warning,
2772 no-op if DEBUG is not defined
2773 - INTERNAL_DEBUG: macro that expands to internal_debug when DEBUG is
2774 defined, and nothing otherwise
2777 - changed some internal_warning and internal_inform calls to use
2778 internal_debug, since they were active only when DEBUG is defined
2781 - parse_comsub: add internal_debug call when a command substitution
2782 ends with unterminated here-documents
2785 - number_of_args: unconditionally return posparam_count
2787 {jobs,execute_cmd,subst}.c,parse.y,builtins/{command.def,evalstring.c}
2788 - INTERNAL_DEBUG: use instead of calls to itrace protected by #ifdef
2794 - glob_always_skip_dot_and_dotdot: initialize to 1 (enabled)
2797 - globskipdots: new shell option, exposes glob_always_skip_dot_and_dotdot
2799 doc/{bash.1,bashref.texi}
2800 - globskipdots: document new shell option
2803 - fix_arrayref_words: call valid_array_reference with 0 for third arg
2804 because the words have not undergone any word expansions yet and
2805 the quotes are still present. This makes things like
2811 - word_list_split: if a word undergoes word splitting but is not
2812 changed, preserve any W_ARRAYREF flag into the new word. This makes
2816 work because the unset builtin sees the W_ARRAYREF flag on its
2822 - SET_VFLAGS: take a set of word flags, and set flags for use with
2823 valid_array_reference (vflags) and assign_array_element/bind_int_variable
2824 (bindflags) based on those flags and the setting of assoc_expand_once
2825 (moved from read.def and generalized)
2828 - array_variable_name: now exclusively takes AV_xxx flags; understands
2829 how to translate AV_NOEXPAND to the right flag for skipsubscript;
2830 understands AV_ONEWORD and AV_NOEXPAND
2831 - array_variable_part: just passes the FLAGS arg to array_variable_name
2832 - assign_array_element: translates ASS_ flags to AV_ flags for
2834 - array_value_internal: now just passes flags straight through to
2835 array_variable_part (which sends them to array_variable_name)
2837 builtins/common.[ch]
2838 - builtin_bind_var_to_int: now takes a new FLAGS third argument; passes
2839 it to bind_var_to_int
2842 - printf_builtin: use SET_VFLAGS to set flags for builtin_bind_variable
2843 (bindflags); makes things like
2844 declare -A A; key=']' ; printf -v A[$key] "foo"
2845 work without a subscript error as long as assoc_expand_once is defined
2848 - read_builtin: use new common version of SET_VFLAGS instead of
2849 private version; changed to use new calling sequence; makes things like
2850 declare -A A; key=']' ; read A[$key] <<<"foo"
2851 work without a subscript error as long as assoc_expand_once is defined
2854 - wait_builtin: use SET_VFLAGS for variable name with -p option
2855 - wait_builtin: call builtin_bind_var_to_int with new bindflags third
2859 - expr_streval: just pass TFLAG (AV_xxx flags) straight through to
2863 - bind_int_variable: translate the assignment flags (ASS_xxx) to
2864 VA_xxx flags for valid_array_reference calls (ASS_ONEWORD); translate
2865 assignment flags to AV_xxx flags for array_variable_part
2870 - parameter_brace_expand: when expanding an indirect variable, extend
2871 the special case for array[@] and array[*] (set -u/no positional
2872 parameters, obeying the baroque quoting rules) to the value of the
2873 indirection. Report and fix from konsolebox <konsolebox@gmail.com>
2878 - compound_list: when parsing a compound_list production, collect any
2879 pending here-documents after reading a newline, not after reading
2880 any command terminator. Fixes interactive-only prompting bug
2881 reported back in 8/2021 by Hyunho Cho <mug896@gmail.com>
2886 - set_filename_quote_chars: break code that modifies
2887 rl_filename_quote_characters based on whether DIRNAME needs to be
2888 expanded from bash_directory_completion_hook into its own function
2889 - bash_check_expchar: break code that checks whether DIRNAME will be
2890 word expanded from bash_directory_completion_hook into its own
2892 - bashline_reset,attempt_shell_completion: make sure complete_fullquote
2893 is set to 1 (as it is by default) in case a completion modifies it
2894 - bash_quote_filename: if we are completing (but not expanding --
2895 direxpand is unset) and backslash-quoting a filename with expansion
2896 characters as determined by bash_check_expchar, make sure
2897 filename_bstab is set not to include the expansion char (and any
2898 following char and closer) and set complete_fullquote to 0 so
2899 sh_backslash_quote uses filename_bstab. Fixes the longstanding issue
2900 of quoting a `$', for instance, if the rest of the filename contains
2901 any characters that need quoting in filenames. This assumes that the
2902 filename is unquoted (*QCP == 0) so the word will be expanded and is
2903 not part of the filename (if needed, we can use file_exists to check
2904 whether the expansion characters are actually part of the filename)
2908 examples/loadables/accept.c
2909 - new -b bindaddr option to bind to a specific IP address
2910 - move setsockopt calls before bind() to avoid TIME_WAIT issues. Fixes
2911 from Dzogovic Vehbo <dzove855@gmail.com>
2916 - bumped version to 5.2-alpha.
2921 tests/{unicode1,glob2,intl2}.sub, tests/run-intl
2922 - minor changes to add warnings for missing locales that cause test
2928 - history_delimiting_chars: if we have a blank line by the time we
2929 hit the end of the tests, return a semicolon for the first blank
2930 line to avoid running lines of a multi-line command together.
2931 Fixes bug reported by Joakim Lindblad <joakim@cb.uu.se>
2934 - expand_string_for_patsub: expand the replacement string for pattern
2935 substitution assuming that it will eventually be passed to
2936 strcreplace to replace `&' with the matched portion of the string.
2937 This calls expand_string_for_pat(), which leaves the string quoted
2938 and does not perform word splitting, then calls
2939 quote_string_for_repl to post-process the expanded string.
2940 - quote_string_for_repl: perform quote removal on passed string while
2941 replacing CTLESC escaping a `&' or a backslash with a backslash. The
2942 result must be passed to strcreplace
2943 - parameter_brace_patsub: call expand_string_for_patsub if
2944 patsub_replacement is set to quote
2949 - read_comsub: make istring_index a size_t to avoid overflow with very
2950 large values of istring_size.
2951 From https://savannah.gnu.org/support/index.php?110596
2952 - expand_word_internal: make istring_index a size_t
2957 - add a description of `cd -' to the help text. Suggested by
2958 Rob Landley <rob@landley.net>
2963 - glob_vector: if we allocate NEXTLINK using malloc, and free it due to
2964 some allocation failure, reset FIRSTMALLOC to avoid duplicate frees
2968 - sub_append_string: the INDX parameter is now a size_t to avoid
2972 - decode_prompt_string: RESULT_INDEX is now a size_t to pass to
2976 - wait_for_background_pids: now returns the number of jobs/processes
2980 - wait_builtin: if -p pid supplied without -n, make sure we do something
2981 useful if no job/pid arguments are supplied and there are no jobs.
2982 Reported by Oguz <oguzismailuysal@gmail.com>
2985 - read_builtin: if we have a timeout, use SIGALRM instead of select
2986 when in posix mode, since we use read instead of zread. Fixes bug
2987 reported by Andreas Schwab <schwab@linux-m68k.org>
2990 - expand_string_dollar_quote: handle single-quoted and double-quoted
2991 strings that might include $' and $" without attempting translation;
2992 do more error checking for unterminated $' and $" that leaves those
2993 characters unmodified. This is for use by readline's various line
2994 expansion functions (shell_expand_line)
2999 - revert change that unconditionally processes $'...' and $"..." in
3000 here-document bodies; there are only a couple of cases where they
3001 should be processed in a double-quote environment
3007 - extract_dollar_brace_string: if we see another `${' on the rhs of
3008 the operator, reset the dolbrace_state to DOLBRACE_PARAM while we
3009 read this new ${...} string
3010 - extract_heredoc_dolbrace_string: new function, variant of
3011 extract_dollar_brace_string, to process the WORD in ${PARAM OP WORD}
3012 while expanding lines of here-document data. It's complicated by the
3013 requirement to add to the result string as we go along, since we
3014 need to change the contents of the input string with ansi expansion
3015 or locale translation.
3016 - string_extract_single_quoted: take a new third argument: ALLOWESC.
3017 This allows backslash to escape an embedded single quote, needed by
3018 extract_heredoc_dolbrace_string to process $'...'; changed callers
3023 - parse_matched_pair: ansi-expand $'...' in WORD for ${PARAM OP WORD}
3024 and single-quote the result if dolbrace_state == DOLBRACE_QUOTE
3025 (posix pattern removal operators) even if extended_quote == 0
3028 - extract_heredoc_dolbrace_string: add logic to align with parse.y:
3029 parse_matched_pair and its $'...' expansion, including handling
3034 builtins/evalstring.c
3035 - should_optimize_fork: broke conditions for optimizing away the fork
3036 for a simple command out of optimize_fork into new function, call
3037 from should_suppress_fork and optimize_subshell_command. Call from
3038 optimize_fork if (subshell_environment & SUBSHELL_PAREN), relying
3039 on fact that CMD_TRY_OPTIMIZING is only set in a couple of specific
3041 - optimize_fork: call should_suppress_fork only if startup_state == 2;
3042 it does the extra checks for that specific case
3043 - optimize_fork: call should_optimize_fork if we're in a (list)
3044 subshell (subshell_environment & SUBSHELL_PAREN)
3045 - optimize_subshell_command: set CMD_TRY_OPTIMIZING on the right side
3046 of a `&&', `||', or `;' list as long as it's a simple command so
3047 we can check with optimize_fork() when it's time to execute it
3050 - execute_in_subshell: call optimize_subshell_command for (list)
3051 subshells to either set CMD_NO_FORK for simple commands or set
3052 CMD_TRY_OPTIMIZING for likely candidates for later optimization
3054 builtins/common.h,builtins/evalstring.c
3055 - optimize_fork: renamed to optimize_connection_fork; changed callers
3060 - COPY_CHAR_I,SCOPY_CHAR_I: add check for locale_utf8locale and
3061 (c & 0x80) as in other macros
3064 - sh_backslash_quote_for_double_quotes: rewrote to use array indexing
3065 and COPY_CHAR_I to make it easier to drop in future calls to
3066 charvis() to make `unsafe' characters visible if FLAGS == 1
3071 - parse_comsub: if we are currently expanding aliases, temporarily
3072 turn off alias expansion if we are not in posix mode so we defer
3073 alias expansion until command_substitute(). Fixes double-expansion
3074 bug reported by Martijn Dekker <martijn@inlv.org> and aligns with
3075 https://www.austingroupbugs.net/view.php?id=1342
3076 - xparse_dolparen: turn off alias expansion entirely while running the
3077 parser: either we do it in parse_comsub (posix mode) or in
3078 command_substitute (default mode)
3079 - parse_string_to_command: ditto
3082 - command_substitute: if we are expanding aliases, temporarily turn
3083 off alias expansion if we are in posix mode, since we already
3084 performed it in parse_comsub() and are using the command string
3085 reconstituted from the parse result
3088 - bash posix mode: add description of alias expansion and command
3089 substitution parsing and execution
3093 lib/readline/rltty.c
3094 - rl_deprep_terminal: set _rl_last_c_pos to 0 after outputting
3095 BRACK_PASTE_FINI, since the last character in that is \r. Partially
3096 address issue raised by Markus Schwarzenberg <markus.schwarzenberg@freenet.de>
3097 in https://lists.gnu.org/archive/html/bug-bash/2022-02/msg00056.html
3101 doc/{bash.1,bashref.texi}
3102 - minor typo fixes from Helge Kreutzmann <debian@helgefjell.de>
3106 {arrayfunc,variables}.c
3107 - ARRAY_EXPORT: changes to encode array and assoc variables using a
3108 scheme similar to shell functions so we can export arrays and
3109 differentiate them from scalar variables and differentiate array
3110 and assoc variables. Still not enabled by default.
3113 - mk_env_string: third argument is now the variable's attributes or 0,
3114 with all the attributes we can export arrays
3117 - active-region-start-color,active-region-end-color: new bindable
3118 string variables, one to set the active region color (instead of
3119 standout mode) and one to turn it off (instead of the "se" terminal
3120 capability). They set _rl_active_region_start_color and
3121 _rl_active_region_end_color variables via functions
3123 lib/readline/display.c
3124 - putc_face: if setting standout mode, check for both the start color
3125 and end color variables and output the start color string. If turning
3126 off standout mode (normal face), output the end color string. Both
3127 variables must be set
3129 lib/readline/{readline.c,rlprivate.h}
3130 - declarations for _rl_active_region_start_color and
3131 _rl_active_region_end_color
3136 - initialize_readline: add bindable name `vi-edit-and-execute-command'
3139 - subshell_exit: make sure to set last_command_exit_value before
3140 calling the exit trap. Fixes bug reported by Greg Edwards
3145 lib/readline/{terminal.c,rlprivate.h}
3146 - _rl_region_color_on,_rl_region_color_off: functions to output the
3147 _rl_active_region_start_color and _rl_active_region_end_color
3148 - _rl_reset_region_color: function to encapsulate setting the region
3149 color to an arbitrary string, including doing memory management
3151 lib/readline/display.c
3152 - putc_face: call _rl_region_color_on and _rl_region_color_off instead
3153 of _rl_standout_on and _rl_standout_off
3155 lib/readline/terminal.c
3156 - _rl_init_terminal_io: initialize _rl_active_region_start_color and
3157 _rl_active_region_end_color from _rl_term_so and _rl_term_se,
3158 respectively; reset every time the terminal is changed
3159 - _rl_init_terminal_io: turn off the active region for a dumb terminal
3162 - sv_region_{start,end}_color: call _rl_reset_region_color with the
3163 appropriate value for WHICH
3167 lib/readline/doc/{rluser.texi,readline.3},doc/bash.1
3168 - active-region-start-color,active-region-end-color: documented new
3169 bindable readline variables
3170 - enable-active-region: document using active-region-start-color to
3171 highlight the text in the region
3176 - read_token,read_token_word: make sure characters read by shell_getc
3177 are protected by appropriate calls to MBTEST when testing for shell
3178 metacharacters and operators
3183 - set_compatibility_level: if the current compatibility level is outside
3184 the range of the compatNN options, just leave it alone when
3185 unsetting one of the options (which by definition was already
3186 unset). Fixes issue reported by Mihai Moldovan <ionic@ionic.de>
3190 lib/readline/search.c
3191 - rl_history_search_{pos,len,flags}: rename to have a leading `_'
3192 - _rl_history_search_pos: no longer static so other parts of readline
3195 lib/readline/rlprivate.h
3196 - _rl_history_search_pos: extern declaration
3198 lib/readline/readline.c
3199 - readline_internal_teardown: don't run the undo list against the
3200 current history entry if the non-incremental search functions have
3201 set _rl_history_search_pos to it, since it doesn't reflect the
3202 current contents of the line buffer. Fixes issue reported by
3203 Andreas Schwab <schwab@linux-m68k.org>
3206 - _rl_start_using_history: initialize _rl_history_search_pos to
3207 something invalid so it doesn't match where_history()
3211 lib/readline/callback.c
3212 - rl_callback_read_char: make sure _rl_eof_found is set to the value
3213 of eof before calling the deprep terminal function, so it can do
3214 different things based on whether the input code read EOF (or the
3215 user entered the EOF character). From a gdb discussion started by
3216 Andrew Burgess <aburgess@redhat.com> (still more to do, since this
3217 is not part of the public API)
3221 lib/readline/readline.h
3222 - RL_STATE_EOF: new readline state value; set when readline reads an
3223 EOF character on an empty line or a read returns an error
3224 - rl_eof_found: new public variable
3226 lib/readline/rprivate.h
3227 - _rl_eof_found: renamed to rl_eof_found, so not declared here
3229 lib/readline/{callback,readline}.c
3230 - RL_STATE_EOF: set appropriately when readline gets an EOF. Suggested
3231 by Andrew Burgess <aburgess@redhat.com>
3232 - RL_STATE_EOF: make sure it's not set when readline starts
3233 - rl_eof_found: set appropriately when readline gets an EOF
3235 lib/readline/{callback,readline,rltty}.c
3236 - rl_eof_found: new name for _rl_eof_found
3238 lib/readline/doc/rltech.texi
3239 - RL_STATE_EOF: document
3244 - parse_comsub: turn off parser state flags we don't want to inherit
3245 into this call to the parser (PST_REGEXP, PST_EXTPAT, PST_CONDCMD,
3246 PST_CONDEXPR for now). Fixes bug reported by konsolebox
3247 <konsolebox@gmail.com>
3251 findcmd.c,builtins/hash.def
3252 - replace calls to is_directory with file_isdir, which only performs a
3253 stat and doesn't do the eaccess call to check for an executable file
3256 - find_in_path_element: takes a new RFLAGSP argument, an int * where
3257 the status flags for the returned pathname are returned; saves
3258 additional calls to stat/eaccess
3259 - search_for_command: get the returned flags from
3260 find_user_command_in_path so we don't need any additional calls to
3261 file_status after we find the command in $PATH
3265 doc/{bash.1,bashref.texi}
3266 - FUNCTIONS: some small changes to the description of local variables
3267 and dynamic scoping, with emphasis on how that affects `unset'
3268 behavior. Inspired by a discussion with
3269 Christoph Anton Mitterer <calestyo@scientia.net>
3273 examples/loadables/realpath.c
3274 - renamed -s option to -q to align with other versions
3275 - perform array assignment for `-a varname' even if -q option supplied
3276 - renamed -S option to -s for Linux compatibility
3281 - _rl_free_saved_history_line: call rl_free_undo_list, saving and
3282 setting rl_undo_list to the saved history line's data, so the right
3283 call to _hs_replace_history_data happens and we don't end up with
3284 a pointer aliasing problem. Fixes core dump reported by
3285 Andreas Schwab <schwab@linux-m68k.org>, but does not make his
3286 scenario equivalent to incremental search
3290 lib/readline/search.c
3291 - make_history_line_current: save the current line before replacing it
3292 with the found history entry using rl_maybe_save_line
3293 - noninc_dosearch: we don't want the saved history line, so free it
3294 after calling make_history_line_current
3295 - _rl_history_search_internal: call rl_maybe_replace_line after making
3296 changes to the line buffer with make_history_line_current so we can
3297 save the undo list we constructed before we set the history position
3301 lib/readline/display.c
3302 - expand_prompt: add missing piece to patch from 10/26/2021: if we are
3303 recalculating the number of invisible characters on the first line
3304 of the prompt, we need to update INVFL, even if we already set it
3305 when we hit the number of physical characters. This ends up being
3306 assigned to prompt_invis_chars_first_line, and is used in several
3307 subsequent calculations. Reported by
3308 Andreas Schwab <schwab@linux-m68k.org>
3310 lib/readline/doc/{readline.3,rluser.texi},doc/bash.1
3311 - enable-bracketed-paste: add some language making it clearer that
3312 bracketed paste prevents the pasted text from being interpreted as
3313 editing commands. Suggested by Karl O. Pinc <kop@karlpinc.com>
3318 - make_here_document: perform quote removal on the here-doc delimiter
3319 only if it's marked as quoted, which prevents quotes from inside a
3320 command substitution from being removed (they're supposed to begin a
3321 new quoting context) when the word itself isn't flagged as quoted
3322 (which means the body of the here-document gets expanded). You can't
3323 perform quote removal *and* expand the here-document lines. From an
3324 austin-group discussion back in early February
3327 - charvis -> sh_charvis; change caller
3328 - sh_charvis: now take an additional SLEN argument to avoid having to
3329 compute the string length every time; change callers
3330 - sh_charvis: add a utf-8 locale-specific check before calling
3331 COPY_CHAR_I (in practice, doesn't make any real difference)
3336 - convert_var_to_array: if we're being asked to create an associative
3337 array (flags & 2), and we have an existing variable that is not an
3338 assoc array (and not an existing indexed array), call
3339 convert_var_to_assoc to make it one
3344 - wait_for: don't call get_tty_state() if readline is dispatching
3345 (RL_STATE_DISPATCHING) with the terminal settings changed
3346 (RL_STATE_TERMPREPPED), the same way we don't if we are running a
3347 command for programmable completion. Fixes bug with SIGINT reverting
3348 to the saved readline terminal settings reported by
3349 Markus Napierkowski <markus.napierkowski@cyberus-technology.de>
3352 - decode_prompt_string: make sure the expansion of \w, \W, and \s
3353 are all run through sh_strvis before calling
3354 sh_backslash_quote_for_double_quotes or just through sh_strvis if
3355 we're not running the prompt string through word expansions.
3356 Fixes issue reported by Josh Harcome <joshharc@gmail.com> back
3362 - bash_quote_filename: if we have a word to complete that contains
3363 characters that introduce a word expansion, make sure the passed
3364 string does *not* exist as a filename before removing those
3365 characters from the set that must be backslash-quoted. See change
3370 lib/readline/search.c
3371 - make_history_line_current: don't free rl_undo_list or
3372 _rl_saved_line_for_history; don't unconditionally save the history
3373 line. This reverts some of the changes to support setting the
3374 history position in history-search-backward
3375 - rl_history_search_internal: only free the saved history line if we
3376 were the ones who created it
3381 - xmalloc.h: include for systems without setlocale(), so xfree has a
3382 prototype. Report and fix from András Kucsma <r0maikx02b@gmail.com>
3384 lib/readline/search.c
3385 - _rl_history_search_internal: use previous-history/next-history to
3386 move to the found history line instead of directly calling
3387 history_set_pos. This makes the behavior more similar to incremental
3389 - rl_history_search_internal: make sure to set rl_undo_list to the
3390 current history undo list around the calls to rl_get_previous_history
3391 or rl_get_next_history, in order to fool the call to
3392 maybe_replace_line they make
3394 lib/readline/readline.c
3395 - _rl_executing_func: the currently-executing readline command function
3397 lib/readline/rlprivate.h
3398 - _rl_executing_func: extern declaration
3400 lib/readline/search.c
3401 - _rl_history_search_internal: removed (commented out) code that sets
3402 the current history entry to the found history entry, too much
3403 assumes that the current undo list should be applied to the current
3404 history entry (where_history())
3409 - parameter_brace_expand_word: if we have double-quoted ${*} or ${@},
3410 make sure we are setting W_HASQUOTEDNULL in the flags we return to
3411 the caller if we are returning QUOTED_NULL(word)
3412 - parameter_brace_expand_word: if we have a double-quoted associative
3413 array reference using `*' or `@', make sure we are setting
3414 W_HASQUOTEDNULL in the flags we return to the caller if we are
3415 returning QUOTED_NULL(word)
3416 - parameter_brace_expand: if we're using the `[:]+' word expansion
3417 operator, we need to note a quoted null string and pass the
3418 W_QUOTEDNULL flag back to the caller
3419 - expand_word_internal: make sure to return a QUOTED_NULL
3420 (word[0] == CTLNUL) back to the caller if HAD_QUOTED_NULL is set,
3421 regardless of whether or not we see a quoted dollar at. Fix for bug
3422 reported by Andreas Luik <andreas.luik@innovative-navigation.de>
3425 - array_value_internal: fix typo and set estatep->type to ARRAY_INDEXED
3430 lib/readline/{history.c,histlib.h}
3431 - _hs_at_end_of_history: convenience function to tell whether or not
3432 the current history position is at the end of the history list
3436 lib/readline/search.c
3437 - make_history_line_current: don't free rl_undo_list if it is equal to
3438 _rl_saved_line_for_history->data, since we will need to restore it
3439 later if we got it from a history entry. Fixes issue dating back to
3440 7/2021 and changes to _rl_free_saved_line_for_history, current issue
3441 reported by Andreas Schwab <schwab@linux-m68k.org>
3445 lib/readline/{complete,histfile,histsearch,isearch,terminal}.c
3446 - xfree: use instead of free
3451 - bumped version to bash-5.2-beta
3453 [bash-5.2-beta frozen]
3457 lib/readline/input.c
3458 - _rl_orig_sigset: need extern declaration if HAVE_SELECT is defined.
3459 From https://savannah.gnu.org/support/?110634
3461 examples/loadables/seq.c
3462 - PRIdMAX: redefine if PRI_MACROS_BROKEN is defined.
3463 From https://savannah.gnu.org/support/index.php?110635
3468 - BASH_FUNC_STRTOIMAX: replace strtoimax if the system doesn't provide
3469 a declaration in a standard header file. Uses new m4/strtoimax.m4.
3470 From https://savannah.gnu.org/support/index.php?110633
3473 - getdouble: new function, parses string into `double' using strtod
3474 - printf_builtin: check for the `L' length modifier and use long
3475 doubles for the floating point conversion specifiers. If it's not
3476 supplied, use `double' when in posix mode (as posix specifies) and
3477 long double (if it's available, double if not) in default mode.
3478 From a report from Paul Eggert <eggert@cs.ucla.edu>
3483 - bzero: update function signature to modern BSD version
3488 - bcopy, gethostname, mkfifo: update function signatures to modern
3494 - wait_for_single_pid: if the pid or job argument is invalid -- isn't
3495 a child of this shell -- return 257, which is out of the range of
3496 valid 8-bit status values
3499 - execute_pipeline: if wait_for_single_pid returns > 256, set it to
3500 127 (invalid process)
3503 - wait_for_background_pids: if wait_for_single_pid returns > 256, set
3504 the status we return in PS to 127 (what it was before)
3507 - wait_builtin: if wait_for_single_pid returns > 256, treat it as an
3508 error and set pstat.pid to NO_PID
3509 - wait_builtin: if -p supplied, and we get to the end of the argument
3510 list with PSTAT.PID != NO_PID (which we assume means that the return
3511 value is set from PSTAT.STATUS), set the variable name to PSTAT.PID.
3512 From a report by Robert Elz <kre@munnari.OZ.AU>
3513 - wait_builtin: for compatibility with the netbsd sh, leave the variable
3514 name specified with `-p' unset if there are no PID arguments.
3515 From a report by Robert Elz <kre@munnari.OZ.AU>
3520 - xparse_dolparen: if (flags & SX_NOLONGJMP), don't call
3521 jump_to_top_level() on errors
3524 - bash_quote_filename: don't call quote_word_break_chars() unless we
3525 have word break chars initialized. Fixes bug reported by
3526 Sam James <sam@gentoo.org>
3531 - gen_globpat_matches: call glob_filename with the GX_GLOBSTAR flag if
3532 the `globstar' shell option is enabled. From a report by
3533 Steve <bash@lonetwin.net>
3536 - internal_free: remove the GLIBC21 code (!)
3537 - internal_free: make the code that tests against memtop and calls
3538 lesscore depend on USE_LESSCORE being defined, which it is by
3541 lib/malloc/imalloc.h
3542 - USE_LESSCORE: define
3545 - token_buffer_size and its corresponding saved value in the shell's
3546 parser state are now size_t instead of int
3549 - strsub,strcreplace: use size_t instead of int for local length and
3553 - zmapfd: use size_t instead of int for local length and indexing
3557 - zgetline: use size_t instead of int for local length and indexing
3563 - init_itemlist_from_varlist: free VLIST after assigning it from
3564 *SVFUNC and after we get the variable names and values out of it.
3565 Report from Robert E. Griffith <bobg@junga.com>
3570 - here_document_to_fd: if the shell compatibility level is bash-5.0 or
3571 earlier, use tempfiles for all here-documents and here-strings. From
3572 a bug-bash discussion started by Sam Liddicott <sam@liddicott.com>
3577 - parse_comsub: non-interactive shells exit on a syntax error while
3578 parsing the command substitution
3579 - parse_comsub: unset additional PARSER_STATE flags before calling
3580 yyparse(). Inspired by https://bugs.gentoo.org/837203; unsetting
3581 PST_COMPASSIGN is the fix for that bug
3582 - parse_string_to_word_list: use save_parser_state/restore_parser_state
3583 instead of saving pieces of the shell state in individual variables
3584 - parse_compound_assignment: use save_parser_state/restore_parser_state
3585 instead of saving pieces of the shell state in individual variables
3586 - parse_compound_assignment: unset additional PARSER_STATE flags before
3587 calling read_token(); set esacs_needed_count and expecting_in_token
3588 to 0 like in parse_comsub() since read_token can use them
3593 - sh_charvis: changes to handle being compiled without multibyte support
3597 lib/readline/callback.c
3598 - rl_callback_read_char: don't set rl_eof_found unless eof is > 0,
3599 since it can be -3 if we need to read more input in a multi-key
3600 sequence. Report from Andrew Burgess <aburgess@redhat.com>
3602 examples/loadables/Makefile.sample.in
3603 - new file, containing the rules to build the example shared object
3604 - includes Makefile.inc from wherever it's installed. Suggested by
3605 Robert E. Griffith <bobg@junga.com>
3607 examples/loadables/Makefile.inc.in
3608 - remove rules that create the example shared object
3612 builtins/evalstring.c
3613 - parse_and_execute: check for terminating signals before returning,
3614 after any longjmp, to improve responsiveness and fix the -c code
3615 path before running any exit trap. Report from
3616 Emanuele Torre <torreemanuele6@gmail.com>
3620 builtins/suspend.def
3621 - suspend_builtin: the -f option now forces a suspend even if job
3622 control is not enabled. Inspired by a discussion with
3623 Robert Elz <kre@munnari.OZ.AU>
3625 doc/{bash.1,bashref.texi}
3626 - suspend: updated description to include expanded -f behavior
3630 builtins/mkbuiltins.c
3631 - -includefile: new argument, specifies extern filename to insert
3632 into the #include statement in the structfile (builtins.c) and
3633 the filename in the comment in the extern file (builtext.h).
3634 From Alexander Kanavin <alex.kanavin@gmail.com> via
3635 https://savannah.gnu.org/patch/?10210
3637 builtins/Makefile.in
3638 - builtins.c: change call to mkbuiltins to add -includefile option
3639 - builtins.c: change recipe to run all the commands in the same shell
3641 - builtins.c: change recipe to specify new filenames in the call to
3642 mkbuiltins and move them onto builtins.c/builtext.h if the new ones
3643 are different; make the new filenames use the current make recipe
3644 shell pid in the filename ($$RECPID).
3645 Inspired by Alexander Kanavin <alex.kanavin@gmail.com> via
3646 https://savannah.gnu.org/patch/?10210
3651 - builtin_find_indexed_array: new function, factored common code out
3652 of mapfile and read builtins to find an in-scope indexed array or
3656 - builtin_find_indexed_array: extern declaration
3658 builtins/{mapfile,read}.def
3659 - change callers to use builtin_find_indexed_array
3662 - unbind_global_variable, unbind_global_variable_noref: new functions
3663 that remove variables from the global_variables table
3666 - sh_regmatch: use unbind_global_variable_noref to make sure we act on
3667 the copy of BASH_REMATCH in the global scope all the time, ignoring
3668 any local variables that might exist. Tentative fix for memory leak
3669 report from Emanuele Torre <torreemanuele6@gmail.com>
3671 doc/{bash.1,bashref.texi}
3672 - BASH_REMATCH: add caveat about making it a local variable
3677 - print_redirection: if the redirectee for r_duplicating_output_word
3678 (r_duplicating_input_word) is 1 (0), don't print it; only print a
3679 non-default file descriptor number
3680 - print_redirection_list: remove the code that tries to temporarily
3681 translate a >&word redirection to >&word now that we won't print a
3682 non-default file descriptor number. Fixes issue with `declare -f' and
3683 function export reported by Namikaze Minato <lloydsensei@gmail.com>
3688 - bumped version to bash-5.2-rc1
3690 [bash-5.2-rc1 released]
3695 - parse_string_to_word_list: save the parser state before any state-
3696 changing functions like bash_history_disable(). Reported by
3697 Clark Wang <dearvoid@gmail.com>
3702 - play tricks with the value of the zZ number register to refer to
3703 `bash(1)' instead of `above' or `below' when creating the builtins
3708 doc/{bash.1,bashref.texi}
3709 - wait: note that wait will return > 128 if interrupted by a signal.
3710 Reported by AA <aathan_github@memeplex.com>
3713 - {execute_cond_node,execute_arith_command,eval_arith_for_expr}: make
3714 sure to reset this_command_name after running any DEBUG trap so the
3715 DEBUG trap doesn't overwrite it.
3716 Reported by Emanuele Torre <torreemanuele6@gmail.com>.
3717 - execute_select_command: set this_command_name to NULL after running
3718 any DEBUG trap like execute_for_command does
3723 - three_arguments: when given [ ! ! arg ], make sure to advance POS
3724 after calling two_arguments to avoid a `too many arguments' error.
3725 Report from Steffen Nurpmeso <steffen@sdaoden.eu>
3730 - expand_word_internal: when expanding backquoted command substitution,
3731 call string_extract with the SX_REQMATCH flag (closing backquote
3732 required) only if the word flags don't contain W_COMPLETE,
3733 indicating that we're doing this for completion, probably to
3734 determine whether or not to append something to the word. Fixes bug
3735 reported by Emanuele Torre <torreemanuele6@gmail.com>.
3740 - execute_connection: treat a connector of '\n' the same as ';'
3743 - print_comsub: new function, sets flag noting we are printing a
3744 command substitution and calls make_command_string
3745 - make_command_string_internal: add '\n' to the ';' case; print command
3746 list with newline connector appropriately
3749 - parse_comsub: call print_comsub instead of make_command_string
3750 - list1 production (part of compound_list): if a list is separated by
3751 newlines, and the parser is parsing a command substitution, make
3752 the connection command with a '\n' connector. Makes the text
3753 output of parse_comsub closer to the original source text. From a
3754 report from Martijn Dekker <martijn@inlv.org>
3758 doc/bash.1,lib/readline/doc/rluser.texi
3759 - complete: add note about arguments passed to command specified by
3760 `complete -C'; suggested by Mark Chandler <mcp@synq.so>
3762 builtins/setattr.def
3763 - show_local_var_attributes: special-case `local -', since there is
3764 no `declare -' equivalent.
3765 Reported by Emanuele Torre <torreemanuele6@gmail.com>.
3766 - show_all_var_attributes: use `local -' when printing a variable named
3767 `-' at the current non-zero variable context
3770 - shell_getc: if we are at the end of an alias, returning a space,
3771 make sure we mark the previous character as single-byte by modifying
3772 shell_input_line_property so the space we return is properly
3773 recognized. This would fail before if the last character of the
3774 alias was a multi-byte character. Reported by
3775 Vangelis Natsios <vnatsios@gmail.com>
3779 lib/readline/isearch.c
3780 - rl_display_search: don't call rl_redisplay_function before returning;
3781 rl_message already calls it. Reported by
3782 Frédéric Moulins <frederic@moulins.org>
3785 - bumped version to bash-5.2-rc2
3790 - set_job_control: don't bother calling tcgetpgrp if shell_tty < 0,
3791 since it will just fail
3794 - reset_local_contexts: new function, delete all context tables
3795 associated with shell functions and set variable_context to 0.
3796 Called when we want to stop executing in a shell function without
3797 going through the pop_context chain with its side effects
3800 - reset_local_contexts: extern declaration
3802 builtins/evalstring.c
3803 - parse_and_execute: call reset_local_contexts instead of setting
3804 variable_context to 0
3807 - reader_loop: call reset_local_contexts in cases where the shell has
3808 longjmped for a fatal error and errexit is enabled (ERREXIT), but
3809 not for other cases, and especially not for the exit builtin,
3810 instead of just setting variable_context to 0. Fixes issue originally
3811 reported by Robert Stoll <robert.stoll@tegonal.com>
3814 - pat_subst: implement sed-like behavior when presented with a null
3815 pattern that's anchored at the start or end of the string, or when
3816 presented with a null string: process the replacement string for `&'
3817 and `\&' and substitute in the result as before. Patch from
3818 Koichi Murase <myoga.murase@gmail.com>
3823 [bash-5.2-rc2 frozen]
3828 - reset_parser: set need_here_doc, esacs_needed_count, expecting_in_token
3829 all to 0, since jumping back to a top-level parse needs that
3830 - parse_comsub: make sure to reset expand_aliases and shell_eof_token
3831 if we're not going to exit immediately out of this function
3836 - parse_comsub: if the compatibility level is <= 51, set extglob while
3837 parsing the command substitution, so bad pattern errors can still be
3838 caught but valid patterns are let through and can be evaluated at
3839 runtime, when extglob may have been set. If it isn't set, it will
3840 still be a parser error when the command substitution is executed.
3841 Fixes report from Sam James <sam@gentoo.org> about gentoo scripts.
3842 - reset_parser: set extended_glob from global_extglob if the parser
3843 state includes PST_CMDSUBST
3844 - xparse_dolparen: set global_extglob but don't modify extended_glob,
3845 so parse errors can be caught before forking a child for command
3846 substitution, as part of word expansion, but after extglob may have
3847 been set by command execution (e.g., in a shell function)
3851 [bump version to bash-5.2-rc3]
3856 - run_pending_traps: move code from evalstring() so we call
3857 parse_and_execute() directly and handle any `return' invocations so
3858 we can restore the value of running_trap. Otherwise, if we longjmp
3859 past this function, we will think we're running a trap after we
3860 finish. Prompted by post from Koichi Murase <myoga.murase@gmail.com>
3866 - _rl_current_locale: private variable, stores the value of the
3867 LC_CTYPE locale category, as determined by _rl_init_locale; set
3868 to allocated memory in _rl_init_locale()
3869 - _rl_set_localevars: new function, code from _rl_init_eightbit that
3870 checks the current locale (passed as an argument) and sets the
3871 various locale-aware variables based on it. It accepts a second
3872 argument: FORCE. If non-zero, it means to restore the default "C"
3873 locale values if the locale is "C" or "POSIX", now that this
3874 function can be called multiple times
3875 - _rl_init_eightbit: now just calls _rl_init_locale and
3877 - _rl_reset_locale: new function, checks whether our the locale has
3878 changed since we last called _rl_init_locale to set our internal
3879 idea of its value. If it has changed, call _rl_set_localevars with
3880 the new locale and a FORCE argument of 1 to change the
3881 locale-dependent variables.
3883 lib/readline/rlprivate.h
3884 - _rl_reset_locale: extern declaration
3886 lib/readline/readline.c
3887 - rl_initialize: call _rl_reset_locale instead of _rl_init_locale so
3888 the internal readline variables get set when we move from a non-
3889 multibyte locale ("C") to a multibyte one ("en_US.UTF-8"). Report
3890 from Alan Coopersmith <alan.coopersmith@oracle.com>
3895 - sh_setlinebuf: allocate buffers for line-buffering stdout and stderr
3896 only once, the first time it is requested. Only allocate memory if
3897 we're using setvbuf (we usually are). Double the buffer size to 2016
3898 if we're using the bash malloc. Otherwise, let stdio handle it.
3903 - exec_builtin: make sure to initialize orig_job_control in case the
3904 command is not found by search_for_command. Report and fix from
3905 Xiami <i@f2light.com>
3907 [bash-5.2-rc3 frozen]
3912 - parse_comsub: restore extended_glob to a local copy (local_extglob)
3913 only if we changed it; a safer way to do it. Fixes extglob change
3914 issue reported by Kerin Millar <kfm@plushkava.net>
3915 - cond_term: restore extended_glob to a local copy; safer than using
3916 global_extglob, which we will reserve for error recovery
3921 - parse_comsub: don't clear the pushed string list; we might need it to
3922 consume additional input to satisfy this command substitution. When
3923 we restore the parser state, don't restore the pushed string list in
3924 case we used it. From
3925 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018727
3926 - parse_comsub: don't modify extended_glob if parser_state includes
3927 PST_EXTPAT, in which case we've already set extended_glob and
3928 global_extglob appropriately. Only matters in compatibility mode.
3933 - parameter_brace_transform: make sure we return an error if *xform
3934 is '\0'. Report from Ivan Kapranov <koltiradw@yandex.ru>
3938 [bump version to bash-5.2-rc4]
3942 [bash-5.2-rc4 frozen]
3946 lib/readline/history.c
3947 - replace_history_entry: check for a NULL timestamp before trying to
3948 copy it. Report from nov.ondrej@gmail.com
3961 - time_to_check_mail: don't bother if we're in the middle of readline
3962 completion or command dispatching.
3963 From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019462
3965 lib/readline/display.c
3966 - rl_forced_update_display: use memset to clear out visible_line
3967 instead of trying to use a loop; line_size is the size.
3968 Report from <srobertson@peratonlabs.com>
3971 - indirection_level_string: use MBRLEN and an initialized mbstate_t
3972 object to avoid altering an internal mbstate_t.
3973 From Koichi Murase <myoga.murase@gmail.com>
3976 - string_extract_verbatim: use an explicit mbstate_t object and pass
3977 it to MBRLEN and mbrtowc to avoid altering the state that
3978 ADVANCE_CHAR is using.
3979 From Koichi Murase <myoga.murase@gmail.com>
3980 - setifs: use an explicit mbstate_t object and pass it to MBRLEN so
3981 to avoid altering an internal mbstate_t.
3982 From Koichi Murase <myoga.murase@gmail.com>
3985 - asciicode: use an explicit mbstate_t object and pass it to mbrtowc
3986 to avoid using an incorrect internal mbstate_t
3987 From Koichi Murase <myoga.murase@gmail.com>
3989 lib/sh/{mbscasecmp,mbscmp}.c
3990 - mbscasecmp,mbscmp: use different mbstate_t objects for the different
3991 strings so they don't affect each others' intermediate mbstate.
3992 From Koichi Murase <myoga.murase@gmail.com>
3997 - execute_command_internal: if executing a (command) subshell, restore
3998 the value of line_number from save_line_number before returning early
3999 due to being a non-terminal pipeline element.
4000 From https://savannah.gnu.org/support/index.php?110714
4005 - expand_array_subscript: make sure to pass a non-NULL first argument
4006 to sh_backslash_quote. Report from Emanuele Torre <torreemanuele6@gmail.com>,
4007 patch from Koichi Murase <myoga.murase@gmail.com>
4012 - cleanup_dead_jobs: delete dead foreground jobs we won't notify the
4013 user about (those not killed by a signal or killed by SIGINT/SIGPIPE).
4014 From a report from Koichi Murase <myoga.murase@gmail.com>
4015 - wait_for_any_job: never return a foreground job, even when requested
4016 by pid, if it's in the jobs list
4017 Report and fix from Koichi Murase <myoga.murase@gmail.com>
4020 - BASH_FUNC_STRTOIMAX: fix logic inversion of result; we should be
4021 replacing the function if the tests show we *don't* have a working
4022 version. Report from Emanuel Haupt <ehaupt@FreeBSD.org>
4027 - _rl_init_locale: cope with setlocale returning NULL, make sure we
4028 set up a default value for LC_CTYPE. Report from
4029 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021109
4031 lib/readline/{input.c,rlprivate.h}
4032 - fixes for compiling on w64-mingw32
4037 - xparse_dolparen: save and restore extended_glob using local_extglob
4038 in the same way that parse_comsub does. Fixes compat issue reported in
4039 https://bugs.gentoo.org/873931 and by Kerin Millar <kfm@plushkava.net>
4044 - extract_dollar_brace_string: keep a stack of dolbrace_state values
4045 to handle nested expansions. Report from
4046 Antoine <bug-bash@glitchimini.net>
4050 builtins/{shopt.def,common.h}
4051 - extglob_flag: new variable to hold the state of the `extglob' option;
4052 initialized to EXTGLOB_DEFAULT like extended_glob
4053 - shopt_set_extglob: new function to set extended_glob to the right
4054 value for the rest of the shell
4057 - reset_parser: set extended_glob to extglob_flag, which is only
4058 changed by shopt, remove global_extglob
4059 - parse_comsub,parse_cond_command,xparse_dolparen: no longer use
4063 - execute_cond_node: reset extended_glob to the value of extglob_flag,
4064 since we're executing a command here
4069 - save_dstart: when we set the value of function_dstart, save the old
4070 value in save_dstart (read_token, read_token_word); restore it in
4071 the grammar production after calling make_function_def. This gives
4072 you correct line numbers for one level of function nesting.
4073 Report from Daniel Castro <danicc097@gmail.com>
4078 - shell_execve: rearrange code so that we check for a bad interpreter
4079 before printing a generic ENOENT error message. Report from
4080 Kirill Elagin <kirelagin@gmail.com>
4084 lib/readline/callback.c
4085 - CALLBACK_READ_RETURN: add an inlined call to RL_CHECK_SIGNALS so we
4086 can handle any signals that arrived before we restored the calling
4087 application's signal handlers. From a gdb dicussion with
4088 Simon Marchi <simon.marchi@polymtl.ca>
4093 - pop_var_context: flag an internal error for shell_variables not
4094 pointing to a function context only if we haven't already flushed
4095 all the local contexts and reset variable_context. This can happen
4096 if errexit is enabled and we're going to be exiting the shell, but
4097 we're running unwind-protects on our way out. Report from
4098 Xavier Delaruelle <xavier.delaruelle@gmail.com>
4103 - kill_shell: broke the code that resets the signal disposition to the
4104 default and sends a terminating signal to the shell into a separate
4106 - termsig_handler: set handling_termsig to terminating_signal and make
4107 it file-scope so other functions know we're handling a terminating
4108 signal and are about to exit, and which signal it is (latter not used
4110 - termsig_sighandler: if we get a fatal signal while we're handling a
4111 fatal signal, kill ourselves with the second fatal signal immediately.
4112 Fixes issue reported by Andreas Schwab <schwab@suse.de>
4115 - execute_case_command: call CHECK_TERMSIG after the call to strmatch,
4116 since gmatch will return FNM_NOMATCH if there's a pending terminating
4117 signal and we don't want incorrect results
4120 - pat_subst: make sure REP is non-NULL before calling savestring on it.
4121 Report from Justin Wood (Callek) <callek@gmail.com>
4125 builtins/{shopt.def,common.h}
4126 - expand_aliases: split into a variable that holds the current state
4127 of alias expansion (expand_aliases) and a variable that reflects the
4128 global option value (expalias_flag), make sure expand_aliases is set
4129 appropriately by shopt
4131 shell.c,execute_cmd.c,general.c
4132 - expand_aliases: make sure expand_aliases and expalias_flag always
4136 - PST_STRING: new parser flag, set when parsing a string to a command
4140 - reset_parser: if we're parsing a command substitution or a string,
4141 and need to restore expand_aliases, make sure it's set to the value
4143 Fixes SIGINT during interactive command substitution parsing bug
4144 reported by feng xiangjun <fengxj325@gmail.com>
4145 - parse_string_to_word_list,parse_string_to_command: make sure to set
4146 PST_STRING in parser_flags since we're resetting expand_aliases
4151 - print_function_def, named_function_string: if the function doesn't
4152 have any here-documents, unset was_heredoc after printing the
4153 closing brace so we can add a separator if there is another command
4154 following the function definition. Fixes bug with multiple function
4155 definitions and here-documents reported by D630 <d630@posteo.net>
4156 - make_command_string_internal: if we're printing a command
4157 substitution, make sure to preserve newlines in the comsub so we
4158 avoid problems with re-parsing function defs or command substitutions
4159 containing multiple compound commands that need to be separated
4160 by newlines, but don't double them up
4163 - P_ARITH: new parse_matched_pair flags value; used to jump to
4164 parse_comsub if we see a $( inside a $(( )), $[ ], or (( ))
4165 - parse_matched_pair,parse_comsub,parse_arith_command,read_token_word:
4166 make sure to call parse_matched_pair with P_ARITH if we're parsing
4167 an arithmetic command or expansion
4168 - parse_matched_pair: if we see $( inside a call with P_ARITH in the
4169 flags argument, jump to parse_dollar_word and call parse_comsub to
4170 parse it. The rest of the steps assume that parse_comsub has
4171 expanded aliases (or not) appropriately. Fixes bug 2 from
4172 https://bugzilla.redhat.com/show_bug.cgi?id=2134307
4176 builtins/evalstring.c
4177 - parse_and_execute: we play tricks in the parser and in command_substitute
4178 to turn expand_aliases on and off depending on the comsub parser
4179 pass and whether or not we're in posix mode. Since this should only
4180 matter for parsing, when we're processing a command substitution, we
4181 set expand_aliases to the global flag value after parsing the
4182 command and before executing it, and restore it if the global flag
4183 value isn't changed during execution. Fixes bug 1 from
4184 https://bugzilla.redhat.com/show_bug.cgi?id=2134307
4187 - PF_BACKQUOTE: new flag value, only used by command_substitute to
4188 differentiate between `` and $() forms. The former does not have
4189 aliases expanded by parse_comsub in posix mode, so needs to expand
4190 them in parse_and_execute like default mode
4193 - command_substitute: don't modify expand_aliases if PF_BACKQUOTE is
4194 included in flags, since aliases haven't been expanded in the
4195 command string (it was run through parse.y:parse_matched_pair())
4196 - expand_word_internal: pass PF_BACKQUOTE to command_substitute() if
4197 expanding a `` command substitution
4202 - yylex: return YYUNDEF as current_token if read_token returns < 0.
4203 Fixes parser reset issue reported by Todd Stein <toddbstein@gmail.com>
4204 in https://savannah.gnu.org/support/index.php?110745
4207 - ARITH_EXP_CHARS: chars that are special and trigger expansion in
4208 arithmetic expressions, EXP_CHARS without `<' and `>'. Fixes bug
4209 reported by Glenn Jackman <glenn.jackman@gmail.com>
4212 - retain_fifos: replace executing_list (which is still present) as the
4213 indicator of whether or not to save and restore the FIFO list around
4214 a call to execute_command_internal/execute_command; it's more
4215 descriptive and can be used elsewhere
4216 - execute_for_command: set retain_fifos so we don't unlink the fifo
4217 list until the for command completes. Fixes issue reported in
4218 https://savannah.gnu.org/support/index.php?110743
4220 lib/readline/xmalloc.c
4221 - memory_error_and_abort: add `const' qualifiers to the argument. Fix
4222 from Markus Elfring <Markus.Elfring@web.de>
4227 - check_binary_file: check the first two lines for NULs if the first
4228 line begins with a `#!'; otherwise check the first. From a discussion
4229 and patch in https://savannah.gnu.org/support/?110744
4233 - parse_matched_pair: set PST_NOERROR if we read to EOF without finding
4234 a closing match and call parser_error; avoids redundant error
4238 - uconvert: RETURN: if ipart (integer part) is 0, but upart (fractional
4239 part) is non-zero, multiply upart by mult so we don't lose the sign
4240 for values in the range (-1, 0]. From a report by
4241 izabera <izaberina@gmail.com>
4244 - execute_in_subshell: check for terminating signals before we return
4245 to our caller, which will immediately exit, and before running any
4246 exit trap (since termsig_handler will run any exit trap). Fixes bug
4247 reported by Andrew Neff <andrew.neff@visionsystemsinc.com>
4251 lib/readline/complete.c
4252 - rl_filename_completion_function: if the application doesn't supply
4253 any directory hook functions, we need to handle the case where we
4254 dequoted users_dirname and also tilde-expanded dirname. We choose
4255 to tilde expand users_dirname rather than call the application
4256 dequoting function again. Report and patch from
4257 Stefan H. Holek <stefan@epy.co.at>
4262 - execute_in_subshell: call procsub_clear in addition to clear_fifo_list,
4263 since none of these process substitutions are children of this new
4267 - wait_for_background_pids: call procsub_waitpid on the last procsub
4268 created as long as it's the same as $!, then call reap_procsubs to
4269 clean up the procsub list. Don't call procsub_waitall. Report from
4270 Oguz İsmail Uysal <oguzismailuysal@gmail.com>
4275 - expr_streval: explicitly permit `@' and `*' as associative array
4276 subscripts if the shell compatibility level is greater than 51.
4277 Prompted by report from Corey Hickey <bugfood-ml@fatooh.org>
4280 - string_list_pos_params, param_expand: make sure that $* is treated
4281 the same as "$*" in here-document bodies that are being expanded.
4282 From https://lists.gnu.org/archive/html/bug-bash/2022-09/msg00002.html
4286 lib/readline/readline.c
4287 - readline_internal_char: save and restore the value of _rl_top_level
4288 around our use of setjmp, even though it doesn't matter in most
4289 cases. Report from sparrowhawk996@gmail.com that it causes crashes
4290 in some obscure callback-mode cases
4292 lib/readline/isearch.c
4293 - _rl_isearch_dispatch: if we end the search and stuff characters back
4294 to be read again, decrement the current key sequence index by 2 so
4295 we don't have duplicate characters in the sequence
4298 - rl_digit_argument: call _rl_del_executing_keyseq after rl_execute_next
4302 builtins/setattr.def
4303 - show_localname_attributes: special-case "-" local variable, since
4304 there is no `declare -' equivalent.
4305 Reported by Emanuele Torre <torreemanuele6@gmail.com>.
4310 - sh_mktmpname,sh_mktmpfd: use get_urandom32() instead of random() if
4311 we're not using mktemp or mkstemp and the system provides the
4315 - trap_variable_context: new variable, set to variable_context every
4316 time a trap string runs (that is, every time running_trap is set to
4317 a value > 0) in _run_trap_internal, run_exit_trap, run_pending_traps
4320 - trap_variable_context: extern declaration
4323 - get_exitstat: if the `return' builtin is running, we are running a
4324 trap (but not the DEBUG trap), and the return would cause the trap
4325 string to complete (variable_context == trap_variable_context, so
4326 we haven't executed another shell function), use the last command
4327 exit value as the return status. POSIX interp 1602, from
4328 https://www.austingroupbugs.net/view.php?id=1602
4333 lib/readline/display.c
4334 - local_prompt_invis_chars: new array variable, similar to
4335 local_prompt_newlines, that keeps track of the number of invisible
4336 characters on each line of the prompt string. Use in WRAP_OFFSET
4337 macro with eye to using in W_OFFSET as well. Used for the case where
4338 the last line of the prompt is not the last line with invisible
4339 characters. Can use this in more calculations replacing wrap_offset
4340 and prompt_invis_chars_first_line going forward. Inspired by report
4341 from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018851
4342 - update_line: use local_prompt_invis_chars to set _rl_last_c_pos
4343 correctly when on a non-terminal prompt line that contains
4344 invisible characters
4349 - get_var_and_type: allocate new memory for *valp and return it if the
4350 type is VT_ARRAYMEMBER. The callers -- all of which treat this case
4351 the same as VT_VARIABLE -- will free appropriately. Fixes problems
4352 with using parameter operations like ## on dynamic array variables,
4353 reported by Ivan Kapranov <koltiradw@yandex.ru> back on 8/31/2022
4356 - change some error messages to make it clearer these are arithmetic
4357 syntax errors. These will require new translations.
4360 - integer_expected_error: change the message to remove `expression',
4361 since this is only called for the `test' builtin, where TEST_ARITHEXP
4362 is not in FLAGS. This will require a new translation.
4363 Reported by Emanuele Torre <torreemanuele6@gmail.com> back on
4369 - reset_timeout: when a timer expires, make sure to cancel any
4370 readline timeout as well with rl_clear_timeout().
4371 From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1023776
4375 builtins/reserved.def
4376 - !: add short help text
4378 lib/readline/complete.c
4379 - make_quoted_replacement: if readline found quote characters anywhere
4380 in the filename, but is not completing on an unclosed quoted string,
4381 and there is an application filename quoting function, let that
4382 function quote the filename if necessary
4385 - COMPLETE_DQUOTE2: new completion quoting style define
4386 - bash_expand_filename: new function, runs a filename passed to it
4387 through word expansion, suppressing command and process substitution
4388 and returns the result (in new memory if it's different than the
4390 - bash_quote_filename: if the return value from bash_check_expchar is
4391 `$' or ``', expand the filename and if it contains characters that
4392 should be quoted, set the quoting style to COMPLETE_DQUOTE2
4393 - bash_quote_filename: if the completion quoting style is COMPLETE_DQUOTE2,
4394 use sh_mkdoublequoted to put double quotes around the entire
4395 unexpanded filename instead of using sh_double_quote, which will
4396 backslash-quote any `$'. This is a start at preserving user-supplied
4397 quotes if the (expanded) completed filename requires them. From
4398 reports by Peng Yu <pengyu.ut@gmail.com> in 5/2020 and
4399 Pedro Gimeno <pgba-da0a@personal.formauri.es> in 6/2021
4404 - report_syntax_error: if word_top is set and we reach EOF, report the
4405 starting line number in the error message. From a patch from
4406 L A Walsh <bash@tlinx.org> and Manuel Reiter <manuel.reiter@dwd.de>
4408 - MAX_CASE_NEST: doubled to 256, renamed to MAX_COMPOUND_NEST
4409 - read_token_word: add `if', `while', and `until' to the set of
4410 compound commands that use WORD_TOP and WORD_LINENO (with
4411 corresponding changes to grammar productions)
4412 - [grammar]: changed check to decrement WORD_TOP to >= 0 since we
4413 start at -1 and we want to decrement back to -1 when all loops are
4417 - jobs_builtin: call notify_and_cleanup after displaying the status of
4418 jobs to implement POSIX requirement that `jobs' remove terminated
4419 jobs from the jobs list
4420 https://pubs.opengroup.org/onlinepubs/9699919799/utilities/jobs.html#tag_20_62
4424 lib/sh/input_avail.c
4425 - include signal.h unconditionally, we need it for HAVE_SELECT and
4427 - nchars_avail: make sure we declare and use readfds and exceptfds if
4428 we have pselect or select available
4430 lib/readline/input.c
4431 - rl_gather_tyi,rl_getc: need to declare and use readfds and exceptfds
4432 if HAVE_PSELECT or HAVE_SELECT is set. Report from
4433 Henry Bent <henry.r.bent@gmail.com>, fixes from
4434 Koichi Murase <myoga.murase@gmail.com>
4439 - quit.h: include unconditionally for declaration of sigemptyset even
4440 if HAVE_SELECT is not defined
4443 - USEC_PER_SEC: make sure it's defined even if HAVE_SELECT is not
4446 - BRACKMATCH: if an equivalence class does not match, and the next
4447 character following the class is a `]', treat that as the end of
4448 the bracket expression.
4449 Report and fix from Koichi Murase <myoga.murase@gmail.com>
4450 - GMATCH: if the current character in the string is a `/' and the
4451 current element in the pattern is a bracket expresion, and the FLAGS
4452 include FNM_PATHNAME, return FNM_NOMATCH immediately. A bracket
4453 expression can never match a slash.
4454 Report and fix from Koichi Murase <myoga.murase@gmail.com>
4455 - BRACKMATCH: if we encounter a <slash> in a bracket expression, either
4456 individually or as part of an equivalence class, nullify the bracket
4457 expression and force the `[' to be matched as an ordinary
4463 - BRACKMATCH: if a slash character appears as the first character
4464 after a non-matching character class or equivalence class, treat
4465 the bracket as an ordinary character that must be matched literally
4466 - BRACKMATCH: if a slash character appears as the second character
4467 of a range expression, treat the bracket as an ordinary character
4468 - BRACKMATCH: if a slash character appears in the portion of a
4469 bracket expression that already matched, treat the bracket as an
4471 Updates from Koichi Murase <myoga.murase@gmail.com>
4472 - BRACKMATCH: if a range expression is incomplete (no end char),
4473 treat the bracket as an ordinary character
4478 - Reporting Bugs: add mention of the Savannah project page. Suggested
4479 by Loïc Yhuel <loic.yhuel@gmail.com>
4484 - SEVAL_NOOPTIMIZE: new flag for parse_and_execute: means don't try to
4485 optimize forks out of any simple or conditional commands
4487 builtins/evalstring.c
4488 - parse_and_execute: if FLAGS includes SEVAL_NOOPTIMIZE, don't try to
4489 call can_optimize_connection to optimize away forks from AND_AND or
4492 builtins/eval.def,trap.c,parse.y,jobs.c
4493 - parse_and_execute: include SEVAL_NOOPTIMIZE in any calls to
4494 parse_and_execute. Fixes bug reported by
4495 Frode Nordahl <frode.nordahl@canonical.com>
4499 lib/readline/readline.c
4500 - readline_initialize_everything: use xmalloc to initialize
4501 rl_executing_keyseq, since we use xrealloc to reallocate it and
4502 don't check it for NULL anywhere
4505 - parameter_brace_expand_word: make sure to update *ESTATEP and pass
4506 ES back to the caller even if array_value returns NULL. Fixes
4507 memory leak referencing unset associative array elements reported
4508 by Ralf Oehler <Ralf@Oehler-Privat.de>; fix from
4509 Koichi Murase <myoga.murase@gmail.com>
4514 - BRACKMATCH: if a backslash appears before a slash in a bracket
4515 expression, treat the whole thing as literal and try to match the
4517 - BRACKMATCH: if a bracket expression ends in an unquoted backslash,
4518 try to match the left bracket literally and go on. More discussion with
4519 Koichi Murase <myoga.murase@gmail.com>
4522 - execute_in_subshell: don't try to optimize away forks in the command
4523 if the subshell command is being timed or its return value is being
4524 inverted. Report from Dabrien 'Dabe' Murphy <dabe@dabe.com>
4528 lib/readline/complete.c
4529 - __WIN32__: remove uses of this preprocessor symbol, use _WIN32
4531 lib/readline/rldefs.h
4532 - Don't define NEW_TTY_DRIVER on _WIN32. Fix from
4533 sparrowhawk996@gmail.com
4535 include/posixselect.h
4536 - include "posixtime.h" instead of <sys/time.h> so the right guards
4540 - read_builtin_timeout: make sure we don't try to call shtimer_select
4541 if HAVE_SELECT isn't define; it won't be compiled in
4544 - restrict: make sure we have a definition if __STDC__ is not defined
4546 include/posixtime.h,lib/sh/gettimeofday.c
4547 - gettimeofday: make sure the function signature matches POSIX by
4552 include/posixselect.h
4553 - don't try to define HAVE_SELECT at all if _WIN32 is defined
4556 - define WIN32_LEAN_AND_MEAN for the windows-specific paste function
4558 lib/readline/rlprivate.h
4559 - _rl_timeout_select: only include declaration if HAVE_SELECT or
4560 HAVE_PSELECT are defined
4564 lib/readline/input.c
4565 - rl_gather_tyi: call rl_input_available_hook after FIONREAD test,
4566 let the application hook into whether or not there are characters
4570 - execute_function: if the maximum function nesting level is exceeded,
4571 run the unwind-protects before jumping back to top level. Report
4572 from felix <felix@f-hauri.ch>
4575 - find_variable_nameref_for_create,find_variable_nameref_for_assignment:
4576 handle find_variable_nameref returning &nameref_maxloop_value, return
4577 NULL and print a warning message in that case
4578 - find_variable_nameref: return &namref_maxloop_value instead of NULL
4579 if the number of resolution cycles exceeds NAMEREF_MAX; change
4580 callers to print a new error message in this case; no other change
4581 in behavior. From a 4/2020 suggestion from Andrej Podzimek
4582 <andrej@podzimek.org>
4583 - find_variable_nameref_context, find_nameref_at_context,
4584 find_variable_last_nameref_context: make sure to return
4585 &nameref_maxloop_value consistently and handle getting it as a
4586 return value from other functions
4590 lib/readline/display.c
4591 - _rl_update_final: if there is only one line (_rl_vis_botlin == 0)
4592 and that line is empty (botline_length == 0), assume there is no
4593 prompt and the line has no contents, so output the CR/LF to indicate
4594 that the newline has been read. From a report from
4595 Kevin Pulo <kev@pulo.com.au>
4599 builtins/evalstring.c
4600 - parse_and_execute: if we are executing the eval builtin, and the
4601 return status from the command is suppressed (builtin_ignoring_errexit),
4602 set CMD_IGNORE_RETURN in the parsed command's flags. From a report
4603 from Tycho Kirchner <tychokirchner@mail.de>
4608 - PARSE_SUBBRACKET: a reworked PARSE_COLLSYM, generalized to handle
4609 [:, [=, and [. special bracket expressions
4610 - BRACKMATCH: change to use PARSE_SUBBRACKET consistently to parse
4611 [:, [=, and [. special bracket expressions
4612 - PATSCAN: takes new FLAGS arg, changed all callers to just pass the
4613 flags they get through to PATSCAN
4614 - PATSCAN: call PARSE_SUBBRACKET for [:, [=, and [. to treat them
4615 consistently (uses FLAGS argument here)
4616 - PATSCAN: handle FNM_NOESCAPE appearing in FLAGS argument
4617 This set of fixes contributed by Koichi Murase <myoga.murase@gmail.com>
4619 lib/glob/{glob,gmisc}.c
4620 - PATSCAN: change all callers to add extra flags arg of 0
4622 doc/{bash.1,bashref.texi}
4623 - trap description: replace ARG with ACTION
4624 - clarify the language describing what trap without arguments and
4625 trap -p without arguments display
4626 - clarify that trap in non-interactive shells does not allow signals
4627 that were ignored at shell start to be trapped; interactive shells
4629 - trap: add missing command types to the description of when the
4630 DEBUG trap is executed
4633 - LONG_DOC: replace ARG with ACTION
4634 - make it clear that trap and trap -p without arguments display a
4635 information about specified signals, but in a form that may be
4636 reused as shell input
4641 - compgen_compspec: new flag saying whether or not we're running via
4642 the compgen builtin or via programmable completion: set to 0
4643 every time gen_progcomp_completions runs, set to 1 in
4644 gen_compspec_completions if this_shell_builtin == compgen_builtin
4645 - gen_shell_function_completions: call rl_clear_signals and
4646 rl_set_signals so the shell's signal handlers are active when
4647 running shell functions to generate completions. We try to do it
4648 only when programmable completion, not the compgen builtin, is active.
4649 Idea from Koichi Murase <myoga.murase@gmail.com>, fixes bug
4653 - sigint_sighandler, termsig_sighandler: since these can now be called
4654 during programmable completion, we need to set the readline signal
4655 event hook if the readline state includes RL_STATE_DISPATCHING or
4656 RL_STATE_COMPLETING, since we can't rely on RL_STATE_SIGHANDLER
4657 being set and we want to call throw_to_top_level here
4658 - throw_to_top_level: if the shell is interactive, before calling
4659 bashline_reset (which zeroes rl_signal_event_hook), call
4660 rl_cleanup_after_signal if we think readline hasn't called it
4666 - add "LOCAL_LDFLAGS = -rdynamic" for freebsd/openbsd/netbsd. Reported
4667 by Christian Weisgerber <naddy@mips.inka.de>
4672 - parameter_brace_expand_length: handle namerefs with values that are
4673 valid length expansion expressions but invalid identifiers. From
4674 ed7-aspire4925@hotmail.com via https://savannah.gnu.org/support/?110799
4679 - extract_heredoc_dolbrace_string: fix off-by-one error after calling
4680 extract_command_subst and extract_process_subst that caused it to
4681 copy one too many parsed characters. Fix for bug reported by
4682 Norbert Lange <nolange79@gmail.com>
4687 - execute_cond_node: if a regular expression fails to compile, print
4688 an error message. Report from Emanuele Torre <torreemanuele6@gmail.com>
4692 - trap_variable_context -> trap_return_context, initialize from
4693 funcnest + sourcenest instead of variable_context so we handle
4694 shell function execution and `./source', both of which can use
4695 `return'. Idea from Koichi Murase <myoga.murase@gmail.com>
4698 - get_exitstat: compare trap_return_context against funcnest+sourcenest,
4699 since that's how it's initialized now
4701 lib/readline/readline.c
4702 - readline_internal_charloop: if we're not using the callback interface,
4703 don't restore _rl_top_level from olevel, since we will just be going
4704 around the loop again and will potentially need to use it multiple
4705 times. Report from Emanuele Torre <torreemanuele6@gmail.com>
4710 - EX_UTILERROR: new generic special builtin return status to indicate a
4711 POSIX utility error that should cause a non-interactive shell to abort
4714 - builtin_status: translate EX_UTILERROR to EXECUTION_FAILURE
4717 - unset_builtin: return EX_UTILERROR if posix_utility_error is set;
4718 set it when trying to unset a non-identifier (variable) or a
4719 non-unsettable or readonly variable
4724 - de_backslash: now takes a second argument with the current quoting
4726 - de_backslash: if the quoting flags include Q_HERE_DOCUMENT and the
4727 shell is in posix mode, remove backslashes quoting double quotes
4730 - de_backslash: update extern declaration
4732 lib/readline/histexpand.c
4733 - history_expand_internal,get_history_word_specifier,get_subst_pattern,
4734 hist_error,history_find_word,hist_string_extract_single_quoted:
4735 now take const char * string arguments
4737 lib/readline/mbutil.c
4738 - _rl_get_char_len,_rl_adjust_point,_rl_find_next_mbchar_internal,
4739 _rl_find_next_mbchar,_rl_find_prev_mbchar,_rl_find_prev_mbchar_internal,
4740 _rl_test_nonzero,_rl_find_prev_utf8char,_rl_is_mbchar_matched,
4741 _rl_compare_chars,_rl_char_value: take const char * string arguments
4746 - parse_symbolic_umask: add missing POSIX pieces:
4747 o `action' of ugo, meaning to copy portions of initial mask
4748 o multiple `op' specs as part of the action string (`u=r-w')
4750 o missing perm characters Xst in action string
4751 o default `who' equivalent to `a' instead of fixing up later
4756 - if -a and -P are both supplied, look in the command hash table but
4757 continue and perform a $PATH search even if the NAME is hashed.
4758 From a report by Adam Vodopjan <adam.vodopjan@gmail.com>
4760 doc/{bash.1,bashref.texi}
4761 - type: update description to fix it to what the code actually does
4764 - set_edit_mode: don't run with_input_from_stdin or with_input_from_stream
4765 unless command_execution_string is NULL. Report from
4766 Harald van Dijk <harald@gigawatt.nl>
4771 - array_concat: add a check for interrupts and terminating signals
4775 - without_job_control: set original_pgrp == NO_PID since we don't
4776 want to be messing with the terminal pgrp if we call end_job_control.
4777 From a report from ks1322 ks1322 <ks1322@gmail.com>
4781 include/{posixtime.h,systimes.h,shmbutil.h,shtty.h}
4787 - _evalfile: add SEVAL_NOOPTIMIZE to the parse_and_execute flags
4788 (maybe overkill, but safer). From a report by
4789 Dan Church <h3xx@gmx.com> and Oguz <oguzismailuysal@gmail.com>
4791 lib/sh/gettimeofday.c
4792 - gettimeofday: added code for _WIN32 version
4796 doc/{bash.1,bashref.texi},builtins/printf.def
4797 - specify the valid format characters as a subset of what printf(3)
4798 specifies, note that the %n format specifier takes a variable name
4799 as an argument. Suggestion from Emanuele Torre <torreemanuele6@gmail.com>
4803 {xmalloc,variables,unwind_prot,trap,test,subst,sig,siglist,shell,redir,
4804 pcomplete,pathexp,make_cmd,mailcheck,jobs,input,hashcmd,hashlib,general,
4805 flags,findcmd,externs,execute_cmd,error,dispose_cmd,command,bashline,
4806 bashhist,assoc,arrayfunc,array,alias}.h
4807 {version,version2}.c
4808 - PARAMS: remove for ANSI C-ification
4810 builtins/{getopt,common,bashgetopt}.h
4811 builtins/{mkbuiltins,gen-helpfiles,psize,psize-posix}.c
4812 builtins/{evalstring,bashgetopt,common,evalfile,getopt}.c
4813 builtins{alias,bind,break,cd,command,complete,declare,enable,exit,fc,
4814 fg_bg,getopts,hash,help,history,jobs,kill,mapfile,printf,pushd,read,set,
4815 shopt,source,suspend,trap,type,ulimit,umask,wait}.def
4816 - PARAMS: remove for ANSI C-ification
4818 lib/malloc/{watch,table,shmalloc,mstats,imalloc}.h
4819 lib/malloc/{malloc,stats,table,trace}.c
4820 - PARAMS: remove for ANSI C-ification
4822 lib/glob/{glob,strmatch}.h
4823 lib/glob/{glob,glob_loop,gmisc,sm_loop,smatch,strmatch,xmbsrtowcs}.c
4824 - PARAMS: remove for ANSI C-ification
4826 lib/intl/{eval-plural,plural-exp,loadinfo,hash-string,gettextP}.h,
4827 lib/intl{plural.y,plural.c},
4828 lib/intl/{finddomain,bindtextdom,dcigettext,l10nflist,loadmsgcat,localealias,plural-exp}.c
4829 - PARAMS: remove for ANSI C-ification
4831 - internal_function -> inline
4833 lib/sh/{casemod,clock,eaccess,fnxform,fpurge,makepath,mktime,netopen,pathphys,random,shquote,snprintf,spell,strtod,strtoimax,strtoumax,times,timeval,tmpfile,unicode,winsize,zcatfd,zgetline,zmapfd}.c
4834 - PARAMS: remove for ANSI C-ification
4836 support/{bashversion.c,mkversion.sh,mksignames.c}
4837 - PARAMS: remove for ANSI C-ification
4839 lib/sh/{clock,strchrnul,getcwd,times,rename,inet_aton,strdup,strerror,strnlen
4840 strpbrk,strtod,strtoimax,strtol,strtoumax,wcsdup,wcsnwidth,wcswidth,strcasecmp,
4842 - C89-style function declarations
4844 lib/malloc/{alloca,malloc,stats,table,trace,xmalloc}.c
4845 - C89-style function declarations
4849 lib/glob/{glob,glob_loop,gmisc,sm_loop,smatch,strmatch,xmbsrtowcs}.c
4850 - C89-style function declarations
4852 lib/sh/{zcatfd,zgetline,zmapfd,zread,zwrite,winsize,vprint,uconvert,ufuncs,
4854 lib/sh/{stringlist,stringvec,strtrans,strvis,timeval,tmpfile}.c
4855 lib/sh/{setlinebuf,shmatch,shmbchar,shquote,shtty,snprintf,spell}.c
4856 lib/sh/{random,pathcanon,pathphys,oslib,netconn,netopen}.c
4857 lib/sh/{mailstat,makepath,mbscasecmp,mbschr,mbscmp,mktime}.c
4858 lib/sh/{input_avail,itos,getenv,fmtulong,fnxform,eaccess,dprintf,casemod,clktck}.c
4859 - C89-style function declarations
4861 examples/loadables/{accept,asort,basename,bcat,cat,csv,cut,dirname,dsv}.c
4862 examples/loadables/{fdflags,finfo,head,hello,id,lcut,ln}.c
4863 examples/loadables/{mkdir,mkfifo,mktemp,mypid,necho,pathchk}.c
4864 examples/loadables/{print,printenv,push,realpath,rm,rmdir,seq}.c
4865 examples/loadables/{setpgid,stat,strftime,sync,tee,template,truefalse,tty}.c
4866 examples/loadables/{uname,unlink,whoami}.c
4867 - C89-style function declarations
4869 xmalloc.c, array2.c, list.c, dispose_cmd.c, copy_cmd.c, bracecomp.c, mksyntax.c
4870 - PARAMS: remove for ANSI C-ification
4871 - C89-style function declarations
4875 hashlib.c,assoc.c,input.c,hashcmd.c,alias.c,alias.h,array.c,flags.c,pcomplib.c,
4877 variables.c,arrayfunc.c,bashhist.c,bashline.c,error.c,pathexp.c,nojobs.c,
4878 stringlib.c,eval.c,findcmd.c,mailcheck.c,make_cmd.c,shell.c,print_cmd.c,
4880 - PARAMS: remove for ANSI C-ification
4881 - C89-style function declarations
4882 - add `const' and `inline' where it makes sense
4886 test.c,execute_cmd.c,parse.y,pcomplete.c,trap.c,subst.c,braces.c,jobs.c,sig.c
4887 builtins/{evalstring.c,gen-helpfiles.c,mkbuiltins.c}
4888 builtins/{alias.def,bind.def,break.def,builtin.def,caller.def,cd.def,colon.def}
4889 builtins/{command.def,complete.def,declare.def,echo.def,enable.def,eval.def}
4890 builtins/{exec.def,exit.def,fc.def,fg_bg.def,hash.def,help.def,history.def}
4891 builtins/{jobs.def,kill.def,let.def,mapfile.def,printf.def,pushd.def,read.def}
4892 builtins/{return.def,set.def,setattr.def,shift.def,shopt.def,source.def}
4893 builtins/{suspend.def,test.def,times.def,trap.def,type.def,ulimit.def}
4894 builtins/{umask.def,wait.def}
4895 - PARAMS: remove for ANSI C-ification
4896 - C89-style function declarations
4897 - add `const' and `inline' where it makes sense
4901 lib/sh/{stringvec.c,inet_aton.c,strnlen.c,spell.c,netopen.c,stringlist.c}
4902 lib/sh/{strtrans.c,tmpfile.c,uconvert.c,zcatfd.c}
4903 builtins/{common.c,common.h}
4904 mailcheck.c,bashline.c,pathexp.c,stringlib.c,locale.c,pcomplete.c,redir.c
4905 test.c,trap.c,variables.c,bashhist.c,expr.c,arrayfunc.c,assoc.c,variables.c
4907 arrayfunc.h,variables.h,findcmd.h,bashline.h,trap.h,pathexp.h,externs.h,
4908 pcomplete.h,bashhist.h,assoc.h,general.h,subst.h
4909 - more `const' changes, remove `register'
4914 - more `const' changes, remove `register'
4917 - VARLIST: list_len and list_size now size_t
4920 - vlist_alloc: take size_t parameter, changed callers
4921 - vlist_realloc: take size_t parameter, changed callers
4923 lib/sh/stringvec.c,externs.h
4924 - functions that take int size params now take size_t
4925 - strvec_len: returns size_t
4927 lib/sh/stringlist.c,externs.h
4928 - STRINGLIST: list_size and list_len now size_t
4929 - functions that take int size params now take size_t
4931 variables.c,bashline.c,builtins/bind.def
4932 - change strvec_ int parameters to size_t where it makes sense
4933 - change strlist_ int parameters to size_t where it makes sense
4936 - reset_shopt_options: set glob_always_skip_dot_and_dotdot to 1,
4937 since that's the current default in lib/glob/glob.c
4941 execute_cmd.c,parse.y,general.c,make_cmd.c,print_cmd.c,variables.c,expr.c
4942 jobs.c,subst.c,input.c,unwind_prot.c,pathexp.c,pathexp.h,alias.c,bashline.c
4943 bashhist.c,lib/sh/shquote.c,externs.h,stringlib.c,locale.c,findcmd.c
4944 builtins/common.c,builtins/declare.def,builtins/enable.def,builtins/fc.def
4945 lib/sh/zmapfd.c,builtins/help.def,builtins/mapfile.def,builtins/read.def
4946 builtins/shopt.def,lib/glob/glob.c,lib/glob/smatch.c,lib/glob/sm_loop.c
4947 lib/glob/xmbsrtowcs.c,lib/glob/gmisc.c,lib/glob/gm_loop.c
4948 lib/sh/getenv.c,lib/sh/makepath.c,lib/sh/pathphys.c,lib/sh/tmpfile.c
4949 lib/sh/stringlib.c,lib/sh/spell.c,lib/sh/strtrans.c,lib/sh/zgetline.c
4950 lib/sh/mbscasecmp.c,lib/sh/utf8.c
4951 lib/readline/readline.c,lib/readline/rlprivate.h,lib/readline/vi_mode.c
4952 lib/readline/complete.c,lib/readline/bind.c,lib/readline/isearch.c
4953 lib/readline/util.c,lib/readline/kill.c,lib/readline/macro.c
4954 lib/readline/text.c,lib/readline/histexpand.c,lib/readline/histfile.c
4955 lib/readline/mbutil.c,lib/tilde/tilde.c
4957 - remove some unused variables
4963 - sh_getopt_restore_state: make sure argv[sh_curopt] is non-null before
4967 - CHECK_FOR_RESERVED_WORD: make sure to set word_top appropriately if
4968 the last token was IF, WHILE, or UNTIL, since these tokens can follow
4969 those reserved words
4972 - ubsan: new target, to build with gcc/clang UBSan undefined behavior
4977 execute_cmd.[ch],locale.c,parse.y,expr.c,bracecomp.c,bashline.c,externs.h
4978 stringlib.c,general.[ch]
4979 builtins/{subst.c,array.c,echo.def,printf.def,enable.def,help.def,set.def}
4980 lib/sh/{strtrans.c,stringvec.c,shquote.c}
4982 lib/readline/{vi_mode.c,histfile.c,funmap.c,complete.c,display.c,bind.c,isearch.c}
4984 - final code cleanups for ANSI C and lint/ubsan/asan runs
4988 lib/readline/complete.c
4989 - rl_complete_internal: when computing nontrivial_lcd and the length
4990 of the text from the line buffer, dequote the text from the line
4991 buffer before comparing it against the common prefix of the matches
4992 (matches[0]), so we don't get spurious mismatches if the quoted text
4993 from the line is longer than the unquoted match. Report from
4994 Martin Castillo <castilma@uni-bremen.de>
4997 - get_buffered_stream(fd): new function, return the BUFFERED_STREAM *
4998 corresponding to file descriptor FD, if it exists
5003 - shell_getc: if yy_getc returns EOF but the buffered stream input
5004 indicates an error state, set shell_input_line_terminator to
5005 READERR. Currently treated the same as EOF.
5010 - intrand32: use % operator instead of (mathematically equivalent)
5011 subtraction and multiplication, which can cause signed 32-bit
5012 overflow. Report from Sam James <sam@gentoo.org>
5014 lib/readline/input.c
5015 - rl_getc: if the application hasn't defined a signal event handler,
5016 and readline is in callback mode, make sure SIGINT breaks out of
5017 operations like incremental and non-incremental searches and digit
5018 arguments by calling _rl_abort_internal, since the callback code
5019 expects the various contexts that rl_callback_sigcleanup() resets
5021 - rl_getc: if there is a pending signal when we enter the while loop
5022 in callback mode, handle it in the same way we would if a signal
5023 arrived while we were waiting in select/pselect. That forces
5024 callback mode to call _rl_abort_internal in the right place.
5025 From a report from Andrew Burgess <aburgess@redhat.com>
5030 - SIG_ASYNCSIG: new value for sigmodes; means that the signal is
5031 ignored because an async command is being executed
5032 - set_signal: if the original signal disposition is SIG_IGN only
5033 return if SIG_ASYNCSIG isn't set. This implements POSIX interp 751
5035 - ignore_signal: if we're ignoring a signal that already has SIG_IGNORED
5036 set, make sure we set SIG_TRAPPED in case of SIG_ASYNCSIG (POSIX
5038 - reset_signal,restore_signal: if we want to reset or restore a signal
5039 that has SIG_ASYNCSIG set, make sure we reset to SIG_DFL if the
5040 signal is trapped to maintain POSIX semantics
5041 - set_signal_async_ignored: new function to set original_signals to
5042 SIG_IGN and set the SIG_IGNORED and SIG_ASYNCSIG sigmode flags; used
5043 by setup_async_signals
5044 - signal_is_async_ignored: return true if the SIG argument is being
5045 ignored because it's part of an async list
5048 - set_signal_async_ignored,signal_is_async_ignored: extern declarations
5051 - initialize_terminating_signals: if a signal is ignored because it's
5052 part of an async list, don't bother trying to initialize or set the
5056 - execute_simple_command: if we're executing a builtin or function
5057 asynchronously, call reset_terminating_signals like we do in
5058 execute_in_subshell()
5059 - execute_subshell_builtin_or_function: only call set_sigint_handler
5060 if async is 0, so we don't undo the work done by setup_async_signals.
5061 If the old handler is SIG_IGN and the signal has SIG_ASYNCSIG set
5062 and isn't trapped, restore the old handler
5063 - setup_async_signals: call set_signal_async_ignored to set the right
5069 - read_token_word: if we're in posix mode, and we find a reserved word
5070 before checking a token for aliases, turn off the `check next word
5071 for aliases' flag (PST_ALEXPNEXT). This is for compatibility with
5072 other shells. From a report by <anonymous4feedback@outlook.com>
5073 - shell_getc: make sure the shell is reading a buffered stream before
5074 checking the default buffered stream for errors if yy_getc returns 0
5079 - split_at_delims: if the cursor is at whitespace just preceding a
5080 word, and we're doing this for completion (e.g., to build COMP_WORDS),
5081 force the creation of an empty word and set the current word to it.
5082 This is a change from previous behavior, but a useful one: it makes
5083 COMP_WORDS[COMP_CWORD] and $2 to a completion function consistent
5084 and the same as the word readline wants to complete. From a report
5085 from Naim Favier <n@monade.li> back in 6/2022
5088 - read_token: turn off PST_ALEXPNEXT if we read a shell metacharacter:
5089 we will expand aliases anyway if the token puts the shell in a
5090 command word position and we took pains to turn it off for
5091 redirection tokens; remove special cases that turned it off
5092 - pop_string: don't turn off PST_ALEXPNEXT if it's on; this is what
5093 prevents it from being enabled if an alias expansion of more than
5094 two aliases ends with a space. Fixes issue reported by
5095 <anonymous4feedback@outlook.com>
5100 - wait_for: if we are reaping a background job, don't bother trying to
5101 give the terminal back to shell_pgrp -- we never set the terminal's
5102 pgrp to that job in the first place. Fixes issue reported by
5103 Steffen Nurpmeso <steffen@sdaoden.eu>
5107 lib/readline/{histexpand.c,history.h}
5108 - history_expand: first argument is now `const char *'. Request from
5109 Simon Marchi <simon.marchi@polymtl.ca>
5111 lib/readline/doc/{history.3,hstech.texi}
5112 - history_expansion: change description to note new const first arg
5116 lib/readline/input.c
5117 - rl_gather_tyi: move call to rl_input_available_hook to the top,
5118 giving it first shot. There's still no way for it to set chars_avail.
5119 Conditionalize the rest of the input methods based on whether the
5122 lib/readline/rl_private.h
5123 - move the decision making about RL_TIMEOUT_USE_SELECT/RL_TIMEOUT_USE_SIGALRM
5129 - restore_default_signal: if we have a signal that's not trapped, but
5130 is a signal that is set to SIG_ASYNCSIG, POSIX interp 751 requires
5131 the shell to allow it to be reset to the default, even though it
5132 wasn't already trapped
5135 - do_assignment_internal: don't allocate new memory for NAME, just
5136 modify and restore it in place
5140 lib/readline/histfile.c
5141 - history_write_slow: a fallback function that uses stdio to write the
5142 history list to a supplied file descriptor
5143 - history_do_write: call history_write_slow if ftruncate/mmap/malloc
5144 fail; hope the simpler approach works
5149 - valid_function_name: new function, returns non-zero if the name
5150 can be used as a function name without the `function' prefix
5153 - named_function_string,print_function_def: use valid_function_name so
5154 the rules about when to use the `function' reserved word are
5158 - new option -P, which prints only the action associated with each
5159 signal spec argument
5161 doc/{bash.1,bashref.texi}
5162 - trap: document new -P option, add note that trap -p or trap -P in a
5163 subshell can print the parent's traps
5168 - shell_getc: make sure references to shell_input_line_property are
5169 protected by #ifdef HANDLE_MULTIBYTE. From
5170 https://savannah.gnu.org/patch/?10309
5173 - named_function_string,print_function_def: don't copy the function
5174 COMMAND * before printing it as text; unwind-protect any redirects
5175 attached to the function body
5178 - PST_CMDBLTIN: new parser state, means the previous token word was
5179 `command' in a command position
5180 - read_token_word: in posix mode, "command" followed by a declaration
5181 utility preserves the declaration utility status of the following
5182 word, so we mark that state and then check a word for being an
5183 assignment builtin if in that state on the next call. This makes
5184 compound assignments to builtins that accept them (e.g., `declare')
5185 work as if `command' were not present. This is a POSIX issue 8
5187 - read_token: turn off PST_CMDBLTIN state as appropriate
5190 - use locale_mb_cur_max instead of MB_CUR_MAX consistently
5195 - printf_builtin: %q and %Q use the `alternate form' flag to force
5196 single quoting instead of backslash quoting. $'...' is still
5197 preferred if there are characters that require it
5198 - getwidestr, getwidechar: functions to take a possibly multibyte
5199 character string and convert to a wide character string or a wide
5200 character, respectively
5201 - convwidestr, convwidechar: functions to take a wide character string
5202 or single character, apply any precision, convert back to a multibyte
5203 character string, and return the result for printing
5204 - printf_builtin: consistently print an error message if printstr()
5205 returns < 0, since it will only do that if ferror(stdout) is true;
5206 let the PRETURN macro do that if appropriate, so we don't duplicate
5212 - printwidestr: wide-character version of printstr; understands
5213 fieldwidth and precision as characters instead of bytes
5214 - printf_builtin: interpret %ls and %lc as referring to wide strings
5215 and characters, respectively; use printwidestr to print the wide-
5216 character string obtained from the (presumably multibyte) argument.
5217 Fieldwidth and precision are characters, not bytes
5222 - unset_builtin: since tokenize_array_reference modifies its NAME
5223 argument, we need to restore the original word if there is no
5224 array variable found with that name, so we can go ahead and try to
5225 unset a function with that wonky name. Inspired by a report from
5226 Emanuele Torre <torreemanuele6@gmail.com>
5229 - read_token_word: don't set the W_HASDOLLAR flag in the returned WORD
5230 for <(command) and >(command). That way they can be used in function
5234 - execute_simple_command: if in posix mode, don't perform function
5235 lookup for command names that contain a slash
5238 - dyn_load_builtins: don't allow dynamically loaded builtins to have
5239 slashes in their name
5244 - valid_function_word: new function, used to check whether a word can
5245 be used as a function name. Replaces call to check_identifier();
5246 incorporates POSIX interp 383 check for special builtin so we can
5247 move it out of execute_intern_function().
5248 - valid_function_name: use the FLAGS argument instead of POSIXLY_CORRECT;
5249 only reject reserved words if FLAGS&1
5252 - execute_intern_function: call valid_function_word() instead of
5253 check_identifier(); remove check for special builtin that
5254 valid_function_word performs
5257 - print_function_def,named_function_string: pass POSIXLY_CORRECT to
5258 valid_function_name as the FLAGS argument
5263 - expand_subscript_string: don't set W_NOTILDE in td.flags so we
5264 perform `normal' tilde expansion (expansion at the start of the
5265 word) on the array subscript
5266 - expand_oneword,expand_compound_assignment_word: change second arg to
5267 ATYPE, which better reflects its use
5270 - assign_assoc_from_kvlist,assign_compound_array_list,expand_and_quote_assoc_word:
5271 use expand_assignment_string_to_string instead of expand_subscript_string
5272 for the rhs of the assignment or the second word in the kvpair to
5273 be more consistent with how assignment statements behave (e.g.,
5274 tilde expansion). Fixes issue reported by maroloccio@gmail.com
5279 - discard_until: now returns the last character read. If we get an
5280 EOF while processing a comment, return EOF (rarely happens;
5281 shell_getc returns EOF only under certain circumstances)
5282 - read_token: if discard_until returns EOF, return yacc_EOF
5285 - bclearerror: new macro, clears the B_ERROR flag in the buffered
5289 - b_fill_buffer: try making errors `sticky': if the B_ERROR flag is
5290 set for the buffered stream, return EOF immediately. This is similar
5294 - fc_builtin: in posix mode, if there are extra arguments supplied to
5295 -s (e.g. pat=rep first last), throw an error
5297 doc/{bash.1,bashref.texi}
5298 - printf: document new altform for %q/%Q and %ls/%lc
5303 - set_up_new_line: if the new line doesn't change rl_line_buffer,
5304 just return right away without changing rl_point. Affects
5305 alias-expand-line, history-expand-line, and history-and-alias-expand-line.
5306 Inspired by a report from
5307 Addison Brendtro <addison.brendtro@gmail.com>
5309 builtins/declare.def
5310 - declare_internal: make multiple calls to `local -' at the same
5311 context have no effect after the first one. That way we don't keep
5312 overwriting the saved option set. Report and fix from
5313 Emanuele Torre <torreemanuele6@gmail.com>
5318 - bind_lastarg: now a public function
5321 - execute_variable_command: call bind_lastarg instead of bind_variable
5322 to avoid exporting $_ if allexport is set. Fix from
5323 Emanuele Torre <torreemanuele6@gmail.com>
5324 - history_delimiting_chars: if we're parsing some kind of delimited
5325 construct that's *not* a quoted string, don't bother adding an extra
5326 newline to the history if the current history entry already ends in
5327 a newline. From https://savannah.gnu.org/support/?110838 via
5328 Ganapathi Kamath <hgkamath@hotmail.com>
5333 - set_up_new_line: add some more heuristics to try and usefully
5338 lib/readline/complete.c
5339 - complete_fncmp: fix for case mapping `-' and `_' if the bytes do not
5340 form a valid multibyte character
5343 - new functions: _rl_strcaseeqn, like strcasencmp but with a flag to
5344 handle character mapping (-_) like completion-map-case wants, and
5345 _rl_charcasecmp, to do the same thing for two characters.
5346 Inspired by a patch from Brennan Vincent <brennan@umanwizard.com>
5348 lib/readline/mbutil.c
5349 - new functions: _rl_mb_strcaseeqn and _rl_mb_charcasecmp, multibyte
5350 versions of the above
5351 Inspired by a patch from Brennan Vincent <brennan@umanwizard.com>
5353 lib/readline/{rlprivate.h,rlmbutil.h}
5354 - extern declarations for the above functions
5356 lib/readline/complete.c
5357 - complete_fncmp: use _rl_mb_strcaseeqn and _rl_strcaseeqn as
5358 appropriate, remove duplicated inline code
5359 Inspired by a patch from Brennan Vincent <brennan@umanwizard.com>
5361 lib/readline/{isearch.c,rlprivate.h}
5362 - _rl_search_case_fold: new variable, will be used to indicate case-
5363 insensitive incremental and non-incremental searches
5366 - search-ignore-case: new bindable variable, tied to _rl_search_case_fold
5367 Inspired by a patch from Brennan Vincent <brennan@umanwizard.com>
5370 - mbsncmp(3) replacement
5372 lib/readline/isearch.c
5373 - _rl_isearch_dispatch: honor `search-ignore-case' variable and perform
5374 case-insensitive incremental searches if it's set
5375 Inspired by a patch from Brennan Vincent <brennan@umanwizard.com>
5377 lib/readline/histlib.h
5378 - CASEFOLD_SEARCH: new flag for history searching, means to search
5379 strings case-insensitively
5381 lib/readline/histsearch.c
5382 - history_search_internal: anchored searches honor CASEFOLD_SEARCH
5384 lib/readline/histsearch.c
5385 - history_search_internal: searches now honor CASEFOLD_SEARCH
5386 - _hs_history_search: new function, just external interface to
5387 history_search_internal, allows the rest of the library to specify
5390 lib/readline/histlib.h
5391 - _hs_history_search: extern declaration
5393 lib/readline/search.c
5394 - noninc_search_from_pos: use _hs_history_search, add CASEFOLD_SEARCH
5395 to flags if _rl_search_case_fold is non-zero
5397 doc/bash.1,lib/readline/doc/{readline.3,rluser.texi}
5398 - search-ignore-case: document new bindable variable
5403 - PATSUB_REPLACE_DEFAULT: macro set to 1 or 0 to set the default value
5404 of `patsub_replacement'. Can be overridden by -DPATSUB_REPLACE_DEFAULT=0
5405 in the `make' command
5408 - reset_shopt_options: reset patsub_replacement to PATSUB_REPLACE_DEFAULT
5411 - patsub_replacement: initialize to PATSUB_REPLACE_DEFAULT
5414 - shell_getc: only call clearerr(stdin) when yy_stream_get returns EOF
5415 if the shell is currently interactive (interactive != 0)
5416 - shell_getc: if the shell is not interactive (interactive_shell == 0)
5417 and using stdio to read the script (bash_input.type == st_stream),
5418 set shell_input_line_terminator to READERR if ferror(stdin) is true
5419 after yy_stream_get returns EOF
5423 doc/{bash.1,bashref.texi}
5424 - update aliases description based on a bug-bash discussion
5425 - update description of word splitting behavior when IFS is unset
5428 - _evalfile: if reading the entire file doesn't return the same
5429 number of bytes as requested (the file size), treat this as a read
5435 - yylex: if read_token returns < 0, return YYEOF if EOF_Reached = 1.
5436 Don't return yacc_EOF because that allows commands to be executed.
5437 - grammar: add a production to handle YYEOF, treating it the same as
5438 yacc_EOF. Based on a report from
5439 Eduardo A. Bustamante López <dualbus@gmail.com>
5442 - wait_for: if we're checking for window size changes, allow checks
5443 during trap commands while readline is active or `bind -x' command
5444 execution. Fix from Koichi Murase <myoga.murase@gmail.com>
5449 - wait_for: check for window size changes during programmable completion
5453 execute_cmd.c,input.c,jobs.c,nojobs.c,parse.y,redir.c,shell.c
5454 builtins/{exec.def,read.def}
5456 - BUFFERED_INPUT: preprocessor #define is gone, this code is now
5461 builtins/declare.def
5462 - declare_internal: set the att_propagate flag on a variable that is
5463 marked as att_tempvar only if it's *not* marked att_local. The
5464 effect is that local variables with the same name as variables in
5465 the temporary environment are not propagated to the previous scope.
5466 From a report by Voldemar Lazarev <voldemar.lazarev@alludo.com>
5467 that prompted a bug-bash discussion
5469 builtins/setattr.def
5470 - set_var_attribute: don't set local variables for which we are setting
5471 export or readonly to propagate back to the previous context, but
5472 make sure we preserve posix semantics
5475 - read_token_word: if we're parsing the words of a compound assignment
5476 (parser_state & PST_COMPASSIGN), and we have a valid assignment
5477 statement as a word ([sub]=value), set W_NOBRACE in the word so we
5478 don't try and perform brace expansion on it. This makes ( [sub]=word )
5479 closer to name[sub]=word.
5480 From a report by Ilkka Virta <itvirta@iki.fi> back in July, 2020:
5481 https://lists.gnu.org/archive/html/bug-bash/2020-07/msg00133.html
5485 lib/readline/display.c
5486 - rl_redisplay: if HANDLE_MULTIBYTE is defined, do the special META_CHAR
5487 handling if wc_bytes == wc_width == 1
5490 - eval_arith_for_expr: make sure we don't call make_word with a NULL
5491 string if expand_arith_string returns NULL. Report from
5492 F G <frank.graziano@gmail.com>
5495 - assign_assoc_from_kvlist: added code, currently disabled, to perform
5496 all expansions, including word splitting, on the kv-pair word list
5500 lib/readline/search.c
5501 - rl_history_search_reinit: change check against history_string_size
5502 to account for history_string_size now being a size_t. Report and
5503 fix from Grisha Levit <grishalevit@gmail.com>
5507 lib/readline/history.c
5508 - _hs_search_history_data: search the history list for an entry with
5509 `data' matching the argument; return the index
5510 - _hs_replace_history_data: search backwards through the history list
5513 lib/readline/histlib.h
5514 - _hs_search_history_data: extern declaration
5516 lib/readline/search.c
5517 - make_history_line_current: make sure rl_undo_list doesn't appear in
5518 any history entries (it should be a private search string undo list)
5522 - _rl_free_saved_history_line: make sure the undo list in
5523 _rl_saved_line_for_history isn't rl_undo_list and doesn't appear in
5524 any history list entries as `data' before freeing it. Fixes core
5525 dump after SIGINT reported by Grisha Levit <grishalevit@gmail.com>
5528 - changes for size_t when computing new amount for xrealloc
5533 - set_word_top: new inline function to check and set word_top; called
5534 from the appropriate places
5535 - parse_dparen: call set_word_top before parsing an arith command or
5536 nested subshell. Fixes underflow issue reported by
5537 Grisha Levit <grishalevit@gmail.com>
5539 examples/loadables/kv.c
5540 - kv: new loadable builtin, reads key-value pairs from stdin and assigns
5541 them to an associative array
5546 - trap_builtin: if trying to restore SIGQUIT to its default disposition,
5547 and the shell is in posix mode, set to SIG_DFL if the shell is
5548 running as an async command and signal_is_async_ignored (SIGQUIT) is
5549 true. Posix conformance issue 751
5554 - print_alias: now returns int. Check for write errors using sh_chkwrite
5555 and return EXECUTION_FAILURE if it fails
5556 - alias_builtin: if print_alias returns EXECUTION_FAILURE, return
5557 EXECUTION_FAILURE immediately (write error). POSIX test conformance
5562 - change_to_directory: if we're not in physical mode and are in posix
5563 mode, add step 9 of the posix cd algorithm, which essentially tries
5564 the pathname the user supplied if it's shorter than PATH_MAX and the
5565 length of the canonicalized pathname is longer than PATH_MAX. This
5566 is basically what default bash mode does without the length checks.
5567 POSIX test conformance.
5570 - strip_trailing_ifs_whitespace: use ifs_whitespace(*s) instead of
5571 spctabnl(*s) like word splitting and get_word_from_string. POSIX
5575 - wait_for: tweak change from 1/18 to make sure a J_ASYNC job isn't in
5576 the foreground (J_FOREGROUND) as it would be if it had been continued
5577 in the foreground with `fg'; if it is, we want to give the terminal
5583 - fd_berror: returns true if the file descriptor passed as an arg
5584 corresponds to a buffered stream with an error condition
5587 - shell_getc: use fd_berror instead of inline code
5588 - shell_getc: if yy_getc returns EOF, immediately set line[0] to NULL
5589 and set shell_input_line_terminator to READERR. Then exit immediately
5590 with status 128 if index == 0, line[index] == NULL, and READERR.
5594 - FATAL_READERROR: now defined to 1 by default
5596 lib/readline/display.c
5597 - rl_expand_prompt: allocate an empty string for local_prompt if prompt
5598 is the NULL or empty string. Fixes seg fault with rl_message and
5599 empty prompt reported by Grisha Levit <grishalevit@gmail.com>
5601 lib/readline/histexpand.c
5602 - history_expand: if hist_extract_single_quoted returns an index at or
5603 past the end of the string, correct the index and break the loop,
5604 which will cause a return. Report and fix from
5605 Grisha Levit <grishalevit@gmail.com>
5609 lib/readline/vi_mode.c
5610 - rl_domove_motion_callback: set the MOVE_FAILED flag in the context M
5611 if rl_dispatch returns non-zero and other movement-command-specific
5612 conditions are met. Right now, an unsuccessful `f' or `F' command
5614 - _rl_vi_domove_motion_cleanup: if the command is `c' or `C', we don't
5615 enter insert mode if the MOVE_FAILED flag is set in the context M.
5616 This is how standalone vi works.
5619 - rl_unix_filename_rubout: add some checks for rl_point > 0 before
5620 looking at rl_line_buffer[rl_point - 1]. Report and fix from
5621 Grisha Levit <grishalevit@gmail.com>
5623 lib/readline/isearch.c
5624 - _rl_isearch_dispatch: reset cxt->sline_index to 0 if it's past the
5625 end of the history string (sline_len). Fixes asan bug reported by
5626 Grisha Levit <grishalevit@gmail.com>
5628 lib/readline/histexpand.c
5629 - history_tokenize_word: don't increment the string index past the
5630 NULL if the line ends in a backslash.Fixes asan bug reported by
5631 Grisha Levit <grishalevit@gmail.com>
5633 lib/readline/vi_mode.c
5634 - rl_vi_yank_to,rl_vi_change_to,rl_vi_delete_to: if these are called
5635 with an existing valid vimvcxt, save it and allocate a new one for
5636 the current function call to use, then restore it before returning.
5637 This prevents referencing vimvcxt after freeing it in the case that
5638 these functions call each other recursively (e.g., y1y1, c1d1, etc.).
5639 Fixes asan bug reported by Grisha Levit <grishalevit@gmail.com>
5644 - bash_add_history: make sure curlen is large enough before checking
5645 curlen - 1 and curlen - 2, otherwise you can get buffer underflow.
5646 Fixes asan bug reported by Grisha Levit <grishalevit@gmail.com>
5649 - bash_spell_correct_shellword: don't bother trying to correct empty
5650 words. Fixes asan bug reported by Grisha Levit <grishalevit@gmail.com>
5653 - sh_mkdoublequoted: make sure to allocate enough memory for the
5654 pathological case: where every character in the string needs to be
5655 backslash-escaped because it's special within double quotes.
5656 Fixes asan bug reported by Grisha Levit <grishalevit@gmail.com>
5658 doc/{bash.1,bashref.texi}
5659 - here documents: make sure the summary specifies the here-document is
5660 terminated by `delimiter'; specify what the delimiter is if the word
5661 is not quoted. Prompted by a help-bash post from
5662 goncholden <goncholden@protonmail.com>
5666 doc/bash.1,lib/readline/doc/rluser.texi
5667 - shell-expand-line: enumerate the specific expansions performed.
5668 From a request by Alex Bochannek <alex@bochannek.com>
5671 - path_value: new function, returns normalized version of $PATH. Takes
5672 a single argument saying whether or not to look in the temporary
5673 environment first. Normalizes null $PATH (PATH=) into ".". From a
5674 bug-bash discussion started by Moshe Looks <moshe.looks@gmail.com>
5675 - _find_user_command_in_path: use path_value()
5676 - user_command_matches: use path_value()
5677 - search_for_command: if PATH[0] == 0, set PATH = "." like path_value().
5678 This has the side effect of calling command_not_found_handle when
5679 PATH is the empty string and the command isn't in the current
5681 - search_for_command: if path == 0, but we found an executable in the
5682 current directory, make sure to set dot_found_in_search before adding
5683 it to the command hash table
5686 - path_value: extern declaration
5689 - command_word_completion_function: use path_value()
5692 - dyn_load_builtin: use path_value for BASH_LOADABLES_PATH; it's cleaner
5693 though it doesn't change the behavior
5698 - bashline_reset: reset rl_filename_quoting_function, since there is a
5699 SIGINT code path where it could remain reset by glob completion.
5700 Reported by Grisha Levit <grishalevit@gmail.com>
5701 - command_word_completion_function,command_subst_completion_function,
5702 glob_complete_word: set some static variables to NULL
5703 after freeing them so they don't potentially get freed twice after
5704 a SIGINT during completion
5705 Reported by Grisha Levit <grishalevit@gmail.com>
5708 - read_token_word: when deciding how to quote translated strings, don't
5709 free ttok before comparing it to ttrans
5710 Reported by Grisha Levit <grishalevit@gmail.com>
5711 - parse_matched_pair: same thing for freeing nestret
5712 - read_token: if we return a newline, make sure we call set_word_top()
5714 Fixes underflow reported by Grisha Levit <grishalevit@gmail.com>
5717 - EXTMATCH: don't bother with FNM_PATHNAME checks; this function isn't
5718 called with a pathname.
5719 Fixes underflow reported by Grisha Levit <grishalevit@gmail.com>
5722 - rl_maybe_replace_line: if we replace a history entry's data with
5723 rl_undo_list, we need to set rl_undo_list to 0, since we should not
5724 have rl_undo_list pointing to something from a history entry
5725 Fixes asan error reported by Grisha Levit <grishalevit@gmail.com>
5729 lib/readline/histexpand.c
5730 - postproc_subst_rhs: fix off-by-one error when reallocating new string
5731 for case where we're *not* substituting for `&'
5732 Fixes asan error reported by Grisha Levit <grishalevit@gmail.com>
5735 - terminate_current_pipeline: add a SIGKILL call in there in case the
5736 SIGTERM doesn't work
5737 - terminate_current_pipeline: add a version that works when job control
5738 isn't enabled (pipeline_pgrp == shell_pgrp)
5741 - skip_to_delim: pass completeflag (SX_COMPLETE) to extract_dollar_brace_string
5742 in case it includes a command substitution, since we want to inhibit
5743 error messages in this case
5746 - no_semi_successors: add DOLPAREN to list since something like $(\n
5747 shouldn't have a semicolon added there.
5748 From a report by Grisha Levit <grishalevit@gmail.com>
5753 - gen_globpat_matches: set noglob_dot_filenames here since we're not
5754 calling shell_glob_filename to do it
5755 From a report by Grisha Levit <grishalevit@gmail.com>
5760 - rl_maybe_replace_line: if we're replacing a history entry with the
5761 current line buffer and undo list, then zero out any undo list in
5762 _rl_saved_line_for_history, since we're not going to use it any more
5763 Fixes asan error reported by Grisha Levit <grishalevit@gmail.com>
5766 - rl_free_undo_list: if we're freeing rl_undo_list, it can't be a
5767 valid value for data in _rl_saved_line_for_history
5768 Fixes asan error reported by Grisha Levit <grishalevit@gmail.com>
5770 lib/readline/complete.c
5771 - display_matches: don't call rl_display_match_list if we received a
5772 signal during get_y_or_n and didn't jump out for some reason
5773 From a report by Grisha Levit <grishalevit@gmail.com>
5774 - rl_display_match_list: return if we received a signal during
5775 _rl_internal_pager (via get_y_or_n) and didn't jump out
5776 From a report by Grisha Levit <grishalevit@gmail.com>
5780 lib/readline/history.c
5781 - history_truncate_file: don't bother trying to read the existing
5782 history file if we're just truncating it to 0 lines
5786 lib/readline/history.c
5787 - history_truncate_file: fix off-by-one error that resulted in the
5788 timestamp associated with the first history entry not being written
5789 to the truncated history file
5790 From a report by Grisha Levit <grishalevit@gmail.com>
5793 - decode_prompt_string: do something rational if localtime() returns
5794 NULL (extraordinarily rare)
5795 From a report by Paul Eggert <eggert@cs.ucla.edu>
5797 examples/loadables/stat.c
5800 examples/loadables/strftime.c
5801 - strftime_builtin: ditto
5803 lib/readline/examples/histexamp.c
5807 - getnow(): new inline function, calls gettimeofday and returns tv_sec;
5808 replacement for time(0). From Paul Eggert <eggert@cs.ucla.edu>
5811 - NOW: use a call to getnow() to standardize on gettimeofday for time
5814 lib/readline/history.c
5815 - include #posixtime.h for getnow()
5816 - hist_inittime: use getnow() instead of calling time(0)
5819 - posixtime.h: include instead of <time.h>
5820 - decode_prompt_string: use getnow() instead of calling time(0)
5825 - count_all_jobs: add extern definition if JOB_CONTROL is not defined.
5826 From Emanuele Torre <torreemanuele6@gmail.com>
5829 - bash_add_history: make sure the current history line is not empty
5830 before checking what ended it.
5831 From a report by Grisha Levit <grishalevit@gmail.com>
5833 lib/readline/histexpand.c
5834 - history_tokenize_word: break out of loop for incomplete command and
5835 process substitution or extended globbing patterns
5836 From a report by Grisha Levit <grishalevit@gmail.com>
5839 - hostnames_matching: fix size_t issue when checking whether to realloc
5840 From a report by Grisha Levit <grishalevit@gmail.com>
5843 - genseed: use uintptr_t instead of u_bits32_t to silence compiler
5844 warnings. From Paul Eggert <eggert@cs.ucla.edu>
5848 builtins/mkbuiltins.c,builtins/psize-posix.c,version.c
5849 builtins/getopts.def
5850 lib/readline/text.c,lib/readline/bind.c
5851 support/recho.c,support/mksignames.c,support/zecho.c,support/xcase.c
5852 support/printenv.c,support/signames.c,support/bashversion.c
5853 support/memtest.c,support/endian.c
5855 - some cleanups for function prototypes and other stdc requirements
5856 From Paul Eggert <eggert@cs.ucla.edu>
5858 lib/readline/doc/{rltech.texi,hstech.texi}
5859 - add prototypes and stdc requirements to the examples
5861 builtins/complete.def
5862 - compgen_builtin: save and restore readline variables affecting how
5863 filename completions are treated in case someone uses compgen in
5865 From a report by Grisha Levit <grishalevit@gmail.com>
5870 builtins/enable.def,builtins/gen-helpfiles.c,builtins/help.def,builtins/printf.def
5872 include/ansi_stdlib.h,include/ocache.h
5873 lib/glob/collsyms.h,lib/glob/glob.c
5874 lib/readline/history.h,lib/readline/xmalloc.h
5880 - don't bother with __STDC__ if we are just using C89 features like
5881 const, function prototypes, etc.
5882 From Paul Eggert <eggert@cs.ucla.edu>
5885 - prototype the list functions that take GENERIC_LIST *
5886 From Paul Eggert <eggert@cs.ucla.edu>
5888 builtins/common.c,examples/loadables/getconf.c
5889 execute_cmd.c,pcomplete.c,subst.c
5890 lib/sh/stringlist.c,lib/sh/stringvec.c
5891 - changes and casts now that the generic list functions are prototyped
5892 From Paul Eggert <eggert@cs.ucla.edu>
5896 aclocal.m4,configure.ac
5897 builtins/common.c,builtins/mkbuiltins.c,builtins/printf.def
5898 include/memalloc.h,include/stdc.h
5900 pcomplete.c,print_cmd.c
5902 lib/readline/bind.c,lib/readline/complete.c,lib/readline/display.c
5903 lib/readline/funmap.c,lib/readline/util.c,lib/readline/parens.c
5904 lib/readline/histlib.h
5905 lib/readline/readline.h,lib/readline/rldefs.h,lib/readline/rlstdc.h,lib/readline/rlprivate.h
5906 lib/sh/dprintf.c,lib/sh/snprintf.c,lib/sh/vprintf.c
5907 lib/malloc/shmalloc.h,lib/malloc/imalloc.h,lib/malloc/xmalloc.c
5908 lib/termcap/termcap.h
5909 - stdarg: since we now assume C89 for prototypes at least, always
5910 prefer stdarg to old-style varargs
5911 - SH_VA_START: now use plain old va_start
5912 - don't bother with extern declarations for standard C89 functions
5913 From Paul Eggert <eggert@cs.ucla.edu>
5916 - PREFER_STDARG: remove
5918 builtins/mkbuiltins.c
5919 execute_cmd.c,unwind_prot.c
5921 - start on ANSI/ISO C changes for the unwind-protect framework
5922 - introduce new unwind-protect function pointer type to replace
5924 From Paul Eggert <eggert@cs.ucla.edu>
5928 builtins/command.def,builtins/fc.def,builtins/read.def,builtins/source.def
5929 builtins/evalfile.c,builtins/evalstring.c
5930 dispose_cmd.c,execute_cmd.c,pcomplete.c,print_cmd.c,subst.c,jobs.c,variables.c
5931 dispose_cmd.h,general.h,trap.h
5932 unwind_prot.c,unwind_prot.h
5933 - rest of work to convert unwind-protect framework to ANSI/ISO C.
5934 Convert unwind-protects to use new shim functions that obey the new
5935 unwind-protect function type
5936 From Paul Eggert <eggert@cs.ucla.edu>
5939 - STREQ, STREQN: now static inline functions to take advantage of arg
5943 lib/readline/histexpand.c,lib/readline/mbutil.c
5944 - fix size_t subtractions in comparisons to avoid unsigned underflow
5949 - add prototypes for functions taking clock_t and timeval, make their
5950 declaration in externs.h conditional on NEED_CLOCK_FUNCS_DECL and
5951 NEED_TIMEVAL_FUNCS_DECL, respectively
5956 - expand_string_dollar_quote: check for zero-length return from
5957 string_extract_{single,double}_quoted and avoid size_t underflow
5958 Fixes asan error reported by Grisha Levit <grishalevit@gmail.com>
5962 builtins/evalstring.c
5963 - open_redir_file: treat the case of failing to open the file as a
5964 non-fatal expansion error instead of a (fatal) redirection error.
5965 Report from Zev Weiss <zev@bewilderbeest.net>
5969 lib/readline/vi_mode.c
5970 - _rl_domove_motion_cleanup: d/D require the same special case as c/C
5971 so that a motion command that doesn't move the cursor consumes/deletes
5972 at least one character.
5973 From Emanuele Torre <torreemanuele6@gmail.com>
5974 - _rl_domove_motion_cleanup: ditto for y/Y
5975 - rl_domove_motion_callback: if t/T/;/, fail (return non-zero without
5976 moving point), flag the motion command as having failed (MOVE_FAILED)
5981 - command_substitute: save the return status of the child process in
5982 last_command_subst_status; don't assign to last_command_exit_value
5983 in posix mode (posix interp 1150)
5986 - execute_null_command: a simple command without a command word but
5987 with command substitutions now returns last_command_subst_status.
5988 It may or may not have already modified $? depending on posix mode
5991 - redir_varvalue: legal_number validity check should be == 0, not < 0
5992 From a report by Grisha Levit <grishalevit@gmail.com>
5997 - parameter_brace_expand_rhs: check for namerefs in the variable name
5998 part of the ${name=word} expansion so we can go back and implement
5999 the POSIX semantics of returning "the final value of parameter."
6000 From a report by Grisha Levit <grishalevit@gmail.com>
6003 - sigpipe_handler: clean up, set $?, and throw to top level on receipt
6005 - termsig_handler: if the variable builtin_catch_sigpipe is set (it's
6006 not set anywhere yet), call sigpipe_handler instead of terminating
6007 the shell. Still need to make sure a sighandler is installed for
6008 SIGPIPE even if initialize_terminating_signals isn't called
6013 - sh_mktmpfd: add support for MT_UNLINK flag, unlinks created filename
6014 before returning fd, fails if the unlink fails for some reason
6019 - globsort: support for various glob sorting criteria as defined by
6020 the GLOBSORT variable: name, size, blocks, mtime, atime, ctime.
6021 Default is ascending sort by name, as is traditional. Based on an
6022 idea from Evan Gates <evan.gates@gmail.com>
6023 - setup_globsort: parse the value of the GLOBSORT variable, find
6024 sorting type and whether or not it's ascending or descending
6025 - noquote_glob_filename: glob_filename for programmable completion,
6026 doesn't call quote_string_for_globbing and honors GLOBSORT, dotglob,
6030 - gen_globpat_matches: call noquote_glob_filename, let that handle
6031 all the variables and GLOB_FAILED
6034 - GLOBSORT: support for special variable, call setup_globsort on
6037 doc/bash.1,doc/bashref.texi
6038 - GLOBSORT: document variable and its effects on pathname expansion
6042 builtins/complete.def
6043 - build_actions: take an additional char ** arg VNAMEP; if it is non-
6044 null, accept a -V VARNAME option that names an indexed array
6045 variable in which to store the completions.
6046 - compgen_builtin: if the -V option is supplied, store the possible
6047 completions into VARNAME instead of printing them on stdout. From a
6048 patch from Grisha Levit <grishalevit@gmail.com>, idea originally
6049 from konsolebox <konsolebox@gmail.com> back in 2/2022
6051 doc/bash.1,lib/readline/doc/rluser.texi
6052 - compgen: document new -V option
6056 lib/readline/vi_mode.c
6057 - rl_domove_read_callback: call _rl_arg_init before reading digit
6058 argument so prompt gets saved, both callback and non-callback modes
6059 From a report by Grisha Levit <grishalevit@gmail.com>
6060 - rl_vi_arg_dispatch: if we return 0 to end the digit argument and
6061 turn off NUMERICARG, call rl_restore_prompt
6063 lib/readline/histexpand.c
6064 - history_expand_internal: make sure subst_lhs is not null before we
6065 call postproc_subst_rhs.
6066 From a report by Grisha Levit <grishalevit@gmail.com>
6068 lib/readline/display.c
6069 - rl_redisplay: remove redundant code that ends up incrementing lpos
6070 too much for meta characters displayed as octal escape sequences.
6071 From a report by Grisha Levit <grishalevit@gmail.com>
6076 - attempt_shell_completion: handle case where s > e after calls to
6077 find_cmd_start and find_cmd_end, respectively.
6078 From a report by Grisha Levit <grishalevit@gmail.com>
6080 lib/readline/display.c
6081 - update_line: fix setting of `wsatend' when computing ols and nls in
6082 the multibyte case; this caused redisplay to print more characters
6084 - update_line: fix calculation of visible_wrap_offset when moving up
6085 to line 0, trying to figure whether or not the visible prompt has
6086 any invisible characters. Fixes C locale issue reported by
6087 Grisha Levit <grishalevit@gmail.com>
6092 - _rl_rubout_char: update erase-at-end-of-line hack to deal with the
6093 unlikely event that a character in a non-multibyte locale is
6094 displayed using an octal representation.
6095 From a report by Grisha Levit <grishalevit@gmail.com>
6097 execute_cmd.c,execute_cmd.h,builtins/evalstring.c
6098 - interrupt_execution: replaces `executing_list'
6099 - interrupt_execution: set while executing while, for, until, select,
6100 and arithmetic for loops
6103 - wait_for: if a process dies due to a SIGINT while the shell is
6104 executing a loop or a list, act as if the shell got SIGINT. This
6105 is no longer dependent on the compatibility level
6106 From a report by Grisha Levit <grishalevit@gmail.com>
6109 - name_is_acceptable: allow FIGNORE suffixes to match the entire
6110 pathname like tcsh does instead of requiring a non-empty prefix.
6111 From Emanuele Torre <torreemanuele6@gmail.com>
6116 - _rl_unsave_line: new function, takes a HIST_ENTRY * as an argument,
6117 generalized rl_maybe_unsave_line
6118 - _rl_alloc_saved_line: allocate a new HIST_ENTRY *, populate it like
6119 rl_saved_line_for_history
6120 - _rl_free_saved_line: free a saved HIST_ENTRY *
6121 - _rl_free_saved_history_line: call _rl_free_saved_line
6122 - _rl_previous_history_internal: new function, internals of
6123 rl_get_previous_history; change rl_get_previous_history to call it
6125 lib/readline/history.h
6126 - HIST_ENTRY_DEFINED: define sentinel if HIST_ENTRY struct defined
6128 lib/readline/rlprivate.h
6129 - _rl_alloc_saved_line,_rl_free_saved_line,_rl_unsave_line: new extern
6130 function definitions
6131 - _rl_free_saved_search_line: new extern definition
6133 lib/readline/search.c
6134 - _rl_saved_line_for_search: use private storage to save current line,
6135 avoid clashes with rl_saved_line_for_history
6136 - _rl_free_saved_search_line,_rl_unsave_saved_search_line: new functions
6137 to manage _rl_saved_line_for_search
6138 - noninc_dosearch,_rl_nsearch_abort: clean up _rl_saved_line_for_search
6139 instead of rl_saved_line_for_history
6140 - rl_history_search_internal: allocate private _rl_saved_line_for_search;
6141 unsave or free it as appropriate
6142 - _rl_history_search_reinit: free up any _rl_saved_line_for_search just
6145 lib/readline/vi_mode.c
6146 - rl_vi_search: free _rl_saved_line_for_search, since that's what the
6147 non-incremental search functions use now
6148 - rl_domove_read_callback: if we read a numeric argument, then a motion
6149 character, make sure the motion character is valid before returning
6151 From a report by minipython <599192367@qq.com>
6155 lib/readline/display.c
6156 - _rl_move_cursor_relative: when checking to see whether data is within
6157 the invisible line, make sure to stay within the invisible line
6158 line break boundaries
6159 From a report by minipython <599192367@qq.com>
6161 lib/readline/search.c
6162 - dispose_saved_search_line: new function, either unsave the saved
6163 search line (if we're not at the end of the history) or free it
6164 (if we are). Needs to be immediately followed by call to
6165 make_history_line_current, which resets rl_undo_list
6166 - make_history_line_current: change strategy: rely on callers to
6167 manage _rl_saved_line_for_search and rl_undo_list; just copy the
6168 data from the passed history entry into the line buffer and reset
6170 - noninc_dosearch,rl_history_search_internal: call dispose_saved_search_line
6171 before calling make_history_line_current
6174 - _rl_start_using_history: free the undo list associated with
6175 _rl_saved_line_for_history, if one exists. Have to watch out for
6176 this causing pointer aliasing problems, maybe add a call to
6177 _hs_search_history_data()
6182 - sh_globsort: a sort specifier of `nosort' disables sorting completely
6184 doc/bash.1,doc/bashref.texi
6185 - GLOBSORT: document `nosort' sort specifier
6188 - attempt_shell_completion: attempt completion with the empty command
6189 for a null command word on a line with only whitespace following any
6190 optional assignment statements
6191 - attempt_shell_completion: make sure that the start of the command
6192 word is not after rl_point before calling the programmable completion
6193 for the initial word.
6194 From a report by Grisha Levit <grishalevit@gmail.com>
6196 lib/readline/histexpand.c
6197 - history_expand: don't read past the end of the string if it ends with
6198 an incomplete multibyte character
6199 From a report by Grisha Levit <grishalevit@gmail.com>
6204 - _rl_insert_char: make sure to return 1 in all cases where there are
6205 pending bytes accumulating for a multibyte character
6206 - _rl_insert_char: if the COUNT argument is 0, insert any pending
6207 bytes read so far. The idea is that these bytes were accumulating
6208 to compose a possible multibyte character, and the count of 0
6209 indicates that the current character doesn't contribute to that
6210 because it's bound to an editing command.
6211 - rl_insert, rl_quoted_insert: make sure to call _rl_insert_char
6212 with a 0 count as appropriate to insert any accumulating bytes
6213 From a patch by Grisha Levit <grishalevit@gmail.com>
6216 - top_level_cleanup,throw_to_top_level: set variable_context to 0, just
6220 - function_misc_cleanup: new function, runs make_funcname_visible and
6221 unlink_fifo_list at the end of execute_function, replaces inline
6223 - uw_function_misc_cleanup: unwind-protect function, just calls
6224 function_misc_cleanup. Installed by execute_function.
6225 Partial fix for FUNCNAME bug reported by Grisha Levit <grishalevit@gmail.com>
6226 - execute_builtin: run unwind-protects if evalnest exeeds max
6227 - execute_builtin: run unwind-protects if sourcenest exeeds max
6230 - parse_string_to_word_list: set current_token = '\n' on error
6231 - parse_string_to_word_list: if we're executing and not running in
6232 parse_and_execute, call top_level_cleanup before we jump to the
6233 top level. Rest of fix for FUNCNAME bug
6234 - parse_compound_assignment: set last_read_token and current_token to
6235 '\n' on parse error. Fix for alias expansion bug reported by
6236 Grisha Levit <grishalevit@gmail.com>
6237 - parse_compound_assignment: if we're executing and not running in
6238 parse_and_execute, call top_level_cleanup before we jump to the
6244 - run_sigchld_trap: don't freeze and unfreeze the jobs list; move it
6245 to the callers who are running this on SIGCHLD receipt and cannot
6246 deal with jobs disappearing from the list while they're running
6247 - waitchld: if we are running the wait builtin, continue to run the
6248 SIGCHLD trap immediately upon signal receipt, but freeze and
6249 unfreeze the jobs list around the call to run_sigchld_trap().
6250 Fixes issue with `jobs' in a SIGCHLD trap not removing jobs from
6251 the jobs list reported by Guldrelokk <me@rarity.fan>
6256 - fd_to_buffered_stream: make sure buffers[fd2] is non-null before
6257 turning on SHAREDBUF.
6258 From Emanuele Torre <torreemanuele6@gmail.com>
6261 - reader_loop: save and restore EOF_Reached around expanding $PS0,
6262 setting it to 0 for the expansion so it doesn't affect things like
6263 command substitution.
6264 From a report by Grisha Levit <grishalevit@gmail.com>
6267 - parse_comsub: handle ${Ccommand; }, where C == space, tab, newline,
6269 - read_token_word: understand ${Ccommand; } and call parse_comsub to
6271 - parse_matched_pair: understand ${Ccommand; } inside another paired
6273 - new `funsub' production, like comsub but for ${Ccommand;} nofork
6274 command substitution
6277 - execute_simple_command: if we fork because of pipes in or out, clear
6278 the fifo list, since subshell aren't supposed to inherit fifos
6283 - PST_FUNSUBST: new parser state, parsing the command in ${Ccommand;}.
6284 Primarily used to have read_token_word return `}' as a separate
6285 token even if it's not delimited like a reserved word
6288 - SX_FUNSUB: new flag, tell xparse_dolparen we are parsing the command
6289 in a ${Ccommand;} nofork command substitution
6292 - xparse_dolparen: handle parsing ${Ccommand;} nofork command
6293 substitution like parse_comsub
6294 - read_token: if we're parsing a foreground command substitution,
6295 treat a word that begins with an unquoted `}' as a `}' token to
6296 terminate the ${Ccommand;} construct without requiring that the
6297 close brace be delimited like a reserved word
6298 - no_semi_successors: add DOLBRACE
6299 - reserved_word_acceptable: add DOLBRACE
6302 - extract_function_subst: like extract_command_subst, but for nofork
6303 command substitutions; calls xparse_dolparen with the SX_FUNSUB
6304 flag to differentiate
6305 - string_extract_double_quoted,extract_delimited_string,
6306 extract_heredoc_dolbrace_string,extract_dollar_brace_string,
6307 param_expand: call extract_function_subst as appropriate
6308 - function_substitute: like command_substitute, but for nofork command
6309 substitutions. Just a stub for now
6314 - pipeline_saver: already_making_children now saved and restored as
6315 part of the struct; no longer need a separate variable
6316 - save_pipeline,restore_pipeline: save already_making_children to struct
6319 - parse_comsub,xparse_dolparen: handle `(' as the first char of a
6320 funsub (ksh93 supports that)
6323 - function_substitute: complete implementation; handle both funsubs
6324 and valsubs (need different terminology); dummy up a fake shell
6325 function so local variables and `return' work; do the right thing
6327 - executing_funsub: flag for the rest of the shell to know we're
6328 expanding a funsub; used by parse_and_execute
6330 builtins/evalstring.c
6331 - parse_and_execute: check executing_funsub to do the right thing with
6332 alias expansion and posix mode
6336 doc/bash.1,doc/bashref.texi
6337 - function substitution (or lambda substitution, or nofork command
6338 substitution): document
6343 - function_substitute: make sure to decrement variable_context in the
6344 unwind-protects since we don't unwind_protect it individually.
6345 Report from Oguz <oguzismailuysal@gmail.com>
6350 - i370 machines cannot use the bash malloc
6351 Patch from Igor Todorovski <itodorov@ca.ibm.com>
6354 - initialize_signames: add support for z/OS signals.
6355 Patch from Igor Todorovski <itodorov@ca.ibm.com>
6358 - collseqcmp: new name for collequiv[_wc], that function apparently
6359 exists in libc on z/OS
6360 Patch from Igor Todorovski <itodorov@ca.ibm.com>
6363 - mark_all_jobs_as_dead: make sure to reset js.j_ndead to the right
6364 number of jobs in the array
6367 - execute_while_or_until: move call to REAP() after the action
6368 executes, like other loop functions
6370 shell.c,parse.y,lib/intl/gettextP.h
6371 - add some __MVS__ checks for z/OS systems
6376 - wait_for_any_job: catch jobs that can terminate and be reaped
6377 when we call UNBLOCK_CHILD between the loop where we check the
6378 jobs list for dead jobs and the loop where we check for running
6379 jobs and poll for them with wait_for().
6380 Fixes bug reported by Aleksey Covacevice <aleksey.covacevice@gmail.com>
6385 - read_comsub: quote CTLNUL if it's in $IFS and we're parsing the
6386 RHS of an assignment statement
6387 - comsub_quote_string: ditto
6388 - comsub_shouldquote: break code that decides whether to CTLESC escape
6389 a character read from a command substitution or $REPLY into its own
6390 inline function; change read_comsub/comsub_quote_string callers
6395 - quote_escapes_internal: use ifs_cmap instead of iterating through
6396 ifs_value to set skip_ctlesc and skip_ctlnul
6401 - remove `(' from FUNSUB_CHARS
6404 - parse_comsub: don't bother with `(' as one of the FUNSUB_CHARS
6406 doc/bash.1,doc/bashref.texi
6407 - command substitution: remove mention of `(' as a valid character
6408 following the open brace in nofork command substitution
6413 - parse_comsub: avoid adding `;' to an empty ${ command substitution
6414 - parse_comsub: if open == '{', push back a newline we read into
6415 peekc to get PS2 prompting right.
6416 From a report by Grisha Levit <grishalevit@gmail.com>
6419 - skip_double_quoted: pass the SX_COMPLETE flag down to
6420 extract_dollar_brace_string in case it contains an unclosed command
6422 From a report by Grisha Levit <grishalevit@gmail.com>
6427 - make sure shell_initialized is set to 1 before running -c command
6430 - make_function_def: initialize source_file to something other than
6431 `main' or `environment' if the shell is not interactive.
6432 From a report from Emanuele Torre <torreemanuele6@gmail.com>
6435 - save_token_state,restore_token_state: save and restore token_to_read
6436 - read_token_word: if we read EOF in an interactive shell, set
6437 token_to_read to yacc_EOF and EOF_Reached to 1 so the token will
6438 be delimited but the next call to read_token returns yacc_EOF
6439 - handle_ignoreeof: broke the code that checks eof_encountered and
6440 possibly exceeds the ignoreeof limit out into a separate public
6441 function, called from handle_eof_input_unit
6444 - reader_loop: if EOF_Reached is set in an interactive shell after
6445 parse_command and execute_command, and ignoreeof has been enabled,
6446 check for ignoreeof with handle_ignoreeof and reset EOF_Reached
6447 back to 0 if we should not exit. This can occur when EOF delimits
6448 a simple command (simple_command_terminator)
6449 From a report by Grisha Levit <grishalevit@gmail.com>
6453 lib/readline/mbutil.c
6454 - _rl_get_char_len: if SRC is "", make sure to return 0
6456 lib/readline/isearch.c
6457 - _rl_isearch_callback: if _rl_search_getchar returns EOF, return 1
6458 to abort search; if it returns with RL_STATE_ISEARCH unset, return
6459 1 (handling a signal can turn it off via _rl_isearch_cleanup)
6464 - _rl_insert_char, rl_quoted_insert: minor fixes from Grisha Levit
6467 - bexpand: use the same calculation for the size of the return buffer
6469 From a report by Grisha Levit <grishalevit@gmail.com>
6472 - locale_setblanks: work around problem with macOS where isblank(x)
6473 incorrectly returns true for characters 0x80-0xff in a UTF-8 locale
6474 From a report by Grisha Levit <grishalevit@gmail.com>
6475 - set_default_locale_vars,set_locale_vars,reset_locale_vars: make sure
6476 we call locale_setblanks after setting/resetting locale_utf8locale,
6477 since we use that in locale_setblanks
6480 - charseqcmp,is_cclass,FOLD: make sure we don't treat chars >= 0x80
6481 as valid in a UTF-8 locale, since they are multibyte characters.
6482 From a report by Grisha Levit <grishalevit@gmail.com> with a full
6483 explanation in http://www.openradar.me/FB9973780
6488 - enable_builtin: don't call dlopen with a null pathname, it will
6489 succeed. Report from Wiley Young <wyeth2485@gmail.com>
6491 lib/readline/readline.c
6492 - _rl_dispatch_subseq: if a user binds do-lowercase-version to something
6493 that isn't an uppercase character, flag an error rather than recurse.
6494 From a report by Grisha Levit <grishalevit@gmail.com>
6499 - enable_builtin: don't try to load a builtin that's not found if
6500 the -n flag is supplied.
6501 From a report from Emanuele Torre <torreemanuele6@gmail.com>
6504 - parse_comsub: use was_word code again to make sure we add a closing
6505 `;' if the last token parsed before the closing ';' or '\n' was a
6506 word, no matter what character ends it.
6507 From a report by Grisha Levit <grishalevit@gmail.com>
6509 aclocal.m4,configure.ac,findcmd.c
6510 - IBM z/OS changes from Igor Todorovski <itodorov@ca.ibm.com>
6515 - shell_getc: if the shell is not interactive and reading from a
6516 buffered stream or stdin, and not expanding an alias, add a
6517 backslash to a line ending with <backslash><EOF> like we do when
6518 reading from a string. This prevents a backslash-newline from
6519 being discarded when we are removing backslash-newlines from the
6520 input, since we will add a newline to shell_input_line in this case.
6521 From a report by Rob Landley <rob@landley.net>
6524 - parse_compound_assignment: check and compensate for an alias being
6525 popped out from underneath this function by read_token() (e.g.,
6526 alias L='m=("x")'. Since we don't push a new input source, we should
6527 never restore pushed_string_list from the saved parser state, but
6528 we check and only do this if we were expanding an alias when this
6529 function was called.
6530 From a report by Wiley Young <wyeth2485@gmail.com>
6535 - print_if_command: make sure to print any pending here-documents after
6537 From https://bugzilla.redhat.com/show_bug.cgi?id=2211214
6540 - if -n is supplied with -f, attempt to load the builtin but mark it
6541 as disabled after loading.
6542 Suggested by Robert Elz <kre@munnari.OZ.AU>
6545 - _evalfile: increment retain_fifos, so we don't delete any FIFOs or
6546 pipes we inherited before sourcing this file; restore original value
6548 From https://savannah.gnu.org/support/index.php?110883
6553 - expand_string_dollar_quote: if singlequote_translations is set, there
6554 is a chance for a use-after-free of `t'.
6555 From a report by Grisha Levit <grishalevit@gmail.com>
6559 jobs.c,nojobs.c,jobs.h
6560 - job_control_active_p: new function, returns 1 if job control is
6561 currently enabled and we have given away the terminal
6563 builtins/evalstring.c
6564 - should_suppress_fork: don't optimize away the fork if job control is
6565 active because we need to call end_job_control and give the terminal
6566 back to the original process group when this command finishes. Call
6567 job_control_active_p() to check this.
6568 Report from Andrew Hamon <and.ham95@gmail.com>
6573 - ssh_run_startup_files: new variable, set by run_startup_files if
6574 the shell decides it's being run by ssh and runs bashrc (only if
6575 SSH_SOURCE_BASHRC is defined). Non-zero while the startup files
6576 are being run. Not used by any other part of the shell yet.
6581 - new inline functions to convert between assignment flags (ASS_*),
6582 array value flags (AV_*), and valid array flags (VA_*)
6585 - include arrayfunc.h after subst.h and variables.h so all the values
6586 for the new inline functions are available
6589 - bind_int_variable: use convert_assign_flags_to_validarray_flags and
6590 convert_assign_flags_to_arrayval flags instead of inline assignments
6593 - builtin_bind_variable: use convert_assign_flags_to_validarray_flags
6594 instead of inline assignments
6597 - assign_array_element: use convert_assign_flags_to_arrayval_flags
6598 instead of inline code
6599 - assign_array_element_internal: use convert_assign_flags_to_arrayval_flags
6600 to pass the right values to array_expand_index
6601 - assign_array_var_from_string: since expand_compound_array_assignment
6602 performs one round of expansion on the subscripts, make sure to add
6603 ASS_NOEXPAND (if assoc_expand_once is set) and ASS_ALLOWALLSUB to the
6604 flags we pass to assign_compound_array_list
6605 - unbind_array_index: use convert_validarray_flags_to_array_value_flags
6606 to pass the right values to array_expand_index
6607 - array_expand_index: uncomment code tagged for bash-5.3 that checks
6608 AV_NOEXPAND and suppresses call to expand_arith_string if it's set.
6609 This set of changes extends assoc_expand_once to indexed arrays
6611 arrayfunc.[ch],execute_cmd.c,expr.c,test.c,builtins/common.c,builtins/mkbuiltins.c
6612 builtins/declare.def,builtins/set.def,builtins/shopt.def
6613 - array_expand_once: new name for internal assoc_expand_once variable
6618 - array_expand_once: new option, replaces assoc_expand_once
6620 doc/bash.1,doc/bashref.texi
6621 - array_expand_once: document new shopt option
6625 lib/readline/complete.c
6626 - rl_full_quoting_desired: new application-settable variable, if set
6627 to non-zero by an application completion function, all completions
6628 will be quoted as if they were filenames, subject to the value of
6629 rl_filename_quote_characters. Initialized to 0 and reset to 0
6630 by set_completion_defaults.
6631 From a contribution by Grisha Levit <grishalevit@gmail.com>
6632 - QUOTING_DESIRED: new macro to check whether we should quote completions
6634 lib/readline/readline.h
6635 - rl_full_quoting_desired: extern declaration
6637 lib/readline/doc/rltech.texi
6638 - rl_full_quoting_desired: document
6641 - bumped version to 5.3-devel
6644 - COPT_FULLQUOTE: new compspec option, for rl_full_quoting_desired
6647 - pcomp_set_readline_variables: set rl_full_quoting_desired according
6650 builtins/complete.def
6651 - fullquote: add new complete/compopt option value
6653 doc/bash.1,lib/readline/doc/rluser.texi
6654 - fullquote: document new complete/compopt option
6657 - timeval_to_secs: sfp argument is now a long *; there is a new
6658 maxval argument (always 10^6 for now) that determines how to
6659 round; returns tv_usec in *sfp if maxval == 10^6; otherwise
6660 return value is basically tv_usec/maxval with rounding
6661 - print_timeval: change argument type in call to timeval_to_secs
6664 - clock_t_to_secs: sfp argument is now a long *
6665 - print_clock_t: change argument type in call to clock_t_to_secs
6668 - timeval_to_seconds, clock_t_to_seconds: change prototypes
6671 - mkfmt,print_formatted_time: fractional seconds arguments are now
6673 - mkfmt: accept precisions up to 6; since sec_fraction is in usecs,
6674 perform any necessary rounding for precisions < 6
6675 - print_formatted_time: allow precision specifiers up to 6; default
6677 - time_command: fractional seconds variables are now long; add new
6678 argument to timeval_to_secs (always 1000000)
6679 - time_command: if we call clock_t_to_secs, multiply the return
6680 fractional seconds value by 1000 to convert it from msec to usec
6682 doc/bash.1,doc/bashref.texi
6683 - TIMEFORMAT: document that the max precision is now 6
6684 From https://savannah.gnu.org/support/?110343
6689 - get_monoseconds: use clock_gettime to return the value of the
6690 system's monotonic clock, if available
6691 - BASH_MONOSECONDS: a new dynamic variable that returns the value of
6693 From a suggestion by William Kennington <wak@google.com>
6695 doc/bash.1,doc/bashref.texi
6696 - BASH_MONOSECONDS: document
6699 - save_bash_trapsig,set_bash_trapsig,restore_bash_trapsig: functions
6700 to manage value of BASH_TRAPSIG
6701 - run_pending_traps: save and restore the value of BASH_TRAPSIG; set
6702 it to the numeric signal number of the trap being run while it's
6704 From a feature request by Eric Marceau <ericmarceau@rogers.com>
6705 - _run_trap_internal,run_exit_trap: save and restore BASH_TRAPSIG;
6706 make sure it's set appropriately
6708 doc/bash.1,doc/bashref.texi
6709 - BASH_TRAPSIG: document
6711 builtins/declare.def
6712 - declare_internal: if declare is supplied -f and an argument that
6713 looks like an assignment statement, fail only if there is not a
6714 function with that name already defined.
6715 From a report from Emanuele Torre <torreemanuele6@gmail.com>
6719 - wait_for: make checkwinsize work in subshell commands started from
6721 New feature request by Kerin Millar <kfm@plushkava.net>
6724 - semicolon: don't return immediately unless a preceding `&' is
6725 itself preceded by a space, as the rest of the printing code prints
6726 asynchronous commands.
6727 Report and patch by Grisha Levit <grishalevit@gmail.com>
6732 - arrayvar_copyval: copy an array or hash table from shell variable
6736 - arrayvar_copyval: extern declaration
6739 - ASS_NOTEMPENV: new flag for bind_variable and assignments
6742 - bind_variable: if ASS_NOTEMPENV is in FLAGS, don't bother calling
6743 bind_tempenv_variable
6745 builtins/declare.def
6746 - declare_internal: if we find the variable in the temporary
6747 environment, call bind_variable with the ASS_NOTEMPENV flag since
6748 we are already dealing with a variable from the temporary environment
6749 - declare_internal: if we bind a new global variable because we're
6750 modifying a variable from the temporary environment, make sure to
6751 call arrayvar_copyval to copy array variables from the temporary
6752 environment to the global scope
6755 - push_temp_var: if we are pushing an array variable, make sure to
6756 call arrayvar_copyval on the new variable
6757 Final fix for bug reported by Wiley Young <wyeth2485@gmail.com>
6758 - push_posix_tempvar_internal: call arrayar_copyval instead of using
6764 - sh_regmatch: use builtin_find_indexed_array to allow a local copy
6766 From https://lists.gnu.org/archive/html/bug-bash/2022-05/msg00052.html
6769 - execute_in_subshell: tentative change to clear procsub list after
6770 performing redirections, so nothing in a redirection can affect
6771 what's in the subshell.
6772 From https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00114.html
6775 - binary_operator: in posix mode, the < and > operators compare strings
6776 using the current locale (strcoll).
6777 From https://www.austingroupbugs.net/view.php?id=375
6780 - bash_default_completion: make sure that command completion adds the
6781 trailing `/' suffix for directories even if the directory name is
6782 the same as the common prefix of matches.
6783 From https://lists.gnu.org/archive/html/bug-bash/2022-11/msg00034.html
6786 - rl_vi_yank_pop: make repeated invocations of vi-yank-pop cycle
6787 through the kill ring just like in emacs mode, even when point
6788 is at the end of the line.
6789 From https://lists.gnu.org/archive/html/bug-bash/2022-08/msg00105.html
6792 - parse_comsub: set variables if the last token (last_read_token) is
6793 `;', `\n', or `&', in addition to was_word
6794 - parse_comsub: if the last read token was a newline (was_newline),
6795 terminate the comsub with a newline instead of a semicolon; keeps
6796 the line numbers more consistent.
6797 From a report by Grisha Levit <grishalevit@gmail.com>
6800 - anonopen: use memfd_create if it is available, fall through to
6801 traditional Unix/POSIX implementation if it fails
6806 - yy_string_unget: don't push EOF back to a string, like the other
6812 - read_a_line: don't push an EOF back into the string or line if the
6813 line ends in a backslash.
6814 From a report by Rob Landley <rob@landley.net>
6818 lib/readline/input.c
6819 - rl_gather_tyi: make sure result is initialized
6822 - _rl_read_bracketed_paste_prefix: make sure key is initialized
6825 - read_builtin: make sure pass_next and saw_escape are initialized
6826 before a possible goto
6827 - read_builtin: make sure to initialize prevset for very short
6831 - function_substitute: make sure tflag is initialized even when we
6832 don't call read_comsub, since we return it in ret->flags
6833 All from a report by Grisha Levit <grishalevit@gmail.com>
6835 builtins/complete.def
6836 - compgen_builtin: use array_from_argv to assign elements of the
6837 stringlist to the array variable.
6838 Update from Grisha Levit <grishalevit@gmail.com>
6841 - bindpwd: fix seg fault from an unlikely set of circumstances
6842 From a report by Grisha Levit <grishalevit@gmail.com>
6845 - convert_validarray_flags_to_arrayval_flags: initialize avflags
6846 From a report by Grisha Levit <grishalevit@gmail.com>
6849 - anonopen: set *fn if memfd_create is used
6850 From a report by Grisha Levit <grishalevit@gmail.com>
6855 - bind_assoc_var_internal: free key to fix small leak if assign_func
6857 - quote_compound_array_word: free value to fix small leak
6859 builtins/evalstring.c
6860 - parse_and_execute: free parsed command on failed function definition
6862 - open_redir_file: free FN if we're not passing it back to the caller
6865 - param_expand: free TEMP1 in code paths that don't do it now
6868 - bash_command_name_stat_hook: if we modify *NAME, free the old value
6870 examples/loadables/{kv,stat}.c
6871 - bind_assoc_variable is caller-free VALUE, so free when needed and
6872 don't allocate a new copy if not
6873 All from a report by Grisha Levit <grishalevit@gmail.com>
6877 lib/readline/complete.c
6878 - rl_menu_complete: use _rl_free_match_list instead of just freeing
6879 MATCHES if we have too many possible completions to display.
6880 From a report by Grisha Levit <grishalevit@gmail.com>
6885 - reader_loop: make sure to allow exit builtin (code == EXITBLTIN) to
6886 exit the shell when ignoreeof is set
6887 From a report by Grisha Levit <grishalevit@gmail.com>
6891 lib/readline/complete.c
6892 - complete_sigcleanarg_t: new struct to hold match list and saved line
6893 buffer for cleanup on receipt of SIGINT
6894 - _rl_complete_sigcleanup: use new sigcleanarg_t struct and free both
6896 - rl_complete_internal: whenever we display the match list, set up to
6897 clean the matches and saved line buffer in the event of a SIGINT
6898 From a report by Grisha Levit <grishalevit@gmail.com>
6900 lib/readline/signals.c
6901 - _rl_handle_signal: if readline is compiled to include callbacks, only
6902 call rl_echo_signal_char if we're not in callback mode or the
6903 application has set rl_persistent_signal_handlers, leaving any
6904 application signal handler to call it (or not) otherwise.
6905 From a discussion with Andrew Burgess <aburgess@redhat.com>
6908 - glob_filename: if ARRAY == TEMP_RESULTS, make sure to free TEMP_RESULTS
6909 after copying the filenames out of ARRAY, since we either assigned it
6910 directly or glob_dir_to_array returned it because the dirname was
6912 From a report by Grisha Levit <grishalevit@gmail.com>
6914 lib/readline/rltypedefs.h
6915 - Function: only compile in these obsolete typedefs if
6916 WANT_OBSOLETE_TYPEDEFS is defined
6919 - xtrace_print_assignment,xtrace_print_word_list: prioritize checking
6920 for characters that need $'...' printing over shell metacharacters
6921 so that strings containing both get the $'...' treatment
6922 From a report by Grisha Levit <grishalevit@gmail.com>
6927 - skip_double_quoted: make sure to call extract_function_subst with
6929 From a report by Grisha Levit <grishalevit@gmail.com>
6932 - _run_trap_internal: if we're running a trap but shell_eof_token is
6933 set, this means we're somehow running a trap while parsing a
6934 command substitution (weird set of circumstances). Call
6935 reset_parser and unset shell_eof_token if shell_eof_token is set
6936 From a report by Wiley Young <wyeth2485@gmail.com>
6938 builtins/setattr.def
6939 - set_var_attribute: don't set the att_propagate attribute unless the
6940 variable whose attribute is being modified is in the temporary
6941 environment for this builtin, not any previous temporary environments
6942 (like the temp env for a function call, or a special builtin like
6946 - push_posix_temp_var: if we have an array variable we're trying to
6947 push up here, use arrayvar_copyval to copy the value correctly
6950 - arrayvar_copyval: make sure that V2 ends up being the same type of
6951 array as V1 (att_array or att_assoc), since we're copying the value.
6952 Fixes issue reported by Grisha Levit <grishalevit@gmail.com>, but
6953 with the previous fix to set_var_attribute, it's not needed
6954 - assign_compound_array_list: check for integer overflow if the max
6955 index of the array is already INT_MAX.
6956 From a report from Emanuele Torre <torreemanuele6@gmail.com>
6957 - assign_array_var_from_word_list: ditto
6961 pcomplete.c,bashline.c
6962 - uw_restore_parser_state,uw_rl_set_signals: move to bashline.c so the
6963 general readline support can use them
6966 - uw_restore_parser_state,uw_rl_set_signals: extern declarations
6969 - unset_readline_variables,uw_unset_readline_variables: function to
6970 unset READLINE_{LINE,POINT,MARK,ARGUMENT} and its unwind-protect
6972 - bash_execute_unix_command: add unwind-protect to free up allocated
6974 Report and patch by Grisha Levit <grishalevit@gmail.com>
6976 doc/bash.1,doc/bashref.texi
6977 - BASH_ARGC,BASH_ARGV,BASH_SOURCE,BASH_LINENO: note that these variables
6978 may not be assigned to or unset
6982 builtins/declare.def
6983 - declare_internal: attempting to assign to a noassign variable is no
6984 longer an assignment error; the attempt is just ignored
6987 - find_or_make_array_variable: take a new flag value, 4: means to
6988 return noassign variables as themselves instead of NULL without
6989 performing the assignment so the caller can handle them differently.
6990 - assign_array_from_string: pass flags & 4 to find_or_make_array_variable
6991 so we can simply ignore attempted assignments to noassign array
6992 variables instead of treating them as assignment errors
6993 From a report by Kerin Millar <kfm@plushkava.net>
6996 - exppower: only report negative exponent error if noeval == 0.
6997 Fixes issue reported by Steffen Nurpmeso <steffen@sdaoden.eu>
7002 - anonopen: add support for using shm_open or shm_mkstemp to create
7003 an anonymous file using POSIX shared memory
7006 - if --enable-static-link is supplied, add -static to LDFLAGS on
7007 Linux if opt_profiling isn't enabled
7008 From a report from Emanuele Torre <torreemanuele6@gmail.com>
7011 - make_command_string_internal: if we're recursively printing a list
7012 (connection) with more than two elements, don't print any deferred
7013 here-documents after the make_command_string_internal on the right
7014 side of the connection unless we're at the end of the list
7015 (printing_connection == 1). This way the caller gets to add the
7016 appropriate connector before printing the deferred here-documents.
7017 From a report by Grisha Levit <grishalevit@gmail.com>
7018 - make_command_string_internal,print_group_command: after we call
7019 PRINT_DEFERRED_HEREDOCS and follow it with a closing `)' (subshell)
7020 or `}' (group command), we can set was_heredoc to 0 because we are
7021 no longer printing a here-document
7022 From a report by Grisha Levit <grishalevit@gmail.com>
7026 lib/readline/complete.c
7027 - rl_username_completion_function: simplify things by just skipping the
7028 function body if HAVE_GETPWENT is not defined.
7029 From a report by Grisha Levit <grishalevit@gmail.com>
7032 - fsleep: broke into three functions: nsleep, which uses nanosleep,
7033 ssleep, which uses select/pselect, and ancientsleep, which uses
7034 sleep. Prefer nanosleep, use the others depending on what's
7036 From a report and patch by Grisha Levit <grishalevit@gmail.com>
7039 - assign_compound_array_list: now behaves more like a series of
7040 assignment statements (a=(one two) is more like a[0]=one a[1]=two)
7041 in terms of error handling -- break after the first invalid
7042 assignment -- and return value -- now return int, 0 on failure and
7043 1 on success so the callers can throw assignment errors
7044 - assign_compound_array_list: if we have an explicit [subscript]=value
7045 assignment, use the negative-indices-count-back-from-the-end strategy;
7046 otherwise use last_ind and throw an error on overflow. This is like
7047 standalone assignment statements
7048 - assign_array_var_from_string: catch new return value from
7049 assign_compound_array_list; return NULL if assign_compound_array_list
7053 - do_compound_assignment: if assign_compound_array_list or
7054 assign_array_var_from_string return error (0 or NULL, respectively),
7055 treat as an assignment error similar to assigning to a readonly
7057 Inspired by a report from Emanuele Torre <torreemanuele6@gmail.com>
7060 - assign_compound_array_list: new return type
7065 - enable_builtin: make sure dynamic builtin loading and unloading
7066 updates the `enabled' and `disabled' programmable completion lists.
7067 From a report and patch by Grisha Levit <grishalevit@gmail.com>
7069 doc/bash.1,doc/bashref.texi
7070 - hash: add note that assigment to PATH clears the hash table.
7071 Report by Sebastian Carlos <sebaaa1754@gmail.com>
7073 lib/readline/complete.c
7074 - rl_filename_completion_function: make sure the results of
7075 *rl_filename_rewrite_hook are freed consistently if the function
7076 returns newly-allocated memory
7077 From a report and patch by Grisha Levit <grishalevit@gmail.com>
7083 - cd_builtin: if $OLDPWD is set by the user or script to something
7084 that's not a full pathname, allow it to use $CDPATH.
7085 From a report by Dustin Boyd <chronokitsune3233@gmail.com>
7090 - user_info: add members for saved uid and saved gid
7093 - uidget: if we have setresuid/setresgid, get the saved uid and saved
7094 gid so we can set them if we disable privileged mode
7095 - disable_priv_mode: only call setuid/setresuid and setgid/setresgid
7096 if the euid (egid) != uid (gid). If we have setresuid/setresgid,
7097 add a check whether the saved uid (gid) isn't the same as the real
7098 uid (gid). Potentially saves a couple of system calls.
7099 Fixes Android issue, patch by Grisha Levit <grishalevit@gmail.com>
7102 - unary_operator: only support historical handling of -t and its
7103 optional argument when not in posix mode
7104 - unary_test: print an error if the argument to -t is not a number
7105 - unary_operator: only make the argument to -t optional if the
7106 next argument is -a or -o and we are using the historical algorithm
7107 (argc >= 5), otherwise force it to be a number and print an error
7109 From a report by Stephane Chazelas <stephane@chazelas.org>
7111 doc/bash.1,doc/bashref.texi
7112 - added note about test/[ sorting using the current locale with the
7113 `<' and `>' operators when in posix mode
7114 - added note about the integer argument to test -t being required
7116 - added note recommending against the use of test with 5 or more
7117 arguments in favor of combining multiple instances of test with
7119 From a report by Stephane Chazelas <stephane@chazelas.org>
7124 - start_job: turn off (on) the J_ASYNC flag depending on whether the
7125 job is being started in the foreground (background). It matters now
7126 that we use IS_ASYNC to determine whether to give the terminal
7127 back to the shell's process group.
7128 From a report by Grisha Levit <grishalevit@gmail.com>
7131 - command_word_completion_function: if we have a glob pattern that
7132 expands to multiple words, dispose of the list before returning NULL.
7133 From a report by Grisha Levit <grishalevit@gmail.com>
7136 - makunbound: if we're unsetting a local variable, preserve the export
7137 attribute even if the variable's not in the temporary environment
7138 Tentative fix, compatible with other POSIX shells (except the BSD
7144 - include <langinfo.h> if HAVE_LANGINFO_CODESET is defined, use
7145 nl_langinfo (CODESET) if HAVE_LANGINFO_CODESET is define, since
7146 we no longer check for nl_langinfo. This is what locale.c does.
7150 lib/readline/display.c
7151 - rl_redisplay: rudimentary code to handle some cases where the line
7152 buffer consumes more than the physical number of screen lines. It's
7153 not a screen editor, but it handles some of the common cases.
7154 From https://bugs.launchpad.net/ubuntu/+source/bash/+bug/2024628
7159 - getwidestr: make sure to force mbsrtowcs to convert the closing NULL
7160 so the wide-character string is NULL-terminated.
7161 From a report by Grisha Levit <grishalevit@gmail.com>
7164 - strregerror: new function to return regerror(3) error message text
7166 - sh_regmatch: add an additional argument to hold the error message
7167 from regerror(3), in newly-allocated memory; generated by call to
7168 strregerror() on regcomp(3) failure
7169 From a patch by Grisha Levit <grishalevit@gmail.com>
7172 - sh_regmatch: update extern declaration
7175 - execute_cond_node: pass pointer to buffer to return any error
7176 message; if sh_regmatch returns 2, use a non-NULL error buffer in
7180 - _rl_get_string_variable_value: return the values for
7181 active-region-start-color (_rl_active_region_start_color) and
7182 active-region-end-color (_rl_active_region_end_color) if they
7184 Fixes bind -v issue reported by Sebastian Carlos <sebaaa1754@gmail.com>
7185 - _rl_get_string_variable_value: if the history is stifled, make
7186 sure we report the history size as < 0 so the output of bind -v
7187 can be reused as input.
7188 Fixes bind -v issue reported by Sebastian Carlos <sebaaa1754@gmail.com>
7193 - quote_string_for_globbing: don't bother backslash-quoting multibyte
7194 characters. It matters for macOS and doesn't make a difference for
7195 other systems, and those aren't going to be special globbing chars.
7196 From a report by Grisha Levit <grishalevit@gmail.com>
7199 - glob_vector: normalize the pattern with fnx_fromfs so we make sure
7200 it's also in NFC on macOS (other systems don't care). This is a
7201 POSIX violation, but part of correcting the longtime HFS+ (and Finder)
7204 lib/readline/complete.c
7205 - rl_filename_completion_function: if the application sets a filename
7206 rewrite hook, use it to rewrite the filename we're matching as well
7207 as filenames read with readdir().
7208 [SUPERSEDED BY CHANGE OF 10/4/2023]
7209 From a report by Grisha Levit <grishalevit@gmail.com>
7214 - quote_string_for_globbing: see if we can get away without backslash-
7215 quoting single-byte characters that aren't CTLESC or characters
7216 that are special to EREs or BREs, even if they're quoted
7219 - bashline_set_filename_hooks: convenience function to set the
7220 directory hook and the filename rewrite and stat hooks; call from
7221 other places in the file so these are set consistently
7224 - bashline_set_filename_hooks: extern declaration
7226 builtins/complete.def
7227 - compgen_builtin: make sure to set the directory and filename hooks
7228 so compgen called from a script works more like compgen called
7229 from a word completion context.
7230 Inspired by a report by Grisha Levit <grishalevit@gmail.com>
7233 - bash.pdf: use groff -T pdf to create, instead of creating postscript
7234 and then using ghostscript
7239 - start_job: unconditionally send SIGCONT to the job we just started,
7240 even if we think it was already running, to reduce the window for a
7241 potential race condition, and only change the state to RUNNING if
7242 the SIGCONT succeeds or if the process has terminated so we can
7244 Report from Earl Chew <earl_chew@yahoo.com>
7247 - make_simple_command,make_bare_simple_command: now take line number as
7248 an argument; used instead of line_number to set the line associated
7249 with the simple command
7252 - make_simple_command,make_bare_simple_command: change prototype
7254 parse.y,builtins/command.def,builtins.jobs.def
7255 - make_simple_command,make_bare_simple_command: change callers
7260 - read_token_word: try to keep track of whether we are parsing the
7261 first word of a simple command and set simplecmd_lineno if we
7262 are. We start a simple command when we return ASSIGNMENT_WORD
7263 or WORD in a command token position. This gives better values for
7264 $LINENO in multi-line simple commands
7265 - redirection: set simplecmd_lineno if it's -1, meaning this is a
7266 simple command with a leading redirection or a null command with
7268 - pass simplecmd_lineno to make_simple_command if we are starting a
7269 simple command (the first ELEMENT)
7270 - parse_comsub,xparse_dolparen: save and restore simplecmd_lineno
7271 - simple_command,function_def production: reset simplecmd_lineno to -1
7272 after parsing a simple command or a function declared as WORD()
7276 doc/bash.1,doc/bashref.texi
7277 - xpg_echo: add description of how this can be used to suppress echo
7278 option interpretation
7279 Inspired by report from Zachary Santer <zsanter@gmail.com>
7284 - printf_erange: make out-of-range errors conversion errors even if
7285 the conversion function fully consumes the argument.
7286 From a report by thomas@habets.se
7290 lib/readline/rltypedefs.h
7291 - rl_macro_print_func_t: typedef for a function to print macro key
7295 - rl_macro_display_hook: hook function to call if the application
7296 wants to display a key sequence bound to a macro
7297 - rl_macro_dumper: if rl_macro_display_hook is non-NULL, call it to
7298 display the macro value (after `untranslating' it to add back any
7299 required backslashes)
7301 lib/readline/doc/rltech.texi
7302 - rl_macro_display_hook: add description
7305 - glob_char_p: add the characters that are special within BRE bracket
7307 Inspired by a report by Grisha Levit <grishalevit@gmail.com>
7310 - bind_keyseq_to_unix_command: allow whitespace to separate the keyseq
7311 and the command string, but require the command string to be
7312 surrounded by double quotes if it is. If we get a whitespace
7313 separator, call rl_macro_bind so we get the string `translated'
7314 according to how readline does it (backslash-escape sequences
7316 - print_unix_command: function to print a key sequence and a unix
7317 command bound to it from cmd_xmap, using a space separator
7318 - print_unix_command_map: make sure to set rl_macro_display_hook to
7319 print_unix_command before calling rl_macro_dumper to print the
7320 bound command strings
7325 - read_builtin: saw_escape is now a count of CTLESCs we added to the
7327 - read_builtin: since we increment saw_escape when we add a CTLESC,
7328 decrement it when we remove one from the input (\\\n, \\\0)
7329 - read_builtin: remove the CTLESC we added if we have a backslash-
7330 escaped NULL character ('\0')
7331 - read_builtin: if the input ends with an unescaped newline, remove
7333 From a report by Grisha Levit <grishalevit@gmail.com>
7337 builtins/history.def
7338 - history_builtin: if history -[anrw] is used without a filename
7339 argument, and HISTFILE is unset or null, return success immediately
7340 From a report by Grisha Levit <grishalevit@gmail.com>
7342 doc/{bash.1,bashref.texi},lib/readline/doc/hsuser.texi
7343 - history: document that if filename is not supplied, and HISTFILE is
7344 unset or null, the [-anrw] options have no effect
7349 - gen_progcomp_completions: if the actual compspec that's run is
7350 something different from what's typed (full pathname, alias, etc.),
7351 set pcomp_curcmd to the word corresponding to the actual compspec,
7352 instead of what was typed. This is what eventually gets used by
7353 the compopt builtin's output.
7354 From a report by Grisha Levit <grishalevit@gmail.com>
7357 - execute_coproc: in parent, close /dev/fd FIFOs only if we're not
7358 executing a shell function, like other calls to unlink_fifo_list().
7359 Report from Hal Blackburn in
7360 https://savannah.gnu.org/support/index.php?110910
7363 - do_compound_assignment: don't attempt to convert a global associative
7364 array to an indexed array with declare -g.
7365 From a report and patch by Grisha Levit <grishalevit@gmail.com>
7370 - rl_print_keybinding: new function, prints a the key bindings for a
7371 single function specified by name
7372 - rl_function_dumper: call rl_print_keybinding for every function name
7374 lib/readline/readline.h
7375 - rl_print_keybinding: extern declaration
7378 - _rl_untranslate_macro_value: make sure characters betweeen 128 and
7379 159 (metafied control characters) are printed using the \M-\C-
7380 notation instead of directly writing the control character.
7381 From a report and patch by Grisha Levit <grishalevit@gmail.com>
7382 - rl_get_keyname: if a key binding shadows a function or macro, print
7383 the ANYOTHERKEY binding as a null string
7384 From a report and patch by Grisha Levit <grishalevit@gmail.com>
7385 - rl_untranslate_keyseq: make changes analogous to
7386 _rl_untranslate_macro_value so that we don't print control characters
7388 - rl_invoking_keyseqs_in_map: if the key corresponds to a keymap, use
7389 _rl_get_keyname to get its text representation, so this function
7390 returns consistent results
7391 - rl_translate_keyseq: if convert-meta is on, don't convert meta chars
7392 that are, e.g., \M-\C-@ (128) into \e followed by a NUL, resulting
7393 in truncated key sequences. Just don't honor convert-meta in this
7399 - bash_history_no_expand_chars: add the rest of the shell
7400 metacharacters so we don't get empty history events; tcsh does more
7401 or less the same thing
7402 Inspired by a report from Emanuele Torre <torreemanuele6@gmail.com>
7407 - grammar: change bare `time' and `!' productions to use nullcmd_terminator,
7408 which is a list_terminator or a `&' to allow things like `time &'
7409 and `! &' which the original version of POSIX interp 267 (the one
7410 I implemented) says we should support
7414 m4/bison.m4,m4/flexmember.m4,m4/locale_h.m4
7415 - new m4 files from gettext-0.21.1
7417 m4/gettext.m4,m4/intl.m4
7418 m4/{codeset,extern-inline,fcntl-o,glibc2,glibc21,host-cpu-c-abi,iconv,intdiv0}.$
7419 m4/{intl-thread-locale,intlmacosx,intmax,inttypes-pri,inttypes,inttypes_h}.m4
7420 m4/{lcmessage,lib-ld,lib-link,lib-prefix,locale_h,lock,nls,po,printf-posix}.m4
7421 m4/{progtest,pthread_rwlock_rdlock,size_max,stdint_h,strtoimax,threadlib}.m4
7422 m4/{uintmax_t,ulonglong,visibility,wchar_t,wint_t,xsize}.m4
7423 - updated m4 files from gettext-0.21.1
7425 configure.ac,config.h.in
7426 - updated autoconf files with changes for gettext-0.21.1
7429 - updated distribution manifest with new files from gettext-0.21.1
7432 - u32cconv: prefer nl_langinfo to locale_charset like locale.c:
7436 - uw_restore_lineno: an unwind-protect fuction to restore a saved
7438 - execute_command: add an unwind-protect to restore line_number in
7439 case execute_simple_command longjmps back to top_level or a
7441 Side effect of https://savannah.gnu.org/support/index.php?110919
7442 - execute_for_command, execute_select_command, execute_case_command:
7443 add unwind-protect to restore line_number (could also do it for
7444 if, while, until but those don't modify line_number)
7445 - execute_command_internal: add_unwind_protect to restore line number
7446 for arith, cond, function def commands
7451 - execute_simple_command: don't call savestring on the_printed_command_except_trap
7453 From a report by Grisha Levit <grishalevit@gmail.com>
7457 lib/readline/rltty.c
7458 - prepare_terminal_settings: replace USE_XON_XOFF macro with private
7459 variable _rl_use_tty_xon_xoff (initially set to 1); if it's set to
7460 0 disable the tty start and stop characters. Prep for making it a
7461 bindable variable setting
7464 - edit_line: now takes a third argument saying whether or not to
7465 set rl_attempted_completion_function to NULL to use readline's
7466 default filename completion (the default)
7467 - read_builtin: new option -E to use readline and use the bash
7468 default completion (that is, leave rl_attempted_completion_function
7470 From a suggestion by konsolebox <konsolebox@gmail.com> back in 5/2021
7473 doc/bash.1,doc/bashref.texi
7474 - read: document new -E option
7479 - BASH_CHECK_LIB_TERMCAP: add a check for bash_cv_termcap_lib ==
7480 "libcurses"; set TERMCAP_LIB=-lcurses in this case
7485 - bash_variable_assignment_error: new function, implements default mode
7486 behavior for variable assignment errors
7487 - posix_variable_assignment_error: new function, implements posix mode
7488 behavior for variable assignment errors
7489 - parameter_brace_expand_rhs,expand_declaration_argument,
7490 do_assignment_statements: call posix_variable_assignment_error or
7491 bash_variable_assignment_error as appropriate
7496 - _rl_arg_dispatch: add the digits or other characters to
7497 rl_executing_keyseq if we're not calling _rl_dispatch.
7498 From a report by Grisha Levit <grishalevit@gmail.com>
7501 - print_simple_command: make sure that the_printed_command[0] == '\0'
7502 if we're printing a null simple command with no words
7503 Patch by Grisha Levit <grishalevit@gmail.com>
7508 - read_builtin: make `delim' variable local, pass to edit_line to
7509 set the last character of the returned line; change edit_line
7511 From a suggestion by Grisha Levit <grishalevit@gmail.com>
7516 - comsub and funsub productions: don't reset eof_encountered to 0 in
7520 - function_substitute: unwind-protect eof_encountered so ignoreeof
7521 doesn't keep getting reset to 0 if PS1 includes a ${ ...;} command.
7522 From a report by Grisha Levit <grishalevit@gmail.com>
7526 doc/{bash.1,bashref.texi}
7527 - clarify the cases where arrayname[@] doesn't refer to all the
7528 elements of an associative array (the unset builtin and test/[/[[ -v
7530 Inspired by https://savannah.gnu.org/support/index.php?110924
7535 - execute_for_command,execute_select_command,execute_arith_command,
7536 execute_case_command: fix up order in which BASH_COMMAND is set,
7537 the DEBUG trap is run, and PS4 is printed.
7538 From a report by Grisha Levit <grishalevit@gmail.com>
7540 lib/readline/colors.c
7541 - RL_COLOR_PREFIX_EXTENSION: make sure the custom suffix has a leading
7543 Report and fix from Stefan Klinger <readline-gnu.org@stefan-klinger.de>
7545 lib/readline/parse-colors.c
7546 - free_color_ext_list: new function, called on parse error, frees the
7548 - rl_reparse_colors: new public function, frees old extension list and
7549 reparses (presumably new) value of LS_COLORS; some minimal checking
7550 to make sure the value has really changed
7555 - time_command_acceptable: make sure `time' is recognized as a
7556 reserved word after DOLPAREN and DOLBRACE.
7557 Report from Dima Korobskiy <dkroot2@gmail.com>
7560 - printf_builtin: make 'C' equivalent to 'lc'; 'S' equivalent to 'ls'
7566 - parse_command: don't run pending traps if we're parsing a command
7568 From a report from Emanuele Torre <torreemanuele6@gmail.com>
7573 - stop_pipeline: don't have the parent set the terminal pgrp; rely on
7574 child processes to do it to avoid potential race conditions.
7575 From a discussion beginning at
7576 https://lists.gnu.org/archive/html/bug-bash/2023-08/msg00087.html
7579 - bexpand: when parsing the string to be expanded, consume entire
7580 multibyte characters at a time, in case their encoding includes a
7582 - printf_builtin: when parsing the format string, consume entire
7583 multibyte characters at a time unless they begin with '\\' or '%',
7584 to avoid characters whose encoding contains those characters
7589 - hash_builtin: if the -p option is supplied without a name to hash,
7593 - phash_remove: if the hash table is empty, return 1 like unalias does
7594 when the alias isn't in the hash table.
7595 Report from from Mike Jonkmans <bashbug@jonkmans.nl>
7600 - binary_test,unary_test: now static
7601 - cond_test: new function, calls binary_test or unary_test as appropriate
7602 and handles longjmps from test_syntax_error
7605 - cond_test: extern declaration
7608 - execute_cond_node: call cond_test instead of binary_test or unary_test.
7609 From a report and patch from Grisha Levit <grishalevit@gmail.com>
7611 doc/bash.1,doc/bashref.texi
7612 - hash: add some text about the mutual exclusivity of the -t, -p, and
7617 subst.c,subst.h,externs.h
7618 - string_extract,string_extract_verbatim,string_extract_double_quoted,
7619 string_extract_single_quoted,skip_single_quoted,skip_double_quoted,
7620 extract_delimited_string,extract_heredoc_dolbrace_string,
7621 extract_dollar_brace_string,parameter_brace_expand,param_expand,
7622 extract_command_subst,extract_function_subst,extract_arithmetic_subst,
7623 extract_process_subst,extract_array_assignment_list,
7624 expand_array_subscript
7625 change function signatures to take size_t * instead of int * for
7626 arguments that are string indices or lengths, change callers
7627 - unquoted_substring,unquoted_member,string_extract,
7628 string_extract_double_quoted,skip_double_quoted,
7629 string_extract_single_quoted,skip_single_quoted,
7630 string_extract_verbatim,extract_delimited_string,
7631 extract_heredoc_dolbrace_string,extract_dollar_brace_string,
7632 parameter_brace_expand,param_expand,skip_matched_pair,skip_to_delim,
7633 skip_to_histexp,list_string,expand_string_dollar_quote,
7634 parameter_brace_expand_rhs,expand_array_subscript,shouldexp_replacement,
7635 expand_array_subscript,string_quote_removal: change variables used
7636 for string indexes to size_t
7637 [merge from size_t branch]
7640 - expand_compound_array_assignment: use size_t for string indices
7643 - brace_gobbler: use size_t for string indices
7646 - xparse_dolparen: change function signature to use size_t *
7647 instead of int * for string index, use size_t for string indices
7649 general.c, general.h
7650 - bash_tilde_find_word: change function signature to use size_t *
7651 instead of int * for string index
7653 lib/readline/readline.h
7654 - rl_reparse_colors: extern declaration
7656 lib/readline/doc/rltech.texi
7657 - rl_reparse_colors: document as public function
7662 - it_init_aliases: move the free (alias_list) inside #ifdef ALIAS.
7663 Report and fix from Mike Jonkmans <bashbug@jonkmans.nl>
7666 - redirection_error: set W_NOPROCSUB in the word redirection_error
7667 creates to call redirection_expand
7670 - bind_builtin: use CASE_HELPOPT so the long doc gets printed when
7673 builtins/getopts.def
7674 - getopts_builtin: change to use no_options()
7679 - execute_select_command: in posix mode, an invalid selection variable
7680 name is a fatal error, just like with `for'. This is compatible with
7686 - parameter_brace_expand_length: rearrange the code slightly to reduce
7687 the number of find_variable calls. This matters if the variable is
7688 dynamic and produces a new value each time (e.g., RANDOM).
7693 - shift_builtin: if get_numeric_arg returns a number out of range and
7694 we're going to print an error message, make sure to skip over an
7695 argument of `--' so we can print the right argument
7698 - break_builtin,continue_builtin: ditto with get_numeric_arg and `--'
7702 builtins/history.def
7703 - history_builtin: changed error message if the numeric argument to -d
7709 - array_length_reference: include the open bracket in the error message
7710 passed to err_badarraysub; it looks cleaner
7715 - delete_all_jobs: if we are clearing the jobs list, reset the stats
7716 about running and dead jobs and child processes
7717 Report from Koichi Murase <myoga.murase@gmail.com>
7721 lib/readline/complete.c
7722 - rl_completion_rewrite_hook: rewrite hook applied to the completion
7723 word before comparing against the possible completions from the
7724 file system (modified by rl_filename_rewrite_hook)
7725 - rl_filename_completion_function: call rl_completion_rewrite_hook,
7726 if set by the calling application, on the filename portion of the
7727 word to be completed
7729 lib/readline/readline.h
7730 - rl_completion_rewrite_hook: extern declaration
7733 - bash_set_filename_hooks: set rl_completion_rewrite_hook to
7734 bash_filename_rewrite_hook now that we've separated them
7735 From a report and patch from Grisha Levit <grishalevit@gmail.com>;
7736 original report from Stefan H. Holek <stefan@epy.co.at>
7738 lib/readline/doc/rltech.texi
7739 - rl_completion_rewrite_hook: document
7743 lib/readline/complete.c
7744 - rl_complete_internal: use `%' as an op character to indicate that
7745 we should just display the completions, like '?' in previous versions
7746 (nothing uses this yet)
7747 - rl_possible_completions: set last_completion_failed to 0 before we
7748 pass '?' to rl_complete_internal so we don't worry about trying to
7749 insert a single completion
7754 - string_transform: use ansicstr directly for the `E' transformation
7755 so we don't accidentally remove too many escapes.
7756 From a report and patch from Grisha Levit <grishalevit@gmail.com>
7759 - execute_arith_for_command: make sure a failed init expression resets
7760 loop_level so break and continue work correctly
7761 From a report and patch from Grisha Levit <grishalevit@gmail.com>
7762 - execute_for_command: set line_number for invalid identifier error
7763 messages; restore before returning error
7764 From a report and patch from Grisha Levit <grishalevit@gmail.com>
7767 - _rl_set_insert_mode: manage RL_STATE_OVERWRITE when modifiying
7770 doc/bash.1,doc/bashref.texi
7771 - some style and formatting changes from Bjarni Ingi Gislason
7772 <bjarniig@simnet.is>
7775 - getifs: now returns allocated memory to insulate it from changes to
7779 - read_builtin: since getifs now returns allocated memory, note when
7780 we need to free ifs_chars and free it before returning.
7781 Reported by Robert Elz <kre@munnari.OZ.AU> in
7782 https://www.austingroupbugs.net/view.php?id=1778#c6513
7787 - glob_char_p: add more of the extglob pattern characters; it doesn't
7789 Report and patch from Grisha Levit <grishalevit@gmail.com>
7790 - unquoted_glob_pattern_p: don't treat a `(' immediately following a
7791 `/' as a potential globbing character
7792 - unquoted_glob_pattern_p: only treat the extended glob characters
7793 followed by a `(' as a glob pattern if extended_glob is enabled
7794 - unquoted_glob_pattern_p: an unquoted backslash isn't treated
7795 specially any more, but if it's followed by a CTLESC, you still
7796 don't treat the next character as an unquoted globbing char
7797 Report and patch from Grisha Levit <grishalevit@gmail.com>
7802 - get_numeric_arg: if fatal > 0, set the exit status to EX_USAGE
7803 and call jump_to_top_level with EXITPROG or DISCARD. We don't
7804 need to do everything that throw_to_top_level() does here (it's
7805 really meant for signals and other exceptional failure conditions).
7808 - cd_builtin: exit with EX_USAGE on too many arguments
7811 - shift_builtin: return EX_USAGE if get_numeric_arg returns 0,
7812 indicating that the argument wasn't a valid number
7814 builtins/history.def
7815 - shift_builtin: return EX_USAGE if get_numeric_arg returns 0
7818 - exit_or_logout: if get_exitstat (which calls get_numeric_arg) returns
7819 a value > EX_SHERRBASE, indicating an error, just return that to
7820 the caller and let the caller deal with it. This means that
7821 `exit xyz' is no longer a fatal error, but can potentially cause a
7822 non-interactive posix-mode shell to exit because exit is a special
7826 - return_builtin: if a non-interactive shell in posix mode gets an
7827 invalid numeric arg from get_exitstat, return immediately and let
7828 the caller deal with exiting
7829 All prompted by a report by Martin Schulte <gnu@schrader-schulte.de>
7834 - unquoted_glob_pattern_p: restore some of the special treatment of
7835 backslash followed by CTLESC removed on 10/7
7836 Report and patch from Grisha Levit <grishalevit@gmail.com>
7839 - parse_matched_pair: don't add an extra CTLESC after reading \CTLESC,
7840 like in other parts of the parser
7843 - dequote_string: don't drop trailing CTLESC in a string with more
7844 than a single character
7845 Report and patch from Grisha Levit <grishalevit@gmail.com>
7848 - ansicstr: handle $'\c^A' and $'\c^?' correctly when being expanded
7849 by the parser (flags&2). The parser passes these as \c^A^A and
7850 \c^A^?, respectively, so we should strip the quoting CTLESC.
7851 Report from Grisha Levit <grishalevit@gmail.com>
7854 - extract_dollar_brace_string: now global so brace expansion can use it
7857 - brace_gobbler: use extract_dollar_brace_string if we see ${ with
7858 the appropriate value of QUOTING, so we don't have to teach brace
7859 expansion more shell syntax.
7860 Report from Emanuele Torre <torreemanuele6@gmail.com>
7861 - brace_gobbler: call the word extraction functions with SX_NOALLOC
7862 so we don't have to allocate memory we're just going to free
7867 - read_builtin: return EX_MISCERROR (2) if there is an error trying
7868 to assign to one of the variables. This is what the newest POSIX
7872 - dispose_variable_value: do the right thing for att_nofree vars
7873 - makunbound: call dispose_variable_value instead of using inline code
7876 - brace_gobbler: make sure to set no_longjmp_on_fatal_error around
7877 calls to extract_dollar_brace_string
7882 - brace_gobbler: set SX_NOLONGJMP|SX_NOERROR in the flags passed
7883 to extract_command_subst; make sure no_longjmp_on_fatal_error
7884 is set before that call
7885 - brace_gobbler: revert 10/13 change to use extract_dollar_brace_string
7891 - xparse_dolparen,parse_string_to_command: if SX_NOERROR is set in
7892 FLAGS, add PST_NOERROR to parser_state. Not much effect yet.
7893 - parse_matched_pair: if PST_NOERROR is set in parser_state, don't
7894 print an error message if we hit EOF, just return an error. A start
7895 at using PST_NOERROR to suppress error messages, not just duplicate
7896 ones. We'll see how this goes before adding more
7899 - decodeprec: decode the precision into an intmax_t; clamp the return
7901 - printf_builtin: update to posix interp 1647 (even though it's about
7902 fprintf(3)) and output a NUL byte if %lc is supplied a null argument.
7903 - printf_builtin: fix case where %Q is supplied with a precision in
7905 - printf_builtin: fix case where %Q is supplied with a precision
7906 greater than INT_MAX
7907 - getwidestr,getwidechar: handle case where there is no argument
7908 supplied; return NULL or NUL
7909 - convwidestr: allow a precedence of 0 for %ls
7910 - getint: don't call getintmax any more, just use the same code style
7911 inline; getintmax will consume an extra argument on an error
7912 Report and patches from Grisha Levit <grishalevit@gmail.com>
7913 - printf_builtin: handle field width and precision overflow from
7914 getint() by ignoring the argument (fieldwidth = 0, precision = -1)
7919 - wait_for: rearrange code that sets the SIGINT handler to
7920 wait_sigint_handler and saves the old handler to old_sigint_handler
7921 to avoid delay before assigning the handler
7922 Report from Wenlin Kang <wenlin.kang@windriver.com>
7923 - wait_sigint_handler: if cur_sigint_handler (what restore_sigint_handler)
7924 just restored or ignored) is INVALID_SIGNAL_HANDLER, set the
7925 appropriate SIGINT handler with set_sigint_handler before sending
7931 - legal_number: use the same test (isspace(3)) to skip trailing
7932 whitespace that strtoimax uses to skip leading whitespace.
7933 Report and patch from Paul Eggert <eggert@cs.ucla.edu>
7936 - legal_number: renamed to valid_number, changed all callers
7937 - legal_identifier: renamed to valid_identifier, changed all callers
7938 - legal_alias_name: renamed to valid_alias_name, changed all callers
7941 - legal_number: definition of legal_number here for backwards compat
7942 with old loadable builtins
7943 - legal_identifier: definition of legal_identifier here for backwards
7944 compat with old loadable builtins
7945 - legal_alias_name: same
7948 - brace_expand_word_list: if brace_expand returns NULL, dummy up a
7949 single-element vector with a copy of the original word so we can
7950 add it to the result list unchanged.
7951 Inspired by https://savannah.gnu.org/support/?110948
7956 - readstr: set of functions to read a string from the keyboard, using
7957 rl_line_buffer for temporary storage, with minimal editing and an
7958 optional caller-supplied completion function. Doesn't use the
7959 callback framework yet since none of the functions are public
7960 - rl_execute_named_command: new bindable function to read a bindable
7961 command name (from the funmap_names array) and execute it, with
7962 command name completion on SPACE and TAB
7964 lib/readline/readline.h
7965 - rl_execute_named_command: new extern declaration
7967 lib/readline/rlprivate.h
7968 - new extern declarations for the readstr function framework
7970 lib/readline/funmap.c
7971 - execute-named-command: new bindable function name
7973 lib/readline/emacs_keymap.c
7974 - rl_execute_named_function: bound to M-x by default
7976 lib/readline/doc/rluser.texi
7977 - execute-named-command: document as bindable function name with its
7978 default binding to M-x in emacs mode
7982 lib/readline/search.c
7983 - _rl_nsearch_dispatch: use ^V/^Q for rl_quoted_insert into the
7986 lib/readline/isearch.c
7987 - _rl_isearch_dispatch: use ^V or anything bound to rl_quoted_insert
7988 for rl_quoted_insert into the search string
7990 lib/readline/terminal.c
7991 - add support for new BE/BD and PS/PE bracketed-paste capabilities.
7992 Nothing uses them yet.
7997 - dyn_load_builtin: if we don't find a pathname argument without a
7998 slash in BASH_LOADABLES_PATH, convert it to a pathname with a slash
7999 before calling dlopen, to force the loader to look in the current
8000 directory (Linux, for example, will not).
8004 examples/loadables/fdflags.c
8005 - fdflags_builtin: only parse the setspec once, since parsing uses
8007 Report and patch from Emanuele Torre <torreemanuele6@gmail.com>
8012 - dyn_load_builtin: if BASH_LOADABLES_PATH is set, use only it: don't
8013 fall back to looking in the current directory. This changes the
8014 historical behavior and brings the path behavior more in line with
8015 PATH, but not CDPATH.
8019 lib/readline/complete.c
8020 - rl_complete_internal: add `|' as a character for rl_complete_internal
8021 that also just displays the completions, since `%' is overloaded by
8026 examples/loadables/strptime.c
8027 - strptime: new loadable builtin, interface to strptime(3). Takes a
8028 date-time string as its arguments and tries to parse it according
8029 to a number of built-in formats. If successful, it outputs the
8030 result as a number of seconds since the epoch. Understands some
8031 handy shorthands like "now" and "tomorrow".
8036 - update the driver function using namerefs and ${!x[@]}
8037 - zh_TW.BIG5: fixed some problems with the test encodings.
8038 Report and patches from Grisha Levit <grishalevit@gmail.com>
8043 - zh_HK.big5hkscs -> zh_TW.big5 to work around macOS 14 issues with
8044 BSD-based locale definition
8047 - bash_execute_unix_command: check count != 1 instead of count > 1 to
8048 handle negative arguments
8051 - rl_trim_arg_from_keyseq: change the parsing_digits logic to handle
8052 multiple instances of `-' the same way rl_digit_loop does (collapse
8054 - rl_trim_arg_from_keyseq: fix typo to correctly recognize a `-'
8055 after a key sequence bound to universal-argument
8056 - rl_trim_arg_from_keyseq: trim negative argument for a key sequence
8057 that is shadowed by a longer key sequence (ANYOTHERKEY)
8058 Report and patches from Grisha Levit <grishalevit@gmail.com>
8063 - solaris2: change PIC option for non-gcc Solaris 2 builds
8066 - binsize: make sure indexing into binsizes casts to size_t (unsigned)
8068 examples/loadables/getconf.c
8069 - protect more of the _SC defines with #ifdefs for different systems
8071 examples/loadables/fdflags.c
8072 - ALLFLAGS: add some more flag values from Solaris/AIX/HP-UX
8077 - function_substitute: unwind return_catch_flag unconditionally
8078 Report and patch from Grisha Levit <grishalevit@gmail.com>
8079 - function_substitute: save getopts state and restore it if the
8080 funsub declares a local copy of OPTIND
8081 Report and patch from Grisha Levit <grishalevit@gmail.com>
8083 lib/readline/display.c
8084 - rl_redisplay: make sure lpos is initialized to 0 if local_prompt is
8088 - run_startup_files: make sure ssh_reading_startup_files is set to 0
8089 in more places; still dependent on SSH_SOURCE_BASHRC
8091 builtins/evalstring.c
8092 - should_suppress_fork: make sure ssh_reading_startup_files is 0 in
8093 order to suppress a fork. It will never be non-zero unless someone
8094 enables SSH_SOURCE_BASHRC.
8095 Fixes https://issues.redhat.com/browse/RHEL-5653
8098 - posix_unbind_tempvar: new function to implement POSIX interp 1009,
8099 which says that `x=4 unset x' not only unsets the variable in the
8100 temporary environment but the most recent scope as well.
8103 - posix_unbind_tempvar: extern declaration
8106 - unset_builtin: if we are unsetting a variable that is in some
8107 temporary environment, and the shell is in posix mode, call
8108 posix_unbind_tempvar to implement the right posix behavior
8111 - update posix mode section with change to unset for interp 1009
8115 lib/readline/readline.c
8116 - _rl_subseq_result: add check before _rl_do_lowercase_version that
8117 _rl_to_lower actually results in a different key sequence
8118 Report and patch from Grisha Levit <grishalevit@gmail.com>
8120 lib/readline/isearch.c
8121 - _rl_isearch_dispatch: if the function bound to a key and the function
8122 bound to the result of _rl_to_lower for that key are both
8123 rl_do_lowercase_version, just insert the key into the search string
8128 - heredoc_string: new variable to indicate whether or not we're reading
8129 a here-document from an alias (a pushed string). Set in
8130 gather_here_documents individually for each call to
8134 - read_a_line: if heredoc_string is non-zero, use shell_getc instead
8135 of yy_getc to get the right alias processing
8136 - shell_getc: if heredoc_string is non-zero, don't add a space to the
8137 end of the alias -- it can mess up the here-document delimiter if
8138 the next character is a newline
8139 Report and sample patch from gldrk <me@rarity.fan>
8142 - read_a_line,make_here_document: if we're using shell_getc to read
8143 the body of a here-document, let it manage line_number
8148 - bash_dequote_filename: fix an off-by-one error that didn't remove a
8149 closing single quote in a filename if it was backslash-escaped.
8150 Report by Ole Tange <ota@prosa.dk>, fix from Grisha Levit <grishalevit@gmail.com>
8152 lib/readline/terminal.c
8153 - _rl_check_ansi_terminal: check whether or not rl_terminal_name
8154 appears to be an ANSI/ECMA-48 terminal. Check some common terminal
8155 types and then check whether some common terminal capabilities
8156 (ce, nd, ho, up) begin with CSI (ESC-[) and then have a correct
8157 subsequent character
8158 - _rl_term_isansi: new variable, holds readline's idea about whether
8159 the value of rl_terminal_name is an ANSI/ECMA-48 terminal. Initialized
8160 to RL_ANSI_TERM_DEFAULT; set to the result of _rl_check_ansi_terminal
8161 if initialized to 0 and on a `non-dumb' terminal
8162 From an idea by John Tsiombikas <nuclear@mutantstargoat.com> in 11/2023
8164 lib/readline/rlconf.h
8165 - RL_ANSI_TERM_DEFAULT: define to 1 (yes) or 0 (no) to tell readline
8166 whether or not to assume it's running on an ANSI/ECMA-48 terminal.
8167 The default is 1 (yes)
8172 - make_command_string_internal: when printing a coproc, print the
8173 coproc name only if the coproc command is not a simple command.
8174 Report from Albert Akchurin <ackbeat@gmail.com>
8178 doc/bash.1,doc/bashref.texi
8179 - bind: clarify meaning of `re-read' as being individual arguments
8181 Report from Dan Jacobson <jidanni@jidanni.org>
8182 - history expansion: add that the quick substitution character is
8183 only active when it's the first character on the line.
8184 Suggested by Dale R. Worley <worley@alum.mit.edu>
8186 lib/readline/histexpand.c
8187 - history_expand: if history_quoting_state is "'", don't try to
8188 interpret the quick substitution syntax at the start of the string.
8189 Report from Sundeep Agarwal <learnbyexample.net@gmail.com>
8191 execute_cmd.c,execute_cmd.h
8192 - save_lastarg: new function, returns saved value of $_ in allocated
8196 - execute_variable_command: instead of inline code, call save_lastarg
8199 - check_mail: instead of inline code, call save_lastarg
8200 - check_mail: instead of calling bind_variable, use bind_lastarg
8203 - decode_prompt_string: use save_lastarg() and bind_lastarg() to preserve
8204 the value of $_ across prompt string decoding.
8205 Patch from Grisha Levit <grishalevit@gmail.com>
8209 lib/readline/doc/readline.3
8210 - updates to some vi-mode bindings
8211 Patch from Josh Brobst <josh@brob.st>
8213 builtins/setattr.def
8214 - set_or_show_attributes: in posix mode, supplying an argument that is
8215 not an identifier when not acting on functions is a utility error.
8216 This will cause a non-interactive shell to exit
8221 - command_print_word_list,print_select_command_head,print_case_command_head,
8222 print_function_def: if we're in pretty-print mode, dequote words
8223 before printing them
8224 Report from Seth Sabar <sethsabar@gmail.com>
8227 - execute_profile_file,execute_bashrc_file: separate the (duplicated)
8228 code that sources the various profile and bashrc files out into
8230 - find_bashrc_file: new function, returns the name of the interactive
8231 shell startup file that should be executed if --rcfile (--init-file)
8232 is not supplied; currently returns DEFAULT_BASHRC
8233 - bashrc_file: default to NULL, making it just the filename supplied as
8234 an argument to --rcfile/--init-file
8235 - execute_bashrc_file: execute whatever find_bashrc_file() returns
8236 if bashrc_file is NULL
8237 From a patch from Allison Karlitskaya <allison.karlitskaya@redhat.com>
8242 - print_case_clauses: if we're printing a comsub for subsequent parsing,
8243 don't add a newline before the first case clause, since it adds a
8244 token after the `in' that will allow reserved words to be parsed.
8245 Report from Oguz <oguzismailuysal@gmail.com>
8249 lib/readline/doc/rltech.texi,lib/readline/doc/readline.3
8250 - Note that since quoted characters are possible, the line readline()
8251 returns may contain embedded newlines.
8252 From a report by Martin Buck <mb-tmp-tah.bet@gromit.dyndns.org>
8257 - parse_compound_assignment,parse_string_to_word_list: if we call
8258 reset_parser, directly or indirectly via yyerror, make sure to set
8259 the pushed_strings member of the saved parser state to NULL, since
8260 reset_parser already freed it and we don't want to try and restore
8261 it in restore_parser_state.
8262 From a report by Nathan Mills <the.true.nathan.mills@gmail.com>
8266 builtins/hash.def, builtins/ulimit.def
8267 - add some calls to sh_chkwrite where there is builtin output
8270 - sh_stat: use strcpy/strcpy when constructing pbuf instead of
8274 - sh_mktmpname,sh_mktmpfd,sh_mktmpdir: use snprintf (filename, PATH_MAX, ...)
8275 instead of sprintf (filename, ...)
8280 - unconditionally AC_DEFINE(PGRP_PIPE), to prevent the problem with a
8281 pipeline and a DEBUG trap containing an external command described
8282 in https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00037.html
8287 - wait_for_any_job: if we're executing a funsub/varsub, do the wait
8288 even if the jobs list is frozen, but don't remove the job from the
8289 table or change its notification status
8290 Report from Oguz <oguzismailuysal@gmail.com>
8293 - uw_unbind_variable: unset the first instance of the named variable,
8294 don't follow namerefs. This is for REPLY in a varsub if it's made
8296 Report from Oguz <oguzismailuysal@gmail.com>
8299 - main: call compat_init() so the linker drags in the old compatibility
8300 functions from lib/sh/compat.c. Primarily for use by existing loadable
8304 - parse_compound_assignment: handle error case (wl == &parse_string_error)
8305 before restoring the parser state from ps
8306 Report from Grisha Levit <grishalevit@gmail.com>
8310 lib/readline/complete.c
8311 - compute_lcd_of_matches: move a strlen out of a call to MBRTOWC by
8312 computing the length of the entire string once and then using an
8313 offset from it while going through the loop
8318 - parse_compound_assignment: treat parsing a string following (( (read
8319 by parse_dparen but not an arithmetic command) the same as
8320 expanding an alias when fixing up the pushed string list
8321 Report from Grisha Levit <grishalevit@gmail.com>
8326 - typos and style fixes to satisfy groff warnings; remove uses of the
8327 `CW' constant-width font; use .EX/.EE for examples; use consistent
8328 style for double-quoted strings; fix inconsistent inter-paragraph
8330 Fixes from G. Branden Robinson <g.branden.robinson@gmail.com>
8335 - binary_test: make sure all calls in posix mode use TEST_LOCALE for
8336 locale-specific string comparisons
8339 - find_bashrc_file: remove
8344 - exit_shell: don't try to call rl_deprep_terminal, regardless of the
8345 readline state we inherited, if bash_readline_initialized is 0
8346 Fixes bug reported by Oguz <oguzismailuysal@gmail.com>
8347 - shell_reinitialize: reset startup_state and reading_shell_script to 0;
8348 reset debugging_mode to 0
8353 - reset_shopt_options: reset debugging_mode to 0
8356 - reset_shell_options: reset interactive_comments to 1
8359 - brace_expand: if the first call to brace_gobbler consumes the entire
8360 string, don't try to call it again
8361 - brace_expand: check that i < tlen before checking to see if
8362 expand_seqterm left more of the string unconsumed
8363 - brace_gobbler: if extract_command_subst hits the end of the string
8364 without closing the command substitution, make sure we return 0 as
8365 well as set *i = tlen
8366 From a fuzzing report by Nathan Mills <the.true.nathan.mills@gmail.com>
8371 - function_substitute: unwind-protect current_builtin and this_shell_builtin
8372 like we do this_shell_function
8373 From a fuzzing report by Nathan Mills <the.true.nathan.mills@gmail.com>
8378 - brace_gobbler: handle nofork command substitutions; skip over any
8379 enclosed command and any braces it contains
8382 - check_redir: return 0 if we're in a nofork comsub, so we will attempt
8383 command word completion if appropriate
8387 lib/readline/readline.h
8388 - RL_STATE_READSTR: new state flag saying we are reading an arbitrary
8389 string from the keyboard using rl_readstr
8391 lib/readline/rlprivate.h
8392 - READSTR_FREEPMT: new context state flag for rl_readstr; indicates
8393 that we have allocated a new prompt with _rl_make_prompt_for_search
8394 and we should free it with rl_restore_prompt because rl_clear_message
8398 - _rl_readstr_init,_rl_readstr_cleanup: set and unset RL_STATE_READSTR
8399 - _rl_unsave_saved_readstr_line: free any rl_undo_list, which we may
8400 have accumulated while reading the string, before restoring the line
8401 Fixes leaks reported by sparrowhawk996@gmail.com.
8402 - _rl_readstr_init: set the READSTR_FREEPMT context flag after we
8403 call _rl_make_prompt_for_search, which calls rl_save_prompt
8404 - _rl_readstr_sigcleanup: new function to call from signal cleanup;
8405 restores prompt and calls _rl_readstr_cleanup to free the readstr
8407 - _rl_readstr_restore: if the RL_READSTR_FREEPMT flag is set in the
8408 context, call rl_restore_prompt to deallocate the prompt we created
8410 lib/readline/callback.c
8411 - rl_callback_sigcleanup: call _rl_readstr_sigcleanup to deallocate
8412 readstr state on a signal
8415 - rl_execute_named_command: free COMMAND before returning
8419 lib/readline/rlprivate.h
8420 - SF_FREEPMT: new flag for non-incremental search contexts: means we
8421 saved the prompt data with _rl_make_prompt_for_search and need to
8422 restore it with rl_restore_prompt, since rl_clear_message will not
8424 lib/readline/search.c
8425 - _rl_nsearch_sigcleanup: new function that if calls rl_restore_prompt
8426 to clean up the saved prompt data if necessary before calling the
8427 context cleanup function, avoids memory leak
8428 - _rl_nsearch_init: set the SF_FREEPMPT flag after calling
8429 _rl_make_prompt_from_search so we can clean it up properly on errors
8430 - _rl_nsearch_abort,_rl_nsearch_dosearch: call rl_restore_prompt only
8431 if cxt->sflags includes SF_FREEPMT, manage SF_FREEPMT state
8433 lib/readline/signals.c
8434 - _rl_state_sigcleanup: call _rl_nsearch_sigcleanup
8436 lib/readline/callback.c
8437 - _rl_callback_sigcleanup: call _rl_nsearch_sigcleanup
8442 - change_to_directory: don't try to canonicalize a NULL path that's
8443 NULL after make_absolute.
8444 From a report by Kerin Millar <kfm@plushkava.net>
8447 - retrieve_proc_status,delete_proc_status: external interfaces to
8448 bgp_search and bgp_delete, respectively; these take an argument
8449 that says whether or not to block SIGCHLD
8452 - retrieve_proc_status,delete_proc_status: extern declarations
8455 - check_bgpids: new function to check whether a requested PID is in
8456 the bgpids table (retrieve_proc_status) and optionally delete it
8457 if it is (posixly_correct delete_proc_status) while returning its
8458 status. If the PID isn't in the bgpids table, return -1
8459 - wait_builtin: if -n is supplied with pid/job arguments, use
8460 check_bgpids to check the bgpids table for any of the requested
8461 pids. Tagged for bash-5.3, might need another option
8462 From a report by Steven Pelley <stevenpelley@gmail.com>
8467 - redir_open: assume the AFS bug with O_CREAT and existing files in
8468 protected directories has been fixed over the years, so take out
8470 From a report by Etienne Champetier <champetier.etienne@gmail.com>
8473 - wait_for_any_job: if the jobs list is frozen and we're running a
8474 funsub, mark the job as notified so it gets cleaned up later
8475 - wait_for_any_job: if we're in posix mode, we should remove the job
8476 from the job list and not add it to the bgpids list, as posix
8480 - set_shellopts: use ASS_FORCE in the call to bind_variable so we
8481 don't have to mess with temporarily turning off readonly
8484 - set_bashopts: same
8485 Report by Emanuele Torre <torreemanuele6@gmail.com>
8490 - vblen: make it a size_t to avoid going negative on underflow
8491 - clearerr, ferror, fflush: don't test these if vflag is set and we're
8492 writing to a string (multiple places)
8493 - vbprintf: pass through failure returns (< 0) from vsnprintf to the
8494 caller(s) so we can return on errors
8495 - printf_builtin: remove redundant test for empty or missing format
8497 - PF: call builtin_error if vflag is set, sh_wrerror otherwise
8499 - PF: use PRETURN so we can get partial output to the variable on
8500 error (if vflag is set)
8501 - PRETURN: free conv_buf before attempting the write (it would get
8502 cleaned up on the next call, but why not)
8503 - PRETURN: clean up vbuf only if vflag is set, and clean it up on
8504 error (it would get cleaned up on the next call, but...)
8505 Fixes from Grisha Levit <grishalevit@gmail.com>
8509 doc/bash.1,doc/bashref.texi
8510 - word expansions: make it clearer that quote removal is one of the
8511 shell word expansions
8513 execute_cmd.c,execute_cmd.h
8514 - currently_executing_command: no longer static, so other parts of
8515 the shell can save and restore it if necessary
8518 - function_substitute: unwind-protect currently_executing_command,
8519 since parse_and_execute can overwrite it in the current shell
8521 Report from Grisha Levit <grishalevit@gmail.com>
8523 lib/readline/readline.c
8524 - readline_common_teardown: new function from the guts of
8525 readline_internal_teardown, manages and deallocates rl_undo_list.
8527 lib/readline/callback.c
8528 - rl_callback_handler_remove: if we're removing the line handler
8529 while we still have an undo list, we didn't call
8530 readline_internal_teardown. Call readline_common_teardown to manage
8531 the undo list in case we are calling this from a signal handler
8532 but not exiting the program.
8533 Fixes leaks reported by sparrowhawk996@gmail.com.
8536 - initialize_shell_variables: use ASS_FORCE when binding SHELLOPTS or
8537 BASHOPTS if we get them from the environment, in case they've
8538 already been created as shell variables and set to readonly (like
8540 - set_ppid: use ASS_FORCE in the call to bind_variable instead of
8541 temporarily turning off att_readonly
8544 - extract_delimited_string: pass FLAGS down to skip_single_quoted and
8545 skip_double_quoted so we propagate SX_COMMAND and SX_COMPLETE
8547 Fixes bug reported by A4-Tacks <wdsjxhno1001@163.com>
8552 - initialize_readline: add `bash-vi-complete' as a bindable command
8553 name so users can bind other key sequences to it
8554 - vi_advance_point: function to advance point by one character even
8555 in the presence of multibyte characters
8556 - bash_vi_complete: call vi_advance_point instead of just incrementing
8561 doc/bash.1,lib/readline/doc/readline.3
8562 - minor updates to handle old versions of troff and groff warnings
8563 Fixes from G. Branden Robinson <g.branden.robinson@gmail.com>
8568 - notify_of_job_status: in non-interactive shells, if we're not going
8569 to print information about a terminated background job
8570 (SIGINT/SIGTERM/SIGPIPE), don't mark it as notified, in the same
8571 way that we don't mark background jobs that exit cleanly as notified
8572 Inspired by a discussion with Robert Elz <kre@munnari.oz.au> and
8573 https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00189.html
8577 lib/readline/history.c
8578 - DEFAULT_HISTORY_GROW_SIZE: bump up to 256
8579 - real_history, real_history_size: the true history array and its
8580 allocated size. the_history begins a user-visible window into this
8581 list, extending for history_size entries
8582 - history_list_grow_size: compute how much to extend the history list;
8583 increase by roughly sqrt(history_size), don't extend by less than
8584 (new) DEFAULT_HISTORY_GROW_SIZE
8585 - history_list_resize: possibly resize/realloc real_history and reset
8586 the_history to real_history and history_size to real_history_size
8587 - advance_history: make the `window' that the_history provides into
8588 real_history advance to simulate dropping an initial entry; don't
8589 need to memmove all the entries any more
8590 - add_history: call advance_history as necessary to move the_history
8592 - add_history: call history_list_resize as necessary
8593 Report and initial patch from Casey Johnson <strykre@hotmail.com>
8597 bashline.c,lib/readline/bind.c,lib/readline/display.c
8598 - replace some sprintf calls with snprintf to appease clang
8601 - execute_simple_command: unwind-protect this_command_name, since we
8602 assign it to something we will free if unwind-protects are run
8603 - execute_function: unwind-protect currently_executing_command, since
8604 execute_command_internal will change it to something will will free
8605 if unwind-protects are run
8606 Report from Grisha Levit <grishalevit@gmail.com>
8607 - execute_function: if we didn't compile with debugger support, restore
8608 currently_executing_command after run_debug_trap, like in other
8613 builtins/declare.def
8614 - declare_invalid_opts: move the code that checks for invalid option
8615 combinations to its own function; it returns 0 for no errors and
8616 a return code for declare_internal to return otherwise
8617 Inspired by report from Grisha Levit <grishalevit@gmail.com>
8618 - declare_invalid_opts: make -A -a and -A +A/-a +a option combinations
8620 Report from Grisha Levit <grishalevit@gmail.com>
8624 bashline.c,general.c,subst.c,lib/sh/pathphys.c,builtins/read.def,
8625 support/bashversion.c
8626 - changes for cygwin and msys (no new features)
8628 bashline.c,builtins/fc.def,general.c,parse.y,stringlib.c,subst.c,variables.c
8629 - MSYS-specific changes to support \r\n line endings and DOS-style
8632 configure.ac,cross-build/msys32.cache,support/config.rpath,support/shobj-conf
8633 - MSYS-specific build options
8635 configure.ac,config.h.in,m4/unlocked-io.m4,general.h,include/unlocked-io.h
8637 - adapt Gnulib's unlocked-io module for faster stdio functions.
8638 From Grisha Levit <grishalevit@gmail.com>
8640 lib/malloc/malloc.c,lib/malloc/table.h,lib/sh/strlcpy.c
8641 - fixes for ISO C 23
8642 Patch from Collin Funk <collin.funk1@gmail.com>
8647 - waitchld: note whether or not we are executing in a signal handler
8648 context and break out of the loop if we receive a terminating
8649 signal instead of calling termsig_handler, which can execute unsafe
8651 From https://issues.redhat.com/browse/RHEL-22295
8654 - valid_readonly_attrs,invalid_readonly_attrs: new defines for declare
8655 to use to validate attempts to modify attributes of readonly
8658 builtins/declare.def
8659 - declare_internal: reject attempts to modify (set or unset) attributes
8660 in invalid_readonly_attrs for readonly variables.
8661 From a discussion with Grisha Levit <grishalevit@gmail.com>
8666 - add att_readonly to valid_readonly_attrs; it's valid to use
8667 declare -r var ; declare -r var
8669 Makefile.in,builtins/Makefile.in
8670 - add unlocked-io.h to dependencies and variable contents where
8672 - add additional include files to INSTALLED_INCFILES
8674 builtins/pushd.def,examples/loadables/necho.c
8675 - fix order of includes to get unlocked-io.h
8676 From Grisha Levit <grishalevit@gmail.com>
8679 - rename quote_rhs -> quote_nosplit
8685 - quote_var_value: break the code that quotes a variable value ($x,
8686 ${x}, ${x[n]}, etc.) into a separate inline function and call it
8687 from param_expand and parameter_brace_expand_word so they do it
8689 - param_expand: quote $* appropriately using quote_nosplit if we are
8690 in a place where word splitting will not occur (PF_NOSPLIT2),
8691 expand_no_split_dollar_star == 1 but quoted is 0
8692 - quote_var_value: use quote_nosplit if we are in a place where word
8693 splitting will not occur (PF_NOSPLIT2) but quoted == 0.
8694 Fixes bug with IFS=$'\1' reported by alex xmb sw ratchev <fxmbsw7@gmail.com>
8697 - array_value: make sure to quote ${A[*]} appropriately if not quoted
8698 (quoted == 0) and in a place where word splitting does not occur
8699 (flags & AV_ASSIGNRHS); the caller expects array_value to quote in
8703 - parameter_brace_expand_word: make sure to call array_value with
8704 AV_ASSIGNRHS if we are expanding unquoted ${A[*]} in a place where
8705 word splitting does not occur with a non-null $IFS; array_value will
8706 quote appropriately here
8707 - parameter_brace_expand_word,param_expand: use quote_var_value when
8708 expanding $N and ${N}
8710 doc/bash.1,doc/bashref.texi
8711 - HISTIGNORE: clarify the description a little to emphasize that lines
8712 matching one of the patterns are not saved in the history list
8713 From https://savannah.gnu.org/support/index.php?111020
8718 - FEVAL_RETRY: if set in FLAGS, _evalfile will retry an interrupted
8720 - _evalfile: if open() returns -1, FEVAL_RETRY is set in FLAGS, and
8721 errno == EINTR, retry the open after checking for interrupts or
8723 - maybe_execute_file,force_execute_file: pass FEVAL_RETRY in flags
8726 - load_history: retry read_history if it returns EINTR after checking
8727 for interrupts or terminating signals
8730 - _rl_read_init_file: retry the open once if it's interrupted due to a
8731 signal. If we are at a point where readline has installed its
8732 signal handlers, check for signals readline handles
8733 From a patch from Grisha Levit <grishalevit@gmail.com>
8738 - make_internal_declare: now takes two strings of option arguments:
8739 those to turn on (`-') and those to turn off (`+')
8740 - expand_declaration_argument: simplify the code; handle `-' and `+'
8741 optionsns; always call make_internal_declare
8742 From a patch from Grisha Levit <grishalevit@gmail.com>
8747 - add additional character to test for broken wcwidth (0x200b)
8749 lib/readline/display.c
8750 - update_line: use IS_COMBINING_CHAR instead of UNICODE_COMBINING_CHAR
8751 plus WCWIDTH; it doesn't make sense on systems where wcwidth isn't
8757 - print_case_clauses: if one of the case command pattern lists begins
8758 with the word `esac' (unquoted), precede the pattern list with `(',
8759 since it had to be there originally to get through the parser.
8760 Report by Emanuele Torre <torreemanuele6@gmail.com>
8765 - string_to_rlimtype: takes a second ENDP argument, like strtol, so
8766 the caller doesn't have to check that the string is all digits,
8767 but can optionally check for and disallow a 0x prefix
8772 - dequote_list: unset the W_QUOTED flag in the word after dequoting it
8773 - parameter_brace_expand_rhs: if the word in the list returned by
8774 expand_string_for_rhs has W_QUOTED set, but the string being
8775 expanded was not quoted, turn on the W_QUOTED in the returned word
8776 so we can potentially avoid word splitting
8777 - expand_word_internal: if CTLNUL is a IFS character, don't add quoted
8778 null strings to istring if we're going to be word splitting, since
8779 they will be treated as word delimiters
8783 examples/loadables/getconf.c
8784 - getconf_builtin,getconf_all: changes for POSIX interp 1808 proposal
8785 to allow an optional pathname argument with -a that forces its use
8786 for pathconf variables
8787 https://www.austingroupbugs.net/view.php?id=1808
8792 - printf_builtin: %lc/%ls (%C/%S) should only work on wide characters
8793 when in a locale where MB_CUR_MAX > 1.
8794 Report by Emanuele Torre <torreemanuele6@gmail.com>
8799 - notify_of_job_status: don't mark terminated background jobs or stopped
8800 jobs as notified in shells started to run -c command
8801 From a report by Greg Wooledge <greg@wooledge.org>
8802 - notify_of_job_status: make the final marking the dead job as notified
8803 a true catch-all so we can put a debugging message in there to see
8804 if there are other missing cases
8805 - notify_of_job_status: don't mark terminated jobs that died due to
8806 a signal the shell trapped (on the assumption that the shell
8807 received the signal, too) as notified, since we don't report on it
8808 in the JDEAD case if the signal is trapped
8813 - PF: print an error message if printf returns an error or leaves
8815 From a report by Paul Eggert <eggert@cs.ucla.edu>
8820 - getint: now takes an int argument and returns it if the conversion
8821 overflows an int; changed callers in printf_builtin
8822 - getint: consolidate checks for overflow. This changes the behavior
8823 if the argument overflows an intmax_t: it returns a field width of
8824 0 (the overflow result) instead of -1, which changes how printf
8825 behaves. This is consistent with the behavior when the argument
8827 - printf_builtin: change check for overflow of [LONG_MIN..LONG_MAX]
8828 for %d/%i to be explicit instead of relying on integer overflow of p
8829 - printstr,printwidestr: print message if field width or precision
8830 overflow, since we don't call printf
8831 - printstr,printwidestr: set field width and precision on integer
8832 overflow the way we do in printf_builtin
8833 From a report by Paul Eggert <eggert@cs.ucla.edu>
8836 - PRIdMAX: move redefinition here after including inttypes.h
8838 builtins/printf.def,examples/loadables/seq.c,examples/loadables/getconf.h
8839 - remove PRIdMAX redefinitions, since it's now fixed in bashtypes.h
8840 From a report by Paul Eggert <eggert@cs.ucla.edu>
8844 include/stdckdint.in.h,include/intprops-internal.h
8845 - new files, from gnulib
8848 - stdckdint.h: create in the build directory if the system doesn't
8849 provide one by copying ${srcdir}/include/stdckdint.in.h; make
8850 sure we don't create a new one every time, changing the timestamp
8853 - CREATED_HEADERS: add stdckdint.h