From: Chet Ramey Date: Mon, 22 Jul 2019 13:24:14 +0000 (-0400) Subject: commit bash-20190719 snapshot X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=194cfc28f8c573736dec4e51fbfa1681a072c7f3;p=thirdparty%2Fbash.git commit bash-20190719 snapshot --- diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 4f6f6bbeb..b710af3a5 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -6251,7 +6251,8 @@ lib/sh/strtod.c ---- lib/sh/utf8.c - utf8_mblen: return -2 if the UTF-8 sequence is incomplete - - utf8_mblen: 4-byte UTF-8 characters start with a byte < 0xf4 + - utf8_mblen: 4-byte UTF-8 characters start with a byte <= 0xf4; limit + to 4-byte UTF-8 (since 5- and 6-byte code points were removed in 2003) 7/12 ---- @@ -6280,3 +6281,97 @@ lib/readline/display.c local_prompt_newlines, and we want the values computed in the call that uses local_prompt to be the ones that we use. Fixes prompt wrapping bug reported by Tianon Gravi + + 7/16 + ---- +Makefile.in + - added a number of dependencies from Vemake Vemake + as reported in + http://savannah.gnu.org/patch/download.php?file_id=47219 + + 7/19 + ---- +lib/sh/utf8.c + - utf8_mblen: changes to handle invalid multibyte sequences better, + even when N means that the sequence would be too short anyway + +arrayfunc.c + - bind_assoc_var_internal: new convenience function to assign a + key-value pair to an associative array. It gets the SHELL_VAR * AND + a HASH_TABLE *, which may or may not correspond to the assoc_cell + of the variable, and performs the insertion into the hash table. + Callers take care of passing the right values. + - bind_assoc_variable: call bind_assoc_var_internal to do the real + work + - assign_compound_array_list: change to assign associative array + key-value pairs into a new hash table (NHASH), so we can still use + the old value for expansion. We do this in place of clearing out + the contents of the associative array before performing the expansion + and assignments. After doing all the assignments into NHASH, we swap + NHASH into the variable as its value and dispose of the old value. + Fixes inconsistency reported by Darren 'Tadgy' Austin + + + 7/20 + ---- +aclocal.m4 + - include bashansi.h in a bunch of AC_TRY_RUN recipies to avoid + exit() being flagged as an implicit declaration. Report and fix + from Chris Yungmann + +shell.c + - set_exit_status: set last_command_exit_value to the argument and make + sure to set PIPESTATUS from that exit value + +shell.h + - set_exit_status: extern declaration + +parse.y + - report_syntax_error: make sure to set PIPESTATUS if we set + last_command_exit_value on a syntax error + - parse_string_to_word_list,parse_compound_assignment: set PIPESTATUS + when we set last_command_exit_value + +sig.c + - throw_to_top_level,sigint_sighandler: set PIPESTATUS when we set + last_command_exit_value + +variables.c + - sv_locale: call set_exit_status to set PIPESTATUS and last_command_exit_value + +arrayfunc.c + - find_or_make_array_variable,array_expand_index,assign_compound_array_list: + call set_exit_status to set PIPESTATUS and last_command_exit_value + +builtins/evalstring.c + - parse_and_execute: set PIPESTATUS when we set last_command_exit_value + +braces.c + - brace_expand: call set_exit_status to set PIPESTATUS and last_command_exit_value + +eval.c + - reader_loop: call set_exit_status to set PIPESTATUS and last_command_exit_value + +make_cmd.c + - set PIPESTATUS when setting $? due to syntax errors or constructs + not being available + +expr.c + - expr_streval: set PIPESTATUS when setting $? due to syntax errors + +subst.c + - extract_delimited_string,extract_dollar_brace_string,do_assignment_internal, + call_expand_word_internal,array_length_reference,param_expand, + parameter_brace_expand_word,parameter_brace_expand_rhs, + parameter_brace_expand_error,parameter_brace_expand,err_unboundvar: + set PIPESTATUS when setting last_command_exit_value on error + conditions + +redir.c + - REDIRECTION_ERROR: set PIPESTATUS when setting last_command_exit_value + on error conditions + +subst.c + - match_upattern,match_wpattern: if the match length is greater than the + string length, short-circuit and return failure. Fixes bug + reported by Eduardo Bustamante diff --git a/CWRU/changelog b/CWRU/changelog deleted file mode 120000 index d2d81b302..000000000 --- a/CWRU/changelog +++ /dev/null @@ -1 +0,0 @@ -CWRU.chlog \ No newline at end of file diff --git a/CWRU/changelog b/CWRU/changelog new file mode 100644 index 000000000..f848516e5 --- /dev/null +++ b/CWRU/changelog @@ -0,0 +1,6357 @@ + + 9/15/2016 + --------- +[bash-4.4 released] + + 9/17 + ---- +builtins/common.c + - display_signal_list: if 0 is supplied as an argument to kill -l, + display a signal-out-of-range error. Fixes bug reported by + Martijn Dekker + + 9/18 + ---- +print_cmd.c + - print_heredoc_bodies: take a list of redirections, all here documents, + and print the here-document bodies including the ending delimiter, + followed by a newline + - print_redirection_list: print the heredoc headers the first time + through the list of redirections so we print them in the same left- + to-right order they're supplied; print the bodies and delimiters with + print_heredoc_bodies after we print all the redirections if we're + not printing a list of commands (printing_connection == 0). Fix for + problem reported by Isabella Parakiss + - print_deferred_heredocs: don't print heredoc headers, since they're + now printed in print_redirection_list + - print_deferred_heredocs: use print_heredoc_bodies + + 9/20 + ---- +builtins/mapfile.def + - readarray: update usage synopsis to include -d delim. Report and + fix from jhankins@homewood.k12.al.us + +test.c + - test_binop: if op[0] == '-', make sure op[1] != 0 before checking + op[2] or op[3]. Fixes out-of-bounds read reported by Franco + Costantini + +parse.y + - cond_term: if yylval.word->word[0] == '-' make sure word[1] != 0 + before checking word[2] and calling test_unop. Fixes out-of-bounds + read reported by Franco Costantini + - make sure to check all instances of the return value of the + simple_command production before trying to hook redirections onto it, + since it can potentially return NULL. + Reported by Franco Costantini + + 9/21 + ---- +parse.y + - token_is_assignment: make sure to check that the return value from + assignment() finds the `=' we just added at index I to avoid false + positives from g=g=g=g=g=g=(). Reported by Franco Costantini + + + 9/22 + ---- +parse.y + - token_is_assignment: if we're not using the bash malloc (which has + guard bytes after the requested allocation size), use a new + buffer so we can make sure it's big enough to hold the current + token and at least two additional characters. Reported by + Franco Costantini + + 9/23 + ---- +execute_cmd.c + - execute_in_subshell: call without_job_control for both job control + and non-job-control builds to avoid waiting for last_made_pid + inherited from parent shell. Related to fix from 8/4 to + initialize_subshell. Fixes bug reported by Martijn Dekker + + +builtins/declare.def + - local_builtin: allow `local --help' to work even when not executing + a function. Suggestion from Norm Abramovitz + + 9/25 + ---- +builtins/printf.def + - bexpand: if passed a null or empty string, return a newly-allocated + empty string (so the return value can always be freed) instead of + NULL. + - printstr: if passed a null string, treat it as if it were an empty + string so any precision or fieldwidth arguments are handled + correctly. Report from isabella parakiss + +subst.c + - skip_matched_pair: make the flags argument of 1 affect whether or + not backslash can quote characters in the string, so it affects + all quoting mechanisms + +arrayfunc.c + - unbind_array_element: now takes a third (flags) argument; flags&1 + means to not expand an associative array index. This is only called + from a shell builtin context, which means the argument should have + already undergone word expansion, so it should be ok. Will still + be a problem for uses like "unset -v 'var[$ind]'", quoted to avoid + globbing + - valid_array_reference: pass second flags argument to skipsubscript; + still set to 0 by all callers + +arrayfunc.h + - unbind_array_element: updated prototype + +builtins/set.def + - unset_builtin: add third argument of 1 to unbind_array_element calls + [TEMPORARILY DISABLED] + - unset_builtin: call valid_array_reference with second arg of 1 to + handle unmatched pairs of quotes and [/] + +array.c + - array_reference: optimize access locality as well as sequential + access by adding ability to start from last-accessed element and move + backwards or forwards depending on the desired index. Inspired by + report from Tom McCurdy and followup from + Christian Franke + +variables.c + - all_array_variables: include associative arrays, not just indexed + arrays. Reported by Grisha Levit + +execute_cmd.c + - execute_disk_command: if we're optimizing out the fork (CMD_NO_FORK), + decrement the shell level so we don't end up incrementing it twice. + We should decrement the shell level for an implicit exec like an + explicit one. Reported by Stephane Chazelas + + +builtins/exec.def + - exec_builtin: don't bother to decrement the shell level if we are + already in a `(command)' subshell. Reported by Stephane Chazelas + + +lib/readline/macro.c + - macro_level: count of macro nesting level, maintained by + _rl_push_executing_macro and _rl_pop_executing macro + - _rl_with_macro_input: if current nesting level exceeds + MAX_MACRO_LEVEL, abort the current command line with _rl_abort_internal + and return to the top level. Reported by Christian Klomp + + +lib/readine/history.c + - add_history: if allocating the history list for the first time, + make sure the max history list size isn't so large that it will + cause allocation errors. Cap it at MAX_HISTORY_INITIAL_SIZE + (8192). Reported by Sean Zha + +jobs.c + - wait_for: if a foreground job with job control enabled is killed by a + SIGINT and sourcelevel != 0, act as if we received the SIGINT so the + file sourcing can be terminated. Reported by PePa + + + 9/26 + ---- +subst.c + - read_comsub: only warn once for null bytes in command substitution + output, instead of once for every null byte + +arrayfunc.c + - array_variable_part: now takes a `flags' argument; changed all callers + to initially pass 0 + - array_variable_name: now takes a `flags' argument; changed all callers + to initially pass 0 + - array_variable_name: pass `flags' argument to skipsubscript instead + of just passing 0 + +arrayfunc.h + - array_variable_{name,part}: added new argument to prototypes + + 9/29 + ---- +bashline.c + - bash_directory_completion_hook: don't bother to try and expand a + ${ or $( that isn't complete; expand_prompt_string will complain. + Fixes reports from John Passaro and + Valentin Bajrami + +lib/readline/history.c + - _hs_append_history_line: use a strategy that attempts to avoid + realloc copying memory to a newly-allocated block if the history + line we're appending to gets `too long' (currently 256 bytes). + We reallocate in powers of 2 starting at 512, and rely on realloc + not allocating a new block and copying into it if the size is the + same as the last call to realloc. Addresses issue raised by + Hubert Schmid + +trap.h + - check_signals: new extern declaration + - trapped_signal_received: new extern declaration + +builtins/read.def + - read_builtin: if one of the zread* functions returns < 0 (which + usually only happens in Posix mode), make sure we call check_signals() + before eventually calling run_pending_traps() because zread() isn't + going to call it + - include trap.h for correct extern functions and variable declarations + +lib/sh/zread.c + - zread: if executing a builtin, call check_signals_and_traps() for + backwards compatibility. If not, call check_signals() only, because + we don't want to run traps during, for instance, reading command + substitution output. Fixes race condition bug reported by Luiz Angelo + Daros de Luca + + 9/30 + ---- +subst.c + - command_substitute: reset parse_and_execute_level to 0 in the child + process, since it's independent of the other parse_and_execute + calls. Adds command substitution inside other parse_and_execute + calls optimizations to suppress forks, as suggested by + Martijn Dekker + + 10/3 + ---- +configure.ac + - SHOBJ_STATUS: make sure it defaults to unsupported and is substituted + if the shobj-conf script isn't run. Fixes `make install' bug with + a minimal config reported by Andrew Tomazos + + 10/5 + ---- +support/shobj-conf + - darwin: set compatibility_version for a shared build of the readline + library (the standalone readline distribution shares this file) to + $(SHLIB_MAJOR)$(SHLIB_MINOR). Recommendation from Max Horn + + + 10/6 + ---- +array.h + - array_first_index: new convenience define + +array.c + - ADD_AFTER: new define, complement of ADD_BEFORE + - UNSET_LASTREF: now takes an array as an argument, prepping for move + of lastref pointer into the array struct + - array_insert: check whether we are adding at the beginning of the + array and take a fast path if so + - array_insert: use same strategy as array_reference to find the place + to insert, starting from the last-referenced element and moving + forward or back from there; use ADD_AFTER if moving backward + - array_insert: if replacing an existing element, just replace the + value with new->value instead of the entire element + - array_reference: short-circuit quickly if looking for an element + before the first assigned index + - array_reference: if we don't find the element, leave lastref pointing + to the closest element under the assumption we will be assigning or + looking for something close + - array_reference: take advantage of ordered indexes to short-circuit + when looking for element that is not set + + 10/7 + ---- +array.c + - array_remove: short-circuit if asked to remove index after max + index or before first index + + 10/10 + ----- +lib/malloc/malloc.c + - internal_realloc: if we are requesting reallocation to the same size + as the block's current size, short-circuit and return `mem' right + after doing bounds check + - internal_realloc: if we are reducing the size of an allocation, and + the new size fits in the next lower bin, just keep the same block + and adjust the size, so we can avoid some copies + +parse.y + - set_line_mbstate: keep track of the allocated size of + shell_input_line_property, only request reallocation if the size + increases, but don't let it get too big + + 10/11 + ----- +jobs.c + - wait_for_background_pids: make sure we wait for pid in + last_procsub_child since it's not found in any job -- still needs + more work to wait for multiple process substitutions + +subst.c + - process_substitute: if make_child fails, make sure we call + restore_pipeline to undo the previous save_pipeline() + + 10/15 + ----- +subst.c + - process_substitute,command_substitute: leave subshell_level (reflected + as $BASH_SUBSHELL) intact for any exit trap instead of decrementing + it. Suggested by Martijn Dekker + +builtins/evalstring.c + - optimize_subshell_command: new function, framework for optimizing + out forks for command that have already forked and are executing + in a subshell. Not used yet + +expr.c + - readtok: if we have a post-increment or post-decrement, and the + previous token is not a string, check whether the previous token is + a number that results from a pre-increment or pre-decrement, and + make that an error. Report from Conrad Hoffmann + + 10/16 + ----- +aclocal.m4 + - BASH_JOB_CONTROL_MISSING: convert from AC_TRY_RUN to AC_TRY_COMPILE + with existing set of preprocessor defines, so it can work when + cross-compiling. Suggested by Felix Janda + + 10/19 + ----- +variables.c + - get_bashpid: BASHPID is no longer readonly; assignments to it are + just ignored. + +doc/{bash.1,bashref.texi} + - BASHPID: note that assignments are ignored and unsetting BASHPID + causes it to lose its special properties + + 10/28 + ----- +builtins/pushd.def + - popd_builtin: make sure to check the normalized stack offset + (i.e., negatives counting back from the end of the stack) is within + bounds before trying to free that stack entry. Report from + Fernando Muñoz + +lib/readline/histfile.c + - chown: protect calls with HAVE_CHOWN. Fixes for MinGW{64,32} from + J. Peter Mugaas + +lib/readline/colors.c + - S_ISDIR: add define if missing + - S_ISUID, S_ISGID, S_ISLNK, S_ISSOCK: don't use unless defined. + Fixes for MinGW{64,32} from J. Peter Mugaas + +bashhist.c + - current_command_line_comment: set to the most recent line in a + possibly multi-line command that contains a shell comment; set in + maybe_add_history and bash_add_history to either the current + command number or -2 + - maybe_add_history: set current_command_line_comment for first line + of command + - bash_add_history: chars_to_add set to "\n" if the current command line + is one greater than the previous line containing a comment + (current_command_line_comment). Fixes complaint from back in + January, 2016 from Dave Rutherford + +array.h + - lastref: move last-referenced pointer into each array struct, so all + arrays can have reference locality + +array.c + - array_create: set lastref element to 0 + - array_copy: if copying the lastref in array a, set the new lastref + in the copy to the same element + - IS_LASTREF, LASTREF_START, LASTREF, INVALIDATE_LASTREF, SET_LASTREF, + UNSET_LASTREF: change to use new array `lastref' member + +pathexp.c + - quote_string_for_globbing: if quoting for a regexp, make sure to + skip and copy a leading `^' in a bracket expression, and skip and + copy a subsequent `]' (after an optional `^'), so that leading + bracket doesn't close the bracket expression. Report from + Stephane Chazelas + + 10/29 + ----- +subst.c + - extract_delimited_string: add calls to CHECK_STRING_OVERRUN for + $( inside $((, nested OPENERs, nested ALT_OPENERs, and backquotes + - skip_to_delim: add calls to CHECK_STRING_OVERRUN for $(, ${, + process substitution + - extract_dollar_brace_string: add calls to CHECK_STRING_OVERRUN for + $( + - extract_dollar_brace_string: use skipsubscript to skip over the + array subscript in ${var[sub]} (non-quoted case uses string_extract, + which already uses skipsubscript). Tagged for bash-5.0 + + 10/30 + ----- +variables.c + - EPOCHSECONDS: new dynamic variable, time in seconds since Unix + epoch; assignments are ignored. Can be used on systems where + strftime() doesn't support '%s' + - EPOCHREALTIME: new dynamic variable, time in seconds since Unix + epoch with microsecond granularity + +doc/{bash.1,bashref.texi} + - EPOCHSECONDS documentation + - EPOCHREALTIME documentation + +execute_cmd.c + - decpoint: moved to locale.c, renamed locale_decpoint; changed callers + +{bashintl,externs}.h + - locale_decpoint: extern declaration or #define if support for + localeconv() not there + + 10/31 + ----- +lib/malloc/malloc.c + - posix_memalign: add new posix-mandated interface + +examples/loadables/rm.c + - rm: minimal loadable builtin, removes files and directories, only + handles -r and -f options. Original from Tim Ruehsen + , heavily rewritten for inclusion as loadable + +examples/loadables/Makefile.in + - rm: add rules to build rm as one of the `other' targets + +examples/loadables/stat.c + - stat: new loadable builtin that takes a filename and loads the info + returned by stat(2) into an associative array specified by the -A + argument (default STAT) + + 11/1 + ---- +variables.c + - BASH_ARGV0: new dynamic variable, returns $0 on reference and sets + $0 on assignment. From a suggestion from Rocky Bernstein + a few years ago + +doc/{bash.1,bashref.texi} + - BASH_ARGV0: document + + 11/2 + ---- +lib/glob/sm_loop.c + - parse_collsym: make sure to not return an out-of-bounds read if a + collating symbol is unterminated. Fixes OOB read reported by + Jerzy Kramarz + - brackmatch: after incrementing p, before checking whether it's a + character range, check whether *p was NULL before the increment + and short-circuit the bracket expression if it is + +jobs.c + - discard_last_procsub_child: new function, safely discards + last_procsub_child and sets it to NULL + +subst.c + - process_substitute: call discard_last_procsub_child instead of + calling discard_pipeline directly. Fixes bug reported by + Christian Weisgerber + + 11/3 + ---- +shell.h + - EX_DISKFALLBACK: new special return status available to builtins; + means to attempt to execute a disk command with the same name as + the builtin + +examples/loadables/rm.c + - if we see the -i option, return EX_DISKFALLBACK + +execute_cmd.c + - execute_simple_command: if executing a builtin returns EX_DISKFALLBACK, + try running execute_disk_command instead + +bashline.c + - shell_expand_line: use expand_word to expand the readline line + buffer, which allows us to pass flags with the word. If a numeric + argument is supplied, do not perform quote removal (pass + Q_HERE_DOCUMENT since here-doc quoting does the right thing) and + do not perform command or process subsitution. From a suggestion + by Dabrien 'Dabe' Murphy based on an old bug-bash + discussion + +subst.c + - expand_word_internal: note that we have added a quoted IFS char to + istring by setting sentinel has_quoted_ifs. Usually we only add + one if we are not going to be performing word splitting, but we + will not perform word splitting if there's no expansion, so we need + to take care of that case + - expand_word_internal: when performing final word split, if there are + no expansions but has_quoted_ifs is non-zero, call remove_quoted_ifs() + to remove any quoted ifs characters we added while processing + - remove_quoted_ifs: new function, removes CTLESC chars preceding + (single-byte) chars in IFS. Used when we are not performing word + splitting. Fixes bug reported by Martijn Dekker + + 11/4 + ---- +lib/readline/macro.c + - _rl_peek_macro_key: return the next character from the current + keyboard macro; the next character from the `next' keyboard macro, + if there is one, if at the end of the current macro; or 0 to + indicate that we are at the end of a keyboard macro sequence + +lib/readline/rlprivate.h + - _rl_peek_macro_key: extern declaration + +lib/readline/readline.c + - _rl_dispatch_subseq: add test for ESC at the end of a keyboard macro, + which should cause the keyboard timeout for ESC to kick in. The + previous test didn't run the timeout code if executing from a macro, + even if we had read the last character of the macro. Fixes bug + reported by Clark Wang + +lib/glob/sm_loop.c + - GMATCH: allow trailing backslash in pattern to explicitly match a + backslash that is the last character in the string. Bug report from + Stephane Chazelas + + 11/5 + ---- +builtins/common.c + - display_signal_list: if displaying a signal name corresponding to an + exit status > 128, don't display the SIG prefix at all. Old code + made displaying the SIG prefix dependent on JOB_CONTROL define. + Report and fix from Martijn Dekker + +execute_cmd.c + - execute_subshell_builtin_or_function: call without_job_control even + if JOB_CONTROL is not defined. Similar to fix from 9/23. + Report from Martijn Dekker + +execute_cmd.c + - execute_simple_command: free memory allocated and passed to + make_child in the child process if JOB_CONTROL is defined + - execute_command_internal: free memory allocated and passed to + make_child in the child process created to run a () subshell or a + compound command within a pipeline if JOB_CONTROL is defined + - execute_coproc: free memory allocated and passed to make_child in + the child process if JOB_CONTROL is defined + - execute_disk_command: free memory allocated and passed to + make_child in the child process if JOB_CONTROL is defined. This + series of fixes is the result of reports from + Eduardo A. Bustamante López + + 11/6 + ---- +lib/sh/unicode.c + - u32toutf16: fix to prevent outputting broken surrogate pairs for + Japanese locales (ja_JP.UTF-8) on cygwin (which uses UTF-16 natively). + Report and fix from Koichi MURASE + +builtins/trap.def + - trap_builtin: if OP is `-' (revert), set the SIGINT signal handler + to sigint_sighandler if the shell is interactive and sourcing a + file (interactive_shell && sourcelevel) or running a trap + (interactive_shell && running_trap) even if it's not currently + interactive. Report from Martijn Dekker + +builtins/read.def + - check for and read multibyte characters in all cases, not just when + we are reading a specific number of characters, as long as + mb_cur_max > 1 + +subst.c + - expand_word_internal: some improvements to code that converts istring + into a WORD_LIST * to avoid multiple allocations and copies of + istring, which is already malloc'ed memory -- reduce number of malloc + and free calls + +test.c + - unary_test: make sure if we test -v array[@] or array[*] that we + free the return value from array_value + + 11/8 + ---- +expr.c + - expcond: make sure to set `noeval' before reading tokens depending on + the result of the conditional test, since readtok() can evaluate + identifiers (and recursively those containing expressions). Report + and fix from Koichi MURASE + +builtins/evalstring.c + - should_suppress_fork: make sure to check for traps on EXIT and + ERR, since any_signals_trapped() only checks for `real' signals, + not the fake shell ones. Fixes bug reported by Werner Fink + + - optimize_subshell_command: ditto + + 11/9 + ---- +eval.c + - reader_loop: change so that we don't reset the SIGINT handler every + time through the command loop in an interactive shell if the signal + is trapped (as the comment noted). Reported by Report from Martijn + Dekker + +subst.c + - parameter_brace_{patsub,remove_pattern,transform,casemod}: save and + restore this_command_name while temporarily setting it for use in + error messages. Fixes use-after-free error reported by + Jerzy Kramarz + - string_extract_verbatim: make sure when we increment i by 2 due to + a CTLESC or CTLESC-CTLNUL that we don't read past the end of the + string. This can happen if the string ends with an odd number of + CTLESC chars. Fixes oob-read error reported by + Jerzy Kramarz + + 11/11 + ----- +configure.ac,aclocal.m4 + - BASH_FUNC_SBRK: make sure sbrk actually works, instead of being just + a stub function like on several Linux distributions + +lib/malloc/malloc.c + - malloc_usable_size: return the maximum number of bytes available for + a particular memory allocation (size of block allocated for it) + + 11/12 + ----- +configure.ac + - changes to make --enable-profiling work on Linux (-pg, no static link, + no -static in LDFLAGS) + +Makefile.in + - changes to make --enable-profiling work on Linux (take + ${PROFILE_FLAGS} out of BASE_CCFLAGS, add to CCFLAGS instead; add + BASE_LDFLAGS define that doesn't include -pg or -static; use + BASE_LDFLAGS in LDFLAGS; move ${PROFILE_FLAGS} and ${STATIC_LD} to + LDFLAGS) + +tests/run-gprof + - changes to make profiling test suite with gprof work on Linux (set + GMON_OUT_PREFIX to handle multiple profiled processes per test; + change default filename to gmon.out from bash.gmon; look for + gprof output files in ${TMPDIR} instead of /tmp; handle multiple + profiling files starting with $GMON_OUT_PREFIX) + +locale.c + - locale_isutf8: use locale_charset() if it's available and nl_langinfo + isn't + - locale_isutf8: add code to parse a locale specification and determine + whether the encoding is UTF-8 (or utf8) in the absence of + nl_langinfo and locale_charset + - set_default_locale: make sure to set locale_utf8locale early on + - locale_utf8locale: set via call to locale_isutf8 wherever LANG, + LC_ALL, or LC_CTYPE is set + + 11/13 + ----- +lib/readline/display.c + - rl_redisplay: handle report of potential integer overflow in + horizontal display mode from Mateusz Lenik + +lib/sh/mbschr.c + - mbschr: if in a UTF-8 locale (locale_utf8locale) and we are looking + for an ASCII character, use (essentially) strchr as a shortcut + +lib/sh/shmbchar.c + - utf8_{mbstrlen,mblen,mbsmbchar,mbsnlen}: UTF-8-specific replacement + functions (should also be able to use utf8_mblen in subst.c: + string_extract_verbatim) + - mbsmbchar: if locale_utf8locale is true, call utf8_mbsmbchar + - mbsmbchar: in UTF-8 locale, use utf8_mblen instead of mbrlen (not + used if earlier shortcut taken) + +lib/sh/unicode.c + - u32cconv: don't use nl_langinfo early to call u32toutf8() + - u32cconv: use locale_utf8locale to set utf8locale + - u32cconv: when initializing (u32init == 0), use locale_charset, then + nl_langinfo, then stub_charset to determine the charset + - u32cconv: even if we don't have iconv, if locale_utf8locale is non- + zero, return u32toutf8 + + 11/15 + ----- +lib/readline/nls.c + - _rl_init_locale: new function, split off code that determines current + locale from _rl_init_eightbit, use it to set _rl_utf8locale + +lib/readiline/rlprivate.h + - _rl_init_locale: new extern declaration + +lib/readline/readline.c + - rl_initialize: if not initializing everything the first time, call + _rl_init_locale to check current locale and set _rl_utf8locale + +lib/readline/text.c + - _rl_insert_char: optimize cases where we are inserting a single-byte + character in a locale with multibyte characters + - _rl_insert_char: check whether character is single byte if we know + we are in a UTF-8 locale, optimize single-byte case to avoid calls + to mbrtowc and memmove/memcpy + +lib/readline/mbutil.c + - _rl_char_value: if we are in a UTF-8 locale (_rl_utf8locale) and the + current character does not have the eighth bit set ((c & 0x80) == 0), + return that char without bothering to call mbrtowc + - _rl_adjust_point: don't bother calling mbrlen if we are in a UTF-8 + locale and the current character is not a multibyte character + - _rl_find_next_mbchar_internal: if we are in a UTF-8 locale, use that + to avoid calls to mbrtowc + +lib/readline/display.c + - _rl_col_width: if in a UTF-8 locale, take advantage of that to avoid + calls to mbrlen and mbrtowc + - rl_redisplay: if in a UTF-8 locale, take advantage of that to avoid + calls to mbrtowc + + 11/17 + ----- +lib/readline/histlib.h + - PATTERN_SEARCH: new flag for history search interfaces, means to + search for a pattern as Posix specifies + +lib/readline/histsearch.c + - history_search_internal: now takes a `flags' argument instead of just + an `anchored' argument to accommodate PATTERN_SEARCH + - _hs_history_patsearch: new internal interface to use when flags + specify PATTERN_SEARCH + +lib/readline/rlprivate.h + - SF_PATTERN: new flag for non-incremental search contexts, means to + treat search string as a pattern (maps to PATTERN_SEARCH) + +lib/readline/search.c + - noninc_dosearch: takes an additional `flags' argument for SF_PATTERN + - noninc_search_from_pos: takes an additional `flags' argument for + SF_PATTERN + - noninc_dosearch: pass flags argument through to noninc_search_from_pos + - _rl_nsearch_init: if we are in vi command mode, and `pchar' (key used + to invoke the search) is `?' or `/', add SF_PATTERN to the flags + to conform to Posix spec for vi-mode editing + - _rl_nsearch_dosearch: if cxt->sflags indicates that we should do a + pattern search, pass SF_PATTERN to noninc_search_from_pos + - rl_noninc_forward_search_again: if in vi command mode and key == `N', + make sure flags arg passed to noninc_dosearch includes SF_PATTERN + - rl_noninc_reverse_search_again: if in vi command mode and key == `n', + make sure flags arg passed to noninc_dosearch includes SF_PATTERN + - rl_history_search_internal: pass extra flags arg to noninc_search_from_pos + + 11/18 + ----- +lib/readline/search.c + - noninc_search_from_pos: takes a new argument, a pointer to int where + it stores the offset of the match in the history line (if non-NULL), + modified callers + - rl_history_search_internal: pass newcol pointer to + noninc_search_from_pos to avoid having to recompute the match offset + in the matching history entry + +config.h.in + - define HAVE_FNMATCH if we have the fnmatch function (configure was + already checking for it) + +lib/readline/histsearch.c + - _hs_history_patsearch: transform the pattern into one ending in a + `*' to avoid having to perform multiple match attempts from each + index in the history line + - history_search_internal: changes to handle pattern matching if + PATTERN_SEARCH is in the flags and HAVE_FNMATCH is defined. This + makes vi-mode history searching treat the user-specified search + string as an fnmatch pattern, as Posix requires. Fixes issue + reported by + + 11/19 + ----- +builtins/shopt.def + - shopt_enable_hostname_completion: only declare this if READLINE + defined, since that's the only time it's used. Reported by + isabella parakiss + + 11/20 + ----- +builtins/common.c + - display_signal_list: make `kill -l 0' print `EXIT', modifying change + from 9/17 + + 11/21 + ----- +subst.c + - expand_word_internal: when the shell encounters a backslash as the + last character of the string, don't try to add a '\'0' to the end + of the string if the string is quoted, just add a <\> and + skip to the end of string processing. Fixes oob-read error + reported by Jerzy Kramarz + +test.c + - two_arguments: check argv[pos][1] before checking argv[pos][2] when + looking for a unary argument. Fixes oob-read error on single `-' + in unary operator position reported by Jerzy Kramarz + + - ANDOR: check s[1] before checking s[2] in case s[1] == end of string. + Fixes oob-read error reported by Jerzy Kramarz + +subst.c + - command_substitute: now takes additional flags argument, changed one + caller (param_expand) to pass through PF_ASSIGNRHS flag; other callers + pass 0 + - command_substitute: pass through flags argument to read_comsub + - read_comsub: now takes additional new flags argument to indicate + whether or not the word is in a context where word splitting will + eventually be performed + - read_comsub: if we are running in a context where word splitting + will not take place (PF_ASSIGNRHS), we read a CTLESC, and CTLESC is + in $IFS, add a CTLESC to make sure it gets through a round of + dequoting + + 11/23 + ----- +parse.y + - xparse_dolparen: since reset_parser frees the pushed string list, + and this is supposed to be a separate parsing context, we need to + save and restore pushed_string_list around the call to parse_string + and reset_parser. Fixes bug reported by Dan Douglas + + +bashhist.h + - HISTEXPAND_DEFAULT: default value of history_expansion, moved here + from flags.c + +flags.[ch] + - histexp_flag: new variable, this is what set -H/set -o histexpand + sets; history_expansion set to value of this variable; defaults to 0 + - history_expansion: now set to HISTEXPAND_DEFAULT + +bashhist.c + - bash_history_reinit: if interact == 0, set history_expansion to the + value of histexp_flag, to allow -H option to enable history + expansion + - bash_history_reinit: if interact == 0, make sure + history_expansion_inhibited is set opposite of histexp_flag, so + enabling history expansion with -H invocation option turns off + inhibited expansion. If interactive shell, we turn it off so + history_expansion controls whether or not history expansion takes + place. In practice, this function is always called with interact == 0, + and -c command still doesn't perform history expansion + +shell.c + - init_interactive: make sure histexp_flag and history_expansion are + identical in an interactive shell; allows both -H/+H option and + default compilation options (HISTEXPAND_DEFAULT) to work + + 11/24 + ----- +subst.c + - get_word_from_string: take advantage of the fact that SEPARATORS is + always a (possibly local) copy of IFS, so build a local charmap of + separators and use it instead of the (cached and possibly stale) + ifs_cmap map and isifs macro. Fixes bug with -N stripping leading + whitespace reported by Clark Wang + + 11/25 + ----- +builtins/read.def + - read_builtin: make `i' volatile, since auto variables are technically + undefined after a longjmp, and a timeout on SIGALRM causes one. + Fix suggested by Dmitry Goncharov + + 11/27 + ----- +parse.y + - shell_getc: if we are reading input from a string, and we get the + ending '\0', and we are not expanding an alias, return EOF right + away. It might be an eval'ed string that has a syntax error. + Fixes bug reported by Dan Douglas + + 11/28 + ----- +subst.c + - expand_word_internal: if we're expanding a quoted string containing + a tilde as the first character of a word, only expand the tilde if + we're expanding an array subscript (Q_ARRAYSUB), not if we're + expanding any arithmetic expression (Q_ARITH). This fixes a + backwards compatibility issue with expressions like ~0 reported by + Bize Ma + +subst.c + - parameter_brace_expand_indir: if the variable is not special and + the indirect variable is unset (!variable where variable is unset), + report an error. This is a slight incompatibility with previous + versions, which did not differentiate between indirecting an unset + variable and an indirect expansion resulting in an unset variable. + Fixes omission reported by otenba@protonmail.com + + 11/30 + ----- +lib/readline/doc/{rluser.texi,readline.3},doc/bash.1 + - do-uppercase-version: since this doesn't actually exist, replace it + with do-lowercase-version, with the caveat that do-lowercase-version + results in undefined behavior if bound to a character that's + already lowercase. Suggested by Branden Robinson + + +lib/readline/doc/rluser.texi + - history-substring-search-forward: was misspelled as "substr-search"; + ditto for search-backward + +doc/bash.1 + - history-substring-search-{backward,forward}: add documentation, text + straight from readline.3 + +jobs.c + - initialize_job_control: if the terminal's process group is valid, + but the shell is not the foreground process, check for terminating + signals (like SIGHUP, which the kernel would send if the process + group were orphaned) during the loop where we try to stop the shell + if it's not in the foreground. Not a perfect solution; the kernel + might not send SIGHUP + + 12/1 + ---- +jobs.c + - initialize_job_control: only go through the SIGTTIN loop 16 times at + most before deciding we're in the background and probably a member of + an orphaned process group; set original_pgrp to the terminal's pgrp + (so the eventual give_terminal_to doesn't leave the terminal in the + wrong pgrp); and bail on job control initialization + +tests/run-all + - unset SHELLOPTS to avoid its options `polluting' the test + environment. Suggestion from Vladimir Marek + + +tests/execscript + - use $PWD/exec8.sub to protect against someone who has a cd command + in his bashrc. Report from Vladimir Marek + + + 12/2 + ---- +shell.c + - open_shell_script: call end_job_control before exiting the shell in + case we were run as `bash -i script' and there is a problem with + executing `script'. If we don't, the terminal ends up in the wrong + process group. Fix from Clark Wang + + 12/3 + ---- +parse.y + - read_comsub: if we look for a character following a `<' and it's + not `<' (indicating that we don't have to read a here-document), + make sure we push that character back and go through the loop again + so we note the right word start location. Fixes bug reported by + parasite parasite <42parasite@gmail.com> + +subst.c + - parameter_brace_expand_indir: clean up checks for unset variables to + minimize incompatibilities with previous versions + + 12/5 + ---- +lib/readline/history.c + - add_history: don't update history_length until all of the updates to + the_history are complete, so history_length is always consistent. + Report and fix from Hong Cho + +bashline.c + - bash_backward_shellword: fix to work better at the end of the line, + with multiple trailing whitespace characters. Inspired by report + from Kirill Timofeev + +Makefile.in + - bashbug: use `^' as the sed delimiter instead of `%'; some compilers + use `%' in CFLAGS. Report from Vladimir Marek + + + 12/6 + ---- +test.c + - test_unop: make sure op[1] != 0 before testing op[2] + - term: make sure argv[pos][1] != 0 before testing argv[pos][2]. Fixes + oob-read reported by Jerzy Kramarz + + 12/7 + ---- +lib/glob/glob.c + - glob_filename: assign the return value of realloc (results, ...) to + a temp pointer, so if realloc returns NULL, we make sure we free + results. Report from Kirill Timofeev + + 12/12 + ----- +lib/sh/shquote.c + - sh_backslash_quote: if FLAGS&2, backslash-quote other single-byte + characters that are in the current locale's character class + +builtins/printf.def + - printf_builtin: when processing the `%q' format, make sure to + backslash quote all characters by making sure that FLAGS + passed to sh_backslash_quote includes 2. Fixes issue for certain + iso-8859-1 locales where character 160 (octal 240, hex 0xa0) is a + non-breaking space. Report from Stephane Chazelas + + +lib/sh/eaccess.c + - sh_stat: if DEV_FD_STAT_BROKEN is defined, take /dev/fd/N and turn + it into a stat on file descriptor N, as if /dev/fd were not + available. This is the case on some old versions of SunOS. Report + and patch from Dmitry Goncharov + +config.h.in + - DEV_FD_STAT_BROKEN: add define + +configure.ac + - --enable-dev-fd-stat-broken: new command-line option, defines + DEV_FD_STAT_BROKEN if supplied at configure time + +doc/bashref.texi + - --enable-dev-fd-stat-broken: document new command-line option for + configure + +arrayfunc.c + - assoc_expand_once: new variable, declared here just because + +arrayfunc.h + - assoc_expand_once: extern declaration + - AV_NOEXPAND: new flag value for the array_value family of functions: + means to not run associative array subscripts through word expansion + +builtins/set.def + - unset_builtin: call unbind_array_element with assoc_expand_once as + third arg, controls whether we expand associative array subscripts + (if 1, we suppress the usual expansion). With accompanying shopt, + provides backwards compatible option to solve problem with quotes + and other characters in associative array subscripts pointed out + most recently by Mingye Wang (Arthur2e5) + +builtins/shopt.def + - assoc_expand_once: new option, controls value of internal variable + with the same name. Currently undocumented because I'm not completely + sold on the name + +expr.c + - evalexp: now takes a second argument, flags. Changed all callers in + multiple other files (builtins/let.def,execute_cmd.c,arrayfunc.c, + subst.c,test.c,variables.c) + +externs.h + - EXP_EXPANDED, new flag for second argument to evalexp + +builtins/let.def + - let_builtin: add EXP_EXPANDED to flags passed to evalexp + +execute_cmd.c + - execute_arith_command: add EXP_EXPANDED to flags passed to evalexp, + since the command string is run through expand_words_no_vars before + being evaluated + +expr.c + - set expression-global variable already_expanded if flags arg to + evalexp contains EXP_EXPANDED + - if assoc_expand_once option set and already_expanded flag set, pass + 1 in flags to array_variable_part to skip over quotes and expansions + in the subscript + - if those two variables set, pass AV_NOEXPAND as flag to + get_array_value to prevent word expansions on the subscript + +arrayfunc.c + - if flags passed to unbind_array_element includes 1, pass flag on to + skipsubscript so we don't expect matched quotes or process + expansions in the subscript + - if flags to array_value_internal include AV_NOEXPAND, pass 1 as flag + to array_variable_part to pass along to skipsubscript + - if flags to array_value_internal include AV_NOEXPAND, don't call + expand_assignment_string_to_string; just use the unexpanded subscript + to produce the key [THIS IS A WORK IN PROGRESS] + + 12/14 + ----- +subst.h + - ASS_NOEXPAND: assignment flag that inhibits expansion of associative + array subscripts + +variables.c + - bind_int_variable: takes new flags arg; flags are taken from the + ASS_ set of assignment flags, changed callers (bashline.c, expr.c, + pcomplete.c) + - bind_int_variable: if flags includes ASS_NOEXPAND, pass 1 as flag to + valid_array_reference and array_variable_part to pass along to + skipsubscript, so we don't try to skip over quoted strings in the + subscript + - bind_int_variable: pass flags along to assign_array_element + +variables.h + - bind_int_variable: updated extern declaration with new flags arg + +expr.c + - expr_bind_variable: if the assoc_expand_once option is enabled, and + the flags to evalexp indicate that we have already run the expression + through word expansion, pass ASS_NOEXPAND as flag to bind_int_variable + +arrayfunc.c + - assign_array_element: if flags includes ASS_NOEXPAND, pass 1 as flag + to array_variable_name to pass along to skipsubscript + - assign_array_element: if flags includes ASS_NOEXPAND, don't run an + associative array subscript through word expansion, just use as-is + +subst.c + - param_expand: call evalexp with EXP_EXPANDED flag for arithmetic + substitution because the string has already been expanded with + expand_arith_string + + 12/15 + ----- +builtins/read.def + - read_builtin: use value of assoc_expand_once for valid_array_reference + as with other uses + - bind_read_variable: if assoc_expand_once is set, pass ASS_NOEXPAND + to assign_array_element + +general.c + - assignment: instead of checking whether flags == 0 to allow a `[', + explicitly check for (flags&1) to disallow it. This leaves the door + open for additional flag values + +builtins/printf.def + - printf_builtin: use value of assoc_expand_once for + valid_array_reference as with other uses + - bind_printf_variable: if assoc_expand_once is set, pass ASS_NOEXPAND + to assign_array_element + + 12/16 + ----- +builtins/history.def + - change history -d option to handle negative arguments; negative + arguments offset from the end of the history list (last_position + 1 + so history -d -1 deletes the history -d command that just got + added). Original patch from Piotr Grzybowski + +doc/bash.1,lib/readline/doc/hsuser.texi + - documented new behavior of negative offsets for `history -d' + + 12/17 + ----- +lib/readline/history.c + - remove_history: use memmove to move the history list around instead + of a loop that copies pointers one at a time, similar to add_history + + 12/19 + ----- +configure.ac + - linux: make sure PGRP_PIPE is defined unconditionally for all kernel + versions greater than 2.3.* + +lib/readline/history.c + - clear_history: when clearing the history, reset history_base to 1 + (its default) + - remove_history_range: new function, removes a set of history entries + and returns them all for deallocation + +lib/readline/history.h + - remove_history_range: extern declaration + + 12/20 + ----- +execute_cmd.c + - eval_arith_for_expr: pass EXP_EXPANDED to evalexp, since we run the + expression through expand_words_no_vars + + 12/21 + ----- +input.c + - b_fill_buffer: when read returns EOF or error, and we reset the + buffer and pointers, reset the input pointer to 0. Fixes issue + reported by Stephane Chazelas + + 12/22 + ----- +arrayfunc.[ch],subst.c + - array_expand_index: added new FLAGS argument, reserved for future use, + changed callers + + + 12/24 + ----- +variables.c + - can_optimize_assignment,optimized_assignment: see if we can detect + whether or not we're trying to append a string to a string variable, + and optimize that using realloc/strcpy. Based on a log-ago + suggestion from Aharon Robbins + + 12/27 + ----- +builtins/help.def + - help_builtin: don't pass return value from ngettext() directly to + printf + + 12/28 + ----- +sig.c + - set_signal_handler: set SA_RESTART for SIGWINCH, so window size + changes don't interrupt open/read/write. Suggested by + Andriy Prystupa back in 10/2016 + + 12/30 + ----- +execute_cmd.c + - coproc_pidchk: if MULTIPLE_COPROCS, call cpl_search to find coproc + associated with pid, don't remove it from the list with cpl_delete. + Just mark as dead and wait for coproc_reap/cpl_reap to take care + of disposing it + - execute_coproc: NEW FEATURE: run the coproc name through word + expansion before creating the coproc; this allows unique coprocs + to be created in loops. Originally requested way back in 2012 by + Erik Brandsberg + +command.h + - subshell_com: now has a line number member: line + +make_cmd.c + - make_subshell_command: assign current line number (line number of the + ending right paren) to `line' member + +copy_cmd.c + - copy_subshell_command: copy the `line' member + +execute_command.c + - execute_command_internal: when executing a user subshell (`(command)'), + set the line number and line number for the ERR trap from the line + number saved in the subshell command struct. Fix from + Eduardo A. Bustamante López + - execute_arith_command: set line number for ERR trap from line number + saved in the arith command struct. Fix from + Eduardo A. Bustamante López + - execute_cond_command: set line number for ERR trap from line number + saved in the cond command struct. Fix from + Eduardo A. Bustamante López + +variables.c + - bind_variable_internal: move can_optimize_assignment call to the + right place + + 12/31 + ----- +variables.c + - find_variable_nameref: treat a circular variable reference as + referring to a variable of that name in the global scope (for now), + if one exists. PROVISIONAL change: inspired by suggestion back in + 6/2016 by Grisha Levit + + 1/2/2017 + -------- +{expr,general,hashcmd}.c + - include flags.h for flag values + +make_cmd.c + - include shell.h instead of the files it includes + +flags.h + - new extern declarations for want_pending_command, read_from_stdin + +subst.h + - add extern declaration for expanding_redir, assigning_in_environment + +trap.h + - add extern declaration for running_trap + +execute_cmd.h + - added extern declarations for variables declared in execute_cmd.c, + changed files that declare lots of extern variables + +shell.h + - added extern declarations for variables declared in shell.c, + changed files that declare lots of extern variables + +parser.h + - added extern declarations for variables declared in parse.y, + changed files that declare lots of extern variables + +[lots of changes to reduce the number of extern declarations in C and DEF files] + +parse.y + - xparse_dolparen: need ALIAS or DPAREN_ARITHMETIC to be defined to + use STRING_SAVER + + 1/3 + --- +sig.c + - termsig_handler: don't call end_job_control if subshell_environment + indicates that we're in a command or process substitution. + Provisional fix for bug reported by Russell King + +jobs.c + - end_job_control: only attempt to give the terminal back to + original_pgrp if job_control != 0; don't test interactive_shell + +execute_cmd.c + - execute_disk_command: call QUIT after search_for_command, since + the only time QUIT gets called is when the path is actually + searched. It doesn't happen for an absolute pathname. Fix for + bug reported by Russell King + + 1/16 + ---- +lib/glob/glob.c + - extglob_skipname,wextglob_skipname: if we don't find a reason to + not skip the name in any subpattern (r returns 0 for any subpattern), + return 1 because we should skip the name + - extglob_skipname,wextglob_skipname: if we don't find a reason to + not skip the name in any subpattern, but the first part of the extglob + pattern is a wildcard (`*(pat)'), check the rest of the pattern, if + any, to decide whether or not to skip the name. Fixes bug reported + by Grisha Levit + +lib/glob/glob_loop.c + - CHAR -> GCHAR (unsigned char); change uses of CHAR to GCHAR + +lib/glob/glob.c + - wchkname -> wskipname + - wskipname: now takes a third `flags' argument, like the other variants + of skipname + + 1/17 + ---- +redir.c + - here_document_to_fd: set the file descriptor open for writing to the + here document to be close-on-exec. Fixes bug reported by + Siteshwar Vashisht + + 1/18 + ---- +{gmisc,gm_loop}.c + - match_pattern_char,match_pattern_wchar: moved to gm_loop.c (new file), + compile twice for single and wide characters as with the rest of + the functions + - umatchlen,wmatchlen: ditto + - extglob_pattern_p: move to gm_loop.c, generalize for regular and + wide-char versions + + 1/19 + ---- +lib/readline/complete.c + - stat_char: fix small memory leak if stat/lstat returns -1 + +bashline.c + - bash_filename_stat_hook,bash_directory_completion_hook: make sure + expand_prompt_string is caled wth W_NOPROCSUB flag + - directory_exists: don't dequote the filename passed as an argument; + this function should never get quoted pathnames + +subst.c + - expand_word_internal: when calling expand_word_internal recursively + after reading a double-quoted string, make sure the W_NOCOMSUB and + W_NOPROCSUB flags make it to the recursive invocation. Fixes bug + reported by Jens Heyens + + 1/23 + ---- +lib/readline/signals.c + - _rl_orig_sigset: original signal mask, set and restored by + rl_set_signals (rl_clear_signals doesn't block signals). If we + are not installing signal handlers, just save signal mask each + time rl_set_signals is called + +lib/readline/input.c + - rl_getc: use _rl_orig_sigmask in the call to pselect(), so we block + the set of signals originally blocked by the calling application. + Fixes bug reported by Frédéric Brière + +parse.y + - yy_readline_get: try to unset NONBLOCK mode on readline's input + file descriptor before calling readline(). Inspired by report from + Siteshwar Vashisht + + 1/30 + ---- +parse.y + - parse_comsub: don't unconditionally set the LEX_WASDOL flag when we + see a `$'; we should toggle it to accommodate things like $$. + Fixes bug reported by Christian Weisgerber + - parse_matched_pair: do the same thing with LEX_WASDOL + + 2/1 + --- +jobs.h + - JWAIT_PERROR,JWAIT_FORCE: new defines for the wait_for_ family of + functions + +jobs.c + - wait_for_job, wait_for_any_job: take new flags argument for use by + the wait builtin + - wait_for_job: if JWAIT_FORCE flag supplied, loop waiting for job to + terminate instead of change state + - wait_for_single_pid: if JWAIT_FORCE flag supplied, loop waiting for + child process to terminate instead of change state + +builtins/wait.def + - takes a new `-f' option, signifying to wait until the specified job + or process terminates, instead of changes state + +doc/{bash.1,bashref.texi} + - wait: document the new -f option and its behavior when job control + is enabled + - job control: add a paragraph describing how the wait builtin changes + behavior when job control is enabled: it returns when a job changes + state + + 2/2 + --- +examples/loadables/fdflags.c + - fdflags: new loadable builtin to set and unset file descriptor flags + (such as non-blocking, though bash undoes that) for descriptors bash + has open. Developed in consultation with Christos Zoulas + + + 2/3 + --- + +lib/readline/text.c + - rl_previous_screen_line: attempt to move to the same column on the + previous screen line of the current readline buffer by moving back + a number of characters equal to the screen width + - rl_next_screen_line: attempt to move to the same column on the + next screen line of the current readline buffer by moving forward + a number of characters equal to the screen width. Both originally + suggested by Hans Ginzel + +lib/readline/readline.h + - rl_{next,previous}_screen_line: extern declarations + +lib/readline/funmap.c + - {next,previous}-screen-line: new bindable command names + +lib/readline/doc/{rluser.texi,readline.3} + - {next,previous}-screen-line: document behavior, including limitations + + 2/5 + --- +lib/readline/input.c + - rl_read_key: when reading input from a macro, make sure to return + the next character as an unsigned char, so we handle multibyte + character sequences correctly. Report and fix from Grisha Levit + + + 2/6 + --- +shell.c + - --pretty-print: new invocation option, currently undocumented, dumps + a pretty-printed version of a shell script given as an argument to + stdout + - main: call pretty_print_loop() if we're in pretty-printing mode in + a non-interactive shell + +eval.c + - pretty_print_loop: new function, similar to reader_loop, reads + commands and prints them by displaying the result from + make_command_string() + +externs.h + - pretty_print_loop: new extern declaration + + 2/9 + --- +doc/{bash.1,bashref.texi} + - here strings: correct documentation to note they do not undergo + brace expansion. Report from Conor McCarthy + + 2/9 + --- +lib/readline/display.c + - expand_prompt: instead of recomputing the line break offsets for + prompts that span multiple screen lines on every call to rl_redisplay, + do it here. Manage a local array local_prompt_newlines; set an offset + every time `physchars' hits a multiple of the screen width. Inspired + by https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843819 + - rl_redisplay: don't calculate multi-line prompt line break indices + here; use the values calculated by expand_prompt + - rl_{save,restore}_prompt: save and restore local_prompt_newlines + + 2/11 + ---- +lib/readline/mbutil.c + - _rl_find_prev_mbchar_internal: since we're traversing the string + from the beginning, shortcut non-multibyte characters in a UTF-8 + locale + +parse.y + - parse_comsub: if we are parsing a here document with a quoted + delimiter (LEX_QUOTEDDOC), we should not remove + pairs from the body of the here document. Need to add LEX_QUOTEDDOC + to the values in tflags when calling shell_getc. Fixes bug reported + by Michael Homer , patch was originally + contributed by Geir Hauge + + 2/15 + ---- +jobs.c + - bgp_add: if hashed pid collides with bgpids.head index, print a + warning and move to the next index. Attempt to avoid collision + problem reported by Graham Northup + + 2/17 + ---- +subst.c + - process_substitute: call remove_quoted_escapes on the command string + like command substitution does, since the string will be run through + the parser again. Fixes bug reported by David Simmons + + +config-top.h + - STATIC_PATH_VALUE: new config variable, undefined by default + +variables.c + - shell_initialize: if STATIC_PATH_VALUE is defined, use it to set the + PATH variable at shell startup, overriding the environment and any + value for DEFAULT_PATH_VALUE. Based on a suggestion from + Lonnie Abelbeck + + 2/18 + ---- +shell.c + - maybe_make_restricted: clear the hash table before making the PATH + variable read-only by calling stupidly_hack_special_variables. + Suggestion from Lonnie Abelbeck + +subst.c + - expand_string_for_pat: change expansion of WORD in ${param[%[%]][#[#]]word} + to use this new function, initially identical to + expand_string_for_rhs + - getpattern: use expand_string_for_pat to expand the pattern + + 2/19 + ---- +subst.c + - expand_string_for_rhs: now that this is only used to expand the RHS + of the various non-pattern ${paramOPword} expansions, set + expand_no_split_dollar_star depending on whether or not the entire + brace expansion is going to be subjected to word splitting: if it's + quoted or if IFS is set but null, we will not be splitting so we set + this to 1 and let $* expand to separate fields separated by a space. + This was heavily debated back in October 2014 and resulted in Posix + interp 888. Reported by Martijn Dekker + + 2/20 + ---- +subst.c + - expand_string_for_rhs: now takes `op' (brace expansion operator) as + an additional argument; changed call in parameter_brace_expand_rhs + - expand_string_for_rhs: make sure to set expand_no_split_dollar_star + if `op' is `=', since we are supposed to preserve the assignment + statement expansion semantics on the RHS of ${param=word} + +jobs.c + - bgp_delindex: make sure to set ps->pid to NO_PID so we more + effectively remove it from the hash table. It shouldn't matter as + long as nothing in pidstat_table points to it, but better to be safe + - bgp_delete,bgp_search: generalize previous collision detection to + loop detection: abort search if we are going to go back to the + first index we tried + + 2/21 + ---- +lib/readline/vi_mode.c + - rl_vi_bword: if we're trying to move backward to non-whitespace + in a line that begins with whitespace, make sure we don't move + point to 0 and test memory locations before the start of the + buffer. Report and fix from Jason Hood + +lib/readline/display.c + - expand_prompt: if _rl_screenwith == 0, call rl_reset_screen_size to + initialize it. If it's still 0 after that, guess that the screen + width is 80 and use that to guess how many screen lines the prompt + consumes + +lib/readline/readline.c + - readline_internal_setup: if in emacs editing mode, and we are + showing the editing mode in the prompt, call _rl_reset_prompt() to + make sure that the updated setting of _rl_show_mode_in_prompt + (presumably set in an inputrc file) is reflected in the redisplay + performed by rl_callback_newline via readline_internal_setup. + Fix from Jason Hood + + 2/22 + ---- +builtins/complete.def + - print_one_completion,print_compopts: make sure to display the + `nosort' and `noquote' options if they've been set for a particular + compspec. Fix from Grisha Levit + +builtins/read.def + - read_builtin: if -e is supplied, read needs to free rlbuf before + returning, since it uses discard_unwind_frame at that point. Bug + and fix from ZhangXiao + +execute_cmd.c + - execute_for_command: when using a nameref as the for loop control + variable, make sure we check for readonly namerefs and make sure + that we force bind_variable to enforce restrictions on nameref + assignments. Fix from Grisha Levit + + 2/23 + ---- +general.c + - make_absolute: convert deprecated cygwin_conv_to_full_posix_path + to cygwin_conv_path (CCP_WIN_A_TO_POSIX, ...) + +{shell,variables}.c,config-top.h + - modify change from 2/17: rename STATIC_PATH_VALUE to RBASH_STATIC_PATH_VALUE; + don't use it in shell_initialize; set PATH to it just before + imposing restricted shell restrictions + + 2/24 + ---- +subst.c + - expand_string_for_rhs: revert change from 2/19 concerning setting + expand_no_split_dollar_star so we are consistent with the Posix + examples. This anticipates Martijn Dekker initiating an austin + group discussion about this case + + 2/25 + ---- +pcomplete.c + - gen_shell_function_matches: if COMPREPLY is an associative array, + don't coerce it to an indexed array, which will fail to produce any + matches anyway. Report from Grisha Levit + - bind_comp_words: if COMP_WORDS exists as a nameref variable, ignore + the nameref attribute. Report from Grisha Levit + + +subst.c + - parameter_brace_expand: if expand_no_split_dollar_star is set, make + sure chk_atstar treats ${var[*]} as quoted by passing Q_DOUBLE_QUOTES + as the second argument. Fixes differing treatment of $* and ${v[*]} + reported by Grisha Levit , because otherwise + *contains_dollar_at gets set to 1 and the word is inappropriately + split + + 3/1 + --- +subst.c + - expand_word_list_internal: if a variable assignment fails (e.g., due + to a readonly variable) in a non-interactive posix mode shell, don't + abort the shell if the assignment is being performed by the command + builtin, even if it's something like `command eval v=1'. Fixes + RedHat bug https://bugzilla.redhat.com/show_bug.cgi?id=1389838 + (reported by Denys Vlasenko) + + 3/3 + --- +builtins/shopt.def + - set_compatibility_level: make sure that changing the compatibility + level sets or modifies BASH_COMPAT. Fixes bug reported by + Stephane Chazelas + +lib/glob/smatch.c + - is_cclass: broke into two functions: is_valid_cclass and cclass_test, + for future expansion. No functionality change + +lib/glob/sm_loop.c + - BRACKMATCH: when testing a character against a character class name, + use the unfolded (original) character, since we're not performing a + comparison. This is what glibc does. Fixes bug reported by + Lukáš BaÅinka + + 3/4 + --- +doc/{bash.1,bashref.texi} + - note that the arguments to -eq and the rest of the arithmetic + operators are evaluated as expressions when using [[. Report from + Rob la Lau + + + 3/7 + --- +lib/readline/display.c + - update_line: completely rewrote the code that handles line wrapping + in the presence of multibyte/double-width characters; punts to a + dumb update in cases where the number of screen positions doesn't + match + - update_line: in one case, where we are deleting characters from the + line, if we are writing a non-space into the last screen character + position, note that we are no longer using a space as a placeholder + for a line wrap where there is a multi-width character that won't + fit on the screen line (wrapped_line[current_line+1] = 0) + + 3/10 + ---- +lib/readline/readline.c + - bind_arrow_keys_internal: add default key bindings for control- + arrow keys, suggested by Per Bothner + + 3/13 + ---- +doc/{bash.1,bashref.texi} + - clarify the prompt strings the undergo expansion (PS0, PS1, PS2, and + PS4) before being displayed. Based on a report from Grisha Levit + + + 3/14 + ---- +input.c + - bufstream_ungetc: return EOF if being asked to unget a character to + a NULL buffer + - buffered_getchar: check buffered_fd is valid and buffers[buffered_fd] + is non-NULL before trying to dereference. Fixes bug reported by + floyd + +execute_cmd.c + - execute_null_command: if we fork to execute the command, the subshell + is not interactive + - execute_null_command: for safety's sake, if a redirection attached + to a null command affects fd 0 or the fd the shell is reading for + input, and the redirection can potentially change or close that file + descriptor, force a fork so the redirection is done in a subshell + + 3/15 + ---- +lib/readline/display.c + - update_line: if we have to output some bytes, and we are outputting + the prompt string, make sure we correct _rl_last_c_pos if we are + at the wrap offset -- what if all of the characters in the prompt + are invisible, so the visible length is 0? Fixes display bug + reported by Grisha Levit + +execute_cmd.c + - undo_partial_redirects: new function, performs redirections specified + in redirection_undo_list and disposes of them. Intended to be used + to unwind redirections performed before a redirection error + - dispose_partial_redirects: new function, disposes of + redirection_undo_list and nulls the list + - execute_command_internal: use undo_partial_redirects + +execute_cmd.h + - undo_partial_redirects: extern declaration + - dispose_partial_redirects: extern declaration + +subst.c + - exp_jump_to_top_level: if we are throwing an expansion error while + expanding a redirection (expanding_redir != 0), undo any undoable + redirections by calling undo_partial_redirects() so we don't leave + any in place + +variables.c + - initialize_shell_variables: if SHELLOPTS is in the environment, + unset the readonly attribute on any existing variable with that + name. It may have been created by processing a -o option on the + command line. Fixes issue reported by Stephane Chazelas + + + 3/16 + ---- +lib/readline/histfile.c + - read_history_range: short-circuit and do nothing if the history file + is of 0 size + - read_history_range: make sure the buffer is zero-terminated so the + timestamp tests work right for history files of 1 character. Report + and recommended fix from Denis Martinez + +lib/readline/complete.c + - compute_lcd_of_matches: when trying to compute the common prefix + of a set of matches while performing case-insensitive completion + matching, don't sort the match list unless rl_sort_completion_matches + is non-zero. Fixes problem reported by Roee Bar + + 3/18 + ---- +subst.c + - extract_dollar_brace_string: handle process substitution embedded in + a ${...} expansion in the same way as command substitution. Reported + by D630 + +parse.y + - LEX_GTLT: new flag, set by parse_matched_pair when a `<' or '>' is + read + - parse_matched_pair: handle an embedded process substitution like an + embedded command substitution if we are parsing an array index or + a dollar-brace expansion. Reported by D630 + + 3/21 + ---- +subst.h + - ASS_NOEVAL, ASS_NOLONGJMP: new values for assignments, used by + make_variable_value + +variables.c + - make_variable_value: ASS_NOEVAL: if this is set, don't attempt + arithmetic evaluation or case modification, just produce the value + (still honor ASS_APPEND) + - make_variable_value: ASS_NOLONGJMP: don't longjmp back to top_level + if arithmetic evaluation fails due to a syntax error + - bind_variable_internal: make sure aflags is passed to all calls to + make_variable_value + - push_temp_var: add ASS_NOLONGJMP to the flags passed to + bind_variable_internal. Fixes bug reported by D630 + +bashline.c + - bash_execute_unix_command: don't bother to attempt optimization by + checking whether the call to parse_and_execute changes $READLINE_LINE; + it can be defeated by the new code that optimizes appends to string + variables. Bug reported by Grisha Levit + + 3/22 + ---- +subst.c + - expand_string_for_rhs: re-apply change from 2/19 based on discussion + on the austin-group mailing list about how unquoted ${var-$*} + expands when IFS is null. Originally reported by Martijn Dekker + + + 3/25 + ---- +parse.y + - read_token_word: if we read a WORD immediately after a CASE, FOR, or + SELECT, increment `expecting_in_token' to note that we're going to + be reading IN as the next non-newline token + - special_case_tokens: if we're expecting an IN (expecting_in_token > 0) + and we have an "in", return IN and decrement expecting_in_token. This + is a better implementation of Posix grammar rule 6 than the previous + code in that function (which is still there for posterity, but should + eventually be removed). Fixes bug reported by Torka Noda + + +subst.c + - string_list_pos_params: if the expansion is not quoted, and IFS is + null, return a string containing the quoted positional parameters + separated by spaces. Callers know what to do with the string + - parameter_brace_substring,parameter_brace_remove_pattern, + parameter_brace_transform,parameter_brace_patsub,parameter_brace_casemod: + for the VT_POSPARMS case, after calling the operator-specific + expansion function, which eventually calls string_list_pos_params, + leave the returned string alone, since it's already quoted properly + - parameter_brace_expand: after calling the above functions to perform + expansions, if the expansion is being performed on an unquoted $* + when IFS is null, set the W_SPLITSPACE flag in the return WORD_DESC + so that splitting on spaces is performed on the already-quoted word. + Fixes bug reported by Grisha Levit + + 3/28 + ---- +subst.c + - process_substitute: change so the subshell doesn't inherit the 'v' + option, like command substitution now does (as of bash-4.4). + Suggested by Grisha Levit + + 3/30 + ---- +subst.c + - parameter_brace_casemod: now takes a pflags parameter, like + parameter_brace_patsub; changed callers + - parameter_brace_transform: now takes a pflags parameter, like + parameter_brace_patsub; changed callers + - pos_params_pat_subst,pos_params_modcase: if mflags indicates we're + on the rhs of an assignment statement and not going to perform + word splitting, we're expanding $*, and $IFS is null, make sure + string_list_pos_params treats the expansion as double-quoted, so + the positional parameters will be concatenated. Fixes bug reported + by Grisha Levit + + 3/31 + ---- +doc/{bash.1,bashref.texi} + - add notes to the description of pipelines emphasizing that each + element of a pipeline is executed in a subshell, referring to the + description of a command execution environment, and that the + lastpipe option can modify that behavior. From a discussion with + Jean Delvare + + 4/1 + --- +subst.c + - expand_word_internal: set had_quoted_null to note for later if we + expand '', "", or "$x" when x is unset + - expand_word_internal: if we expand "$param" (or "${param}") and we + come back with a single word with the W_HAVEQUOTEDNULL flag set, + make sure we set had_quoted_null to remember it for later. In this + case, if we already have seen a quoted null and we expanded $@ in + this (sub)string expansion, we don't want to do any of the special + $@ handling. In particular, we don't want to set *expanded_something, + because that will result in word splitting and quoted null removal. + Fixes bug reported by Grisha Levit + - parameter_brace_patsub: when expanding ${*/pat/sub} in the case + where ifs_is_null != 0 and (pflags & PF_NOSPLIT2) (meaning we aren't + going to be doing word splitting), pass MATCH_ASSIGNRHS so we do + the right thing in this case. Part of a set of cases inspired by + Grisha Levit + - param_expand: case '*': if we are on the rhs of an assignment + (PF_ASSIGNRHS) and ifs is unset, and $1 == " ", we need to make sure + string_list_dollar_at gets called with Q_DOUBLE_QUOTES so it quotes + the positional parameters before joining them into a string with + string_list_internal. Otherwise, that first space gets removed by + the implicit word splitting that gets performed. Reported by + Grisha Levit + +array.c + - array_patsub,array_modcase: handle ${A[*]} identically to $* when + not quoted and IFS is null (separate with spaces). Makes things + like ${A[*]/x/y} behave the same as ${*/x/y} when IFS is null + +subst.c + - parameter_brace_patsub,parameter_brace_casemod: if expanding ${A[*]} + when the match is on the rhs of an assignment statement (PF_ASSIGNRHS) + and ifs is null, make sure the match is performed as if it were + quoted + - parameter_brace_substring: now takes a PFLAGS argument + - parameter_brace_substring: if expanding $* in a context where we + don't want to do word splitting (expand_no_split_dollar_star && + PF_NOSPLIT2), make sure we expand $* as if it were quoted + - parameter_brace_substring: if expanding an unquoted $* on the rhs of + an assignment statement when IFS is null, make sure we expand the $* + as if it were quoted + + 4/4 + --- +doc/{bash.1,bashref.texi} + - read: document that a delim argument of '' terminates each line when + a NUL character appears + + 4/5 + --- +subst.c + - parameter_brace_expand_word: handle case where unquoted $@ is + expanded in a context where word splitting is not performed (PF_NOSPLIT2) + and IFS is not equal to the standard value + - param_expand: handle case where unquoted $@ is expanded in a context + where word splitting is not performed (PF_NOSPLIT2) and IFS is not + equal to the standard value. Fixes bug with IFS == $1 when expanding + unquoted $@ reported by Grisha Levit + + 4/7 + --- +subst.c + - pos_params_pat_subst: if MATCH_ASSIGNRHS is set, don't expand $* + as quoted unless expand_no_split_dollar_star is also set. Fixes + expansion bug reported on 4/4 by Grisha Levit + - parameter_brace_transform: if we transform unquoted A[@] or A[*] + when IFS is null, don't quote the result of array_transform in the + same way we don't quote the result of parameter_list_transform, + since it will come back quoted. Fixes bug reported by + Grisha Levit + - list_transform: if we transform unquoted $* or ${a[*]} when IFS is + null and expand_no_split_dollar_star is non-zero, call + string_list_pos_params with Q_DOUBLE_QUOTES to inhibit splitting. + We do this in all cases except @Q, which is inconsistent but more + intuitive. + Fixes bug reported by Grisha Levit + + 4/8 + --- +builtins/read.def + - read_mbchar: if unbuffered == 2, we are running read -N and need to + use zreadn to read the rest of the multibyte char, since the + previous call to zreadn may have buffered characters. Fixes bug + reported by Stephane Chazelas + +pathexp.h + - QGLOB_CTLESC: new flag for quote_string_for_globbing: means to turn + CTLESC CTLESC (quoted CTLESC that's usually removed as part of + word splitting or quote removal) into CTLESC + +pathexp.c + - quote_string_for_globbing: if QGLOB_CTLESC is present in flags, + turn CTLESC CTLESC into CTLESC, even if the first CTLESC is preceded + by a backslash. Callers can't do this because the remaining CTLESC + will be treated as a quoting character and turned into a backslash + +execute_cmd.c + - execute_case_command: if the pattern is not quoted, make sure to tell + quote_string_for_globbing to turn CTLESC CTLESC into CTLESC by + passing QGLOB_CTLESC. Fixes bug reported 4/2 by Martijn Dekker + + + 4/9 + --- +subst.c + - string_transform: after calling ansiexpand for the `E' transformation, + need to call dequote_escapes because ansiexpand assumes it is being + called by the parser and arranges for ansicstr to quote CTLESC and + CTLNUL with CTLESC. Reported by Grisha Levit + +variables.c + - mk_env_string: when exporting functions, run them through + dequote_escapes because any strings containing CTLESC or CTLNUL are + still quoted with CTLESC. Reported by Grisha Levit + + +subst.[ch] + - quote_escapes,dequote_escapes: now take const char * argument + +execute_cmd.c + - execute_intern_function: if the function name contains CTLESC, run + it through dequote_escapes just in case it got CTLESC quoting + CTLESC or CTLNUL from the parser + + 4/11 + ---- +eval.c + - reader_loop: make sure PS0 is expanded and displayed before + incrementing the command number + +parse.y + - prompt_history_number: function to make history number as reported + by \!, or posix mode !!, be the same index that the (possibly multi- + line) command will be stored with. The history library increments + history_offset as soon as a new line is entered, and it's up to the + history code to store the second and subsequent lines of a command + in the same history entry. If we are expanding PS0 or PS4, or + a ${var@P} expansion, we're already past the history entry no + matter what. Inspired by patch from Grisha Levit + + - decode_prompt_string: call prompt_history_number + - decode_prompt_string: if expanding PS4 or ${var@P}, make the + command number the same as reported by PS0/PS1/PS2 + + 4/12 + ---- +support/Makefile.in + - clean: remove man2html.o as part of this production instead of + waiting until `distclean'. Reported by chrlis + +subst.c + - string_list_pos_params: if we are expanding $* in a context where + IFS is null and expand_no_split_dollar_star is set (no word + splitting), use string_list_dollar_star to force the positional + parameters to be joined without first separating them into a list + and attempting to join them later. Fixes problem with constructs + like ${var=${*:1}}, pointed out by Grisha Levit + . This undoes change to @Q from 4/7, so + list_transform change reverted + + 4/19 + ---- +builtins.h + - added BUILTINS_H include guard + +examples/loadables/Makefile.in + - install loadables.h as sample include file, along with Makefile.inc + + 4/23 + ---- +bashline.c + - maybe_make_readline_line: don't try to do anything if the passed + NEW_LINE is NULL. Report from Jaren Stangret , + fix from Eduardo Bustamante + + 4/24 + ---- +parse.y + - xparse_dolparen: if the current token (the last thing read_token + returned to yylex) is shell_eof_token, assume that it is the new + bison lookahead token and clear it. Fixes bug reported by + Werner Fink + + 4/25 + ---- +doc/{bash.1,bashref.texi} + - cmdhist: clarify that this option only has an effect if history is + enabled. Suggested by Matthew Braun + + 4/26 + ---- +jobs.c + - wait_for: if a non-interactive shell with job control enabled (set -m) + detects that a foreground job died due to SIGINT, act as if the shell + also received the SIGINT. Prompted by an austin-group-l discussion + - waitchld: run SIGCHLD trap for each child exited even if job control + is not enabled when in Posix mode. Prompted by an austin-group-l + discussion + + 4/27 + ---- +lib/readline/histfile.c + - read_history_range: if the history file is empty, free the history + filename before returning. Report and fix from Eduardo Bustamante + + +lib/readline/bind.c + - rl_parse_and_bind: make sure there is something, even if it's a + quoted empty string, before the `:' in a key binding. Report from + Eduardo Bustamante + - rl_parse_and_bind: if the right side of a key binding starts with a + quote, make sure there's a matching close quote before treating it + as a macro definition + - rl_translate_keyseq: if a key sequence ends with \C- or \M- (or + \C-\M-) make sure we break out of the loop if moving to the character + to be translated is a NUL. Old code did this only in the \C-\M- + case. Report from Eduardo Bustamante + + 4/28 + ---- +lib/glob/sm_loop.c + - GMATCH: implement a clever technique from glibc that avoids + backtracking past a `*' if we've already chosen to use it and need + matches beyond it. Look at https://research.swtch.com/glob for a + longer explanation. This results in a significant speedup for globs + with multiple instances of `*', especially with more than 4. + + 5/2 + --- +lib/readline/bind.c + - rl_translate_keyseq: make sure a trailing backslash in the key + sequence is preserved. Report from Eduardo Bustamante + + + 5/3 + --- +builtins/builtin.def + - builtin_builtin: make sure to set this_shell_builtin to the builtin + command being executed, overwriting `builtin'. Leave + last_shell_builtin alone. Fixes bug reported by Luiz Angelo Daros + de Luca + +jobs.c + - waitchld: modify change of 4/26 to run SIGCHLD traps even if job + control is not enabled + +lib/readline/misc.c + - rl_get_previous_history: if we didn't find a previous history entry + to use, call rl_maybe_unsave_line before returning because we + aren't going to use the saved line, and it has the same undo list + as rl_undo_list. Fixes fuzzing bug reported by Eduardo Bustamante + + - rl_get_{next,previous}_history: if there is no history list, don't + bother doing anything + + 5/4 + --- +expr.c + - popexp: if we error out due to stack underflow, make sure to zero out + expression and lasttp; they may contain undefined values we don't + want evalerror to print + - expr_unwind: handle expr_depth decrementing below zero + - evalexp: restore the old value of evalbuf even if we error and + longjmp; we may have called evalexp recursively + - evalerror: make sure expression is non-NULL before trying to print it. + These fix fuzzing bug reported by Eduardo Bustamante + , happens only in cases where we don't longjmp on + a fatal expansion error + + 5/5 + --- +parse.y + - read_token_word: when checking for a word that's a target of a + redirection, we can potentially call valid_array_reference, which + can end up calling the parser recursively. If it does that, we + need to make sure that yylval.word doesn't change, so we set it back + to the_word. Fixes another fuzzing bug + +parse.y + - arith_for_command: make syntax errors in the arithmetic for command + (signaled by make_arith_for_command returning NULL) more like + language syntax errors by calling YYERROR. Avoids complicated + attempts at error recovery and dealing with NULL returns from + command productions. Pointed out by Eduardo Bustamante + + +lib/readline/kill.c + - _rl_copy_to_kill_ring: make sure the current slot in the kill ring + has something in it, even if the last command was a kill, before + trying to modify it. Another fuzzing bug + + 5/6 + --- +builtins/read.def + - read_builtin: if we see a backslash when not in raw mode (not -r), + only back up `i' when we read the next character if we know we added + a CTLESC the last time through the loop (skip_ctlesc == 0), + especially if i == 0. Another fuzzing bug from Eduardo Bustamante + + + 5/8 + --- +builtins/read.def + - read_mbchar: handle zreadn/zreadc/zread returning EOF in the middle + of an incomplete multibyte sequence. Fixes another fuzzing bug + - read_builtin: use mb_cur_max instead of constant 4 when deciding + whether the next character can exceed the number of bytes available + in input_string + +lib/readline/input.c + - MinGW: include before . Fix from Eli Zaretskii + + +builtins/read.def + - read_builtin: if we get input from readline, we need to get the + remainder of a multibyte character from rlbuf instead of calling + read_mbchar. Bug reported by Eduardo Bustamante + + 5/9 + --- +parse.y + - token_is_assignment: use the allocated buffer approach in all cases, + not just if we're not using bash malloc. This avoids the assignment + to t[i+1] writing beyond the end of the allocated token if + i == token_buffer_size - 1. Another fuzzing bug + - xparse_dolparen: if parse_string returns < 0, we clear out the + current shell_input_line before performing a longjmp, since we're + abandoning parsing of this command. This is consistent with how + the parser resynchronizes after other syntax errors + - GRAMMAR: add 'error yacc_EOF' production to handle a syntax error + that's immediately followed by an EOF after resynchronization. + Fixes another fuzzing bug + + 5/10 + ---- +lib/readline/text.c + - _rl_set_mark_at_pos: don't let the mark be set to a position < 0. + Fixes a fuzzing bug + - rl_exchange_point_and_mark: don't do anything if the mark is already + less than 0 + + 5/12 + ---- +lib/readline/rlmbutil.h + - wchar_t: make sure this is defined as int if multibyte characters + aren't supported + +lib/readline/text.c + - _rl_change_case: don't force use of ascii toupper and tolower if + isascii returns true; it's not defined to work on characters outside + the 0..255 (really 0..127) range. Bug reported by + Eduardo Bustamante + + 5/14 + ---- +lib/readline/text.c + - rl_change_case: handle case where the old and new characters (after + the case change) are not the same number of bytes. Pointed out in + http://lists.gnu.org/archive/html/bug-bash/2015-01/msg00091.html + +lib/readline/display.c + - expand_prompt: use `ret' as first parameter to _rl_find_prev_mbchar + since that needs the base of the array. Bug from fuzzing reported by + Eduardo Bustamante + + 5/15 + ---- +execute_cmd.c + - execute_simple_command, execute_arith_command, execute_cond_command, + execute_arith_for_command: adjust the line number when executing a + function interactively so that the first command in the function is + line 1, not line 0, as Posix requires. Reported by Robert Elz + + - execute_simple_command, execute_arith_command, execute_cond_command, + execute_arith_for_command: ony adjust the line number when executing + a function interactively if we are not sourcing a file + (sourcelevel == 0), so this is consistent everywhere we adjust the + line number + + 5/16 + ---- +bashline.c + - bash_directory_completion_hook: when calling split_at_delims to see + whether a ${ or $( is closed, use the right value for `start' relative + to the substring beginning at `$'. Bug from fuzzing reported by + Eduardo Bustamante + +expr.c + - expassign: if the call to expcond generates a syntax error in a + context when the shell won't longjmp (like when evaluating $PS1), + it will end up NULL and we need to catch it before calling strlen. + Bug from fuzzing reported by Eduardo Bustamante + +examples/bash-completion/ + - new place to include a current or recent version of the + bash-completion package + + 5/19 + ---- +lib/readline/display.c + - CHECK_INV_LBREAKS: new versions for multibyte and single-byte chars, + so the multibyte version can check and increase the size of + line_state_invisible->wbsize and line_state_invisible->wrapped_line, + callers who call CHECK_INV_LBREAKS must update + wrapped_line[newlines] when in HANDLE_MULTIBYTE mode. Fuzzing bug + reported by Eduardo Bustamante + + 5/24 + ---- +lib/readline/search.c + - _rl_nsearch_callback,noninc_search: handle _rl_search_getchar + returning -1 (EOF or read error) by aborting the search. + Fuzzing bug reported by Eduardo Bustamante + + 5/25 + ---- +variables.c + - localvar_inherit: new variable, controlled by shopt localvar_inherit + option + - make_local_variable: if localvar_inherit is set, the new local + variable inherits a previous scope's variable's value, attributes + (except nameref), and dynamic variable information. If a local + variable inherits a value, the local is not invisible + +builtins/shopt.def + - localvar_inherit: new option + +doc/{bash.1,bashref.texi} + - localvar_inherit: document new shopt option + + 5/29 + ---- +lib/readline/readline.c + - _rl_subseq_result: only return -1 and back up the chain if we are + dealing with a result (r) that's already < 0 and we are at the end + of a multi-key sequence. Otherwise, a failing readline command (e.g., + delete-char at the end of a line) could cause this code to be + executed. Report from Nuzhna Pomoshch + +lib/readline/histfile.c + - read_history_range: if the file isn't a regular file, return an + error. Bug report from Eduardo Bustamante , + relaying from IRC + + 5/30 + ---- +variables.c + - set_pwd: if in Posix mode, and PWD appears in initial environment as + an absolute pathname to the current directory, set PWD to the result + of canonicalizing the environment value, or to the physical path if + canonicalization fails. From a suggestion by Eduardo Bustamante + + + 5/31 + ---- +builtins/read.def + - read_builtin: if -n or -N option is supplied with a 0 argument, + don't attempt to read any characters; bail out right away. Reported + by Eduardo Bustamante , relaying from IRC + + 6/3 + --- +config.h.in + - HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC: add define, used by stat-time.h + to construct a timespec from struct stat. Report and fix from + Siteshwar Vashisht + +variables.h + - att_regenerate: new internal variable attribute: if set, regenerate + dynamic variable's value when it's exported and we are creating the + export environment + +variables.c + - init_dynamic_variables: LINENO, EPOCHSECONDS, EPOCHREALTIME: set + internal regenerate attribute for these dynamic variables + - make_env_array_from_var_list: if a dynamic variable has the + regenerate attribute set, call the dynamic value function to generate + an updated value before placing it in the environment. From a report + about exporting LINENO from Robert Elz + + 6/4 + --- +lib/glob/sm_loop.c + - BRACKMATCH: at the matched: label, make sure we get the bracket + character we're looking for (char class, collating symbol. etc.) + before we decrement the count of braces we're looking for. Eventually + we could do something about badly-formed bracket expressions + + 6/7 + --- +lib/readline/histlib.h + - strchr: only declare if __STDC__ is not defined, since we already + include . Report from Chi-Hsuan Yen + + 6/9 + --- +lib/readline/display.c + - update_line: when wrapping lines with multibyte chars at the end of + the new line being wrapped, make sure we copy the NULL byte in old + when moving the contents of old around. Fuzzing bug reported by + Eduardo Bustamante + +lib/readline/mbutil.c + - _rl_get_char_len: use MB_CUR_MAX in the call to mbrlen; there's no + need to look at the rest of the string when we're just interested in + the length of a single character + + 6/12 + ---- +jobs.c + - wait_for: when waiting for the next child to exit (ANY_PID), make + sure to restore the old SIGINT handler before returning. Fixes + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864649 + + 6/14 + ---- +lib/readline/display.c + - expand_prompt: make sure `ret' is NULL-terminated before calling + _rl_prev_mbchar_internal, since that calls strlen, which requires + the passed string to be NULL-terminated. Another fuzzing bug. + + 6/15 + ---- +lib/readline/isearch.c + - _rl_isearch_fini: use rl_replace_line instead of strcpy so rl_end + gets set right + - _rl_isearch_fini: after restoring rl_point, call _rl_fix_point so + we don't set rl_point > rl_end. Fixes a fuzzing bug + +lib/readline/mbutil.c + - _rl_find_next_mbchar_internal: if _rl_adjust_point returns < 0, + just punt, treat the value as a byte, and advance point by 1 + +lib/readline/util.c + - rl_tilde_expand: rearrange code in the whitespace loop so that + `start' gets tested first and we don't try to dereference + rl_line_buffer[-1]. Another fuzzing bug from dualbus@gmail.com + +bashline.c + - bash_dequote_filename: make sure that pointers that are used as + indices into sh_syntaxtab are cast to unsigned char first, to + avoid problems with signed chars > 128. Fixes a fuzzing bug. + +lib/readline/kill.c + - _rl_copy_to_kill_ring: when reallocating the kill ring, make sure to + allocate one more than the max number of kills so the loop that + copies the kill ring entries down runs right (and to mirror the + initial allocation). Fixes a fuzzing bug. + +lib/readline/isearch.c + - _rl_isearch_dispatch: make sure that cxt->sline_index never goes < 0 + even when searching a line in reverse. Fixes a fuzzing bug + + 6/16 + ---- +parse.y + - xparse_dolparen: short-circuit immediately if passed a empty string + +lib/readline/display.c + - update_line: when wrapping multibyte characters, make sure we deal + with WCWIDTH returning -1. Fixes a fuzzing bug + + 6/17 + ---- +execute_cmd.c + - execute_coproc: make sure `invert' is set before trying to use it + when returning failure on invalid coproc name. Report and fix from + Eduardo Bustamante + - execute_command_internal: make sure execute_coproc sets + last_command_exit_value if it returns failure, so an invalid name + can set $? = 1. Report and fix from Eduardo Bustamante + + +lib/readline/display.c + - update_line: make sure all references to `wrapped_line' are wrapped + with #ifdef HANDLE_MULTIBYTE. Report and fix from Eduardo Bustamante + + +lib/readline/vi_mode.c + - _rl_vi_change_char: don't use rl_point++ when you mean to move + forward a character; use _rl_vi_append_forward to account for + multibyte characters and take vi end of line handling into account + - _rl_vi_last_replacement: now an array of chars whether we are + using multibyte chars or not. If we're not, the character we read + to use as the replacement is saved as the first element of the array + - rl_vi_change_char,_rl_vi_callback_change_char: changes to deal with + _rl_vi_last_replacement being an array. Fixes bug reported by + Eduardo Bustamante + +lib/readline/mbutil.c + - _rl_get_char_len: look at at most MB_CUR_MAX characters, but maybe + fewer if the length of the string is less + +builtins/bind.def + - unbind_keyseq: new function for the -r option; checks whether the + key sequence is actually bound before trying to bind it to NULL. + Partial fix for https://savannah.gnu.org/support/?109329 + +parse.y + - augment `error yacc_EOF' production to call YYABORT in non-interactive + shells or calls to parse_and_execute (eval, command substitution, + etc.) Fixes bug reported by Martijn Dekker + + 6/19 + ---- +bashline.c + - edit_and_execute_command: don't add rl_line_buffer to the history + list if it's empty; consistent with how other code treats an empty + line + +execute_cmd.c + - execute_builtin: make sure to preserve the temporary env across the + execution of the `read' builtin or `fc' builtin if HISTORY is + defined, in case `read -e' calls edit-and-execute-command. Should + have no side effects. Reported by Eduardo Bustamante + + +general.c + - line_isblank: new function: returns true if passed string is composed + entirely of blanks + +general.h + - line_isblank: new extern declaration + +parse.y + - history_delimiting_chars: return "" for a blank line, since there's + nothing to delimit with `;' + + 6/21 + ---- +jobs.c + - wait_for: make sure to call restore_sigint_handler before returning + if we return out of the loop due to no children. Report from + Eduardo Bustamante + +subst.c + - expand_word_internal: if split_on_spaces is set, and the word is + unquoted, and IFS is null, split the results of the previous steps + on $' \t\n' instead of just ' '. This relies on the previous steps + quoting the portions of the word that should not be split. Fixes + bug reported by Kevin Brodsky + +expr.c + - evalexp: after running expr_unwind, make sure we reset expr_depth + to 0 for the next call + - expr_streval: if after a call to get_array_value (which can call + the expression evaluator recursively) we discover that expr_depth + is less than it was before we called it, we assume there has been + some kind of error and an expr_unwind, so we treat it as an + error and either longjmp back to the expression top level or return + 0 immediately. Fixes bug reported by Eduardo Bustamante + + + 6/23 + ---- +doc/{bash.1,bashref.texi} + - add text noting that $* and ${array[*]} (unquoted) can also expand + to multiple words + + 6/29 + ---- +general.[ch] + - default_columns: new function, returns the value of COLUMNS, or + refreshes it if check_window_size is set and COLUMNS is unset. By + default, it returns 80 + +execute_cmd.c + - select_query: use default_columns() instead of fetching value of + COLUMNS directly + +builtins/help.def + - show_builtin_command_help: use default_columns() instead of fetching + value of COLUMNS directly + + 6/30 + ---- +builtins/read.def + - read_builtin: call QUIT during the read loop, just in case we get a + signal we should act on that didn't cause read to be interrupted. + Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1466737 + - read_builtin: if -n or -N is supplied with a 0 argument, try a zero- + length read to detect errors and return failure if that read returns + a value < 0. Suggested by dualbus@gmail.com + + 7/4 + --- +bashhist.c + - maybe_add_history: keep track of whether the current line is a shell + comment, even if we're not adding it because it's in a multi-line + command, so we use appropriate delimiters between it and any + subsequent lines. Fixes bug reported by Grisha Levit + back on 2/28/2017 + +bashline.c + - operate_and_get_next: if given an explicit argument, use that to + choose which line in the history to use. + +lib/readline/doc/rluser.texi,doc/bash.1 + - operate-and-get-next: document new effect of explicit numeric arg + +lib/readline/complete.c + - fnprint: make sure print_len is initialized before using it on + systems without multibyte character support. Report and fix from + Juan Manuel Guerrero + + 7/6 + --- +builtins/printf.def + - PRETURN,printf_builtin: check variable returned by bind_printf_variable, + return failure if that indicates we can't perform an assignment + because the variable is marked readonly or noassign. Fixes bug + reported by Arnaud Gaillard + + 7/7 + --- +lib/readline/text.c + - rl_quoted_insert: new feature: a negative argument means to insert + the next -COUNT characters using quoted-insert. Original feature + from Jason Hood . Still needs work on + redisplay + - _rl_insert_next_callback: implement support for negative arguments + similar to rl_quoted_insert: we just insert one at a time and keep + increasing the count until it hits 0 + +lib/readline/misc.c + - _rl_arg_callback: if the return value from _rl_arg_dispatch indicates + we should keep reading a numeric argument, update the message with + the new arg value + + 7/8 + --- +lib/readline/signals.c + - _rl_handle_signal: make sure all uses of any of the job control + signals are protected by a check for SIGTSTP being defined. Report + from Juan Manuel Guerrero + + 7/11 + ---- +lib/readline/vi_mode.c + - rl_vi_replace: when making the new keymap for vi replacement mode, + make sure that ANYOTHERKEY is set correctly, otherwise some input + will cause _rl_dispatch to return -2 to the top level. Fixes fuzzing + bug reported by Ben Wong + + 7/19 + ---- +builtins/read.def + - struct ttsave: make the attrs member a struct, not a pointer, to force + a structure copy that will survive a longjmp to another context. + Leaving it as a pointer to a local struct is not portable + + 9/10 + ---- +execute_cmd.c + - execute_builtin: make sure that we set up the unwind-protect for + pop_scope (temporary_env is non-zero) so that the temporary env + is propagated to the current environment only for special builtins + (source/eval/unset) not run by the command builtin + (flags & CMD_COMMAND_BUILTIN == 0). Fixes bug reported by + Martijn Dekker + + 9/17 + ---- +builtins/printf.def + - asciicode: don't use mblen to check whether or not a character is a + valid multibyte character; use mbtowc right away and then inspect + the return value. Fixes bug reported by Stephane Chazelas + + + 9/27 + ---- +{jobs,subst}.h + - move declaration of last_command_subst_pid to subst.h, since it's + declared in subst.c and doesn't depend on job control. Reported by + Martijn Dekker + +builtins/read.def,variables.c + - fixed a couple of problems (READLINE, ARRAY_VARS) that prevented + the minimal config from building + + 10/1 + ---- +parse.y + - special_case_tokens: if we are returning DO in a case where the last + two tokens read are `FOR' and `WORD' make sure we decrement + expecting_in_token. Fixes bug reported by Martijn Dekker + + + 10/4 + ---- +subst.c + - expand_string_for_rhs: now takes an additional PFLAGS argument from + its caller (one so far); passes that through to call_expand_word_internal + as W_ASSIGNRHS. Fixes bug reported by Martijn Dekker + + - expand_string_for_rhs: expanding b in ${a[:]=b} is now done as if + b were the rhs of an assignment statement. This means that splitting + isn't done, but tilde expansion is performed as if the statement + were `a=b'. Fixes splitting bug with $* reported by Martijn Dekker + + +command.h + - W_NOASSNTILDE: new word flag, means to not perform tilde expansion + following a `:' even if the word has the W_ASSIGNRHS flag enabled + +subst.c + - expand_word_internal: if we see a `:' with the W_NOASSNTILDE flag + set, just add the character and inhibit any subsequent tilde + expansion. Currently not set anywhere, but it could be set in + expand_string_for_rhs to satisfy its peculiar semantics + + 10/6 + ---- +lib/sh/casemod.c + - sh_modcase: convert even single-byte wide characters to wide upper + or lowercase equivalents to accommodate locales where single-byte + characters have multibyte upper and lower case conversions. Bug + reported by Stephane Chazelas + + 10/7 + ---- +doc/{bash.1,bashref.texi} + - slight changes to the description of command_not_found_handle to + clarify that it's executed in a separate execution environment, + just like if the command was found. Reported by Martijn Dekker + + + 10/8 + ---- +lib/readline/doc/{history.3,hstech.texi} + - history_get: clarify the range of valid values for the OFFSET + argument. From a report by Kevin Ryde + + 10/21 + ----- +subst.c + - expand_string_for_rhs: set W_NOASSNTILDE if the operator is `=' + for backwards compatibility with bash-4.4 + +shell.c + - main: set positional parameters before running the startup files, + so the startup files can inspect $@. Often-requested feature, + most recently from Stephane Chazelas + + 10/27 + ----- +doc/{bash.1,bashref.texi} + - Arrays: add some clarifying language to make it clear that array + references that don't use the ${a[s]} syntax are subject to + globbing when passed as arguments to commands such as unset, and + should be quoted for safety. Change prompted by a report from + Eli Barzilay + +parse.y + - parse_comsub: make sure we don't run off the end of the `ret' + buffer when checking for the here doc delimiter. Report from + Jakub Wilk , the result of a fuzzing test. Pointer + to place for the fix from Eduardo Bustamante + + 10/30 + ----- +builtins/pushd.def + - get_directory_stack: make sure the current directory (element 0 of + the stack) is passed to polite_directory_format under the same + conditions as the rest of the stack entries (flags & 1). Otherwise + something like `cd ${DIRSTACK[0]}' will fail. Fixes bug reported + by Steve Jones + +builtins/declare.def + - declare_internal: when checking for a `[' to see whether or not this + is an array variable declaration (declare -a foo[12]), make sure + we don't do the check if we're just dealing with shell functions. + Bug and pointer to fix from PJ Eby + + 11/1 + ---- +parse.y + - parse_comsub: if we read a four-character word followed by a break + character, and that word is not one of the reserved words, set + lex_rwlen to 0 since we are no longer in a reserved word. It only + hurts if another break character immediately follows, so that test + succeeds again. Turn off the RESWDOK flag only if it's not a shell + metacharacter, too. Fixes bug reported by Kjetil Torgrim Homme + + + 11/3 + ---- +lib/readline/isearch.c + - _rl_isearch_dispatch: if we are searching in reverse order, let + sline_index go to -1 to avoid searching the same line twice. It + gets reset right after that, so there's no danger of indexing into + the history line with a negative index. + + 11/7 + ---- +execute_cmd.c + - time_command: only restore command->flags if CODE indicates we didn't + perform a longjmp back to top_level. If we did, `command' has already + been freed. Fixes bug reported on savannah by + ukuvbu oibws + https://savannah.gnu.org/support/?109403 + + 11/10 + ----- +lib/sh/unicode.c + - u32cconv: make sure to initialize localconv to -1 (error) in case + we switch from a utf-8 locale to something else and call + iconv_close. Report from Egmont Koblinger ; fix + from Eduardo Bustamante + + 11/16 + ----- +subst.c + - parse_comsub: istring_index should be a size_t to avoid integer + overflow when allocating large pieces of memory. Report and fix + from Siteshwar Vashisht , originally based on + http://lists.gnu.org/archive/html/bug-bash/2017-11/msg00047.html + + 11/24 + ----- +lib/readline/bind.c + - rl_empty_keymap: new public function, returns non-zero if there are + no keys bound in the keymap passed as an argument + +lib/readline/readline.h + - rl_empty_keymap: new public extern declaration + +lib/readline/doc/rltech.texi + - rl_empty_keymap: document new function + +lib/readline/bind.c + - rl_generic_bind: keep track of the previous keymap and previous + index in a multi-key key sequence so we can remove an empty terminal + keymap and remove a previous override to ANYOTHERKEY. Right now, + this only works for one previous keymap level. Inspired by a report + from Clark Wang + + 11/25 + ----- +lib/readline/display.c + - _rl_update_final: make sure that computing the length of the visible + bottom line (botline_length) takes any invisible characters in the + prompt into account (woff). This value is used as part of the check + whether or not we want to remove the line-wrapping indicator on + terminals like xterm + - _rl_update_final: when removing the line-wrapping indicator on xterm, + make sure we take invisible characters in the prompt (woff) into + account when computing the character in the rightmost physical + screen position. Fixes cosmetic line-wrapping issue reported by + Egmont Koblinger + + 11/27 + ----- +lib/sh/ufuncs.c + - fsleep: if using select to implement sleep, use restart after + a signal interrupts the select and handle pending signals. If + pselect is available, use that instead and block SIGCHLD while + pselect is executing. + Fixes report from Thiruvadi Rajaraman + + 11/28 + ----- +lib/readline/signals.c + - rl_check_signals: new public function: a wrapper for RL_CHECK_SIGNALS + that can be used by applications that install a wrapper for + rl_getc (rl_getc_function) so they can respond to signals that + arrive while waiting for input in the same way as rl_getc. The app + can use rl_pending_signal() to get the most recently-received + signal. From a discussion about Gnuplot initiated by + Rin Okuyama + +lib/readline/readline.h + - rl_check_signals: new extern declaration + +lib/readline/doc/rltech.texi + - rl_check_signals: document new public function + +variables.c + - set_pwd: test for and force an inherited OLDPWD to be a directory + if OLDPWD_CHECK_DIRECTORY is defined in config-top.h (it is by + default). Issue raised by Mikulas Patocka + +config-top.h + - OLDPWD_CHECK_DIRECTORY: new define, defined to 1 by default + + 11/29 + ----- +Makefile.in + - pathexp.o: add dependencies on libintl.h. Reported by + Ross Burton + + 12/1 + ---- +lib/sh/ufuncs.c + - fsleep: add blocking and releasing SIGCHLD using sigprocmask + around call to select(2) even if pselect(2) is not available + + 12/3 + ---- +execute_cmd.c + - coproc_setstatus: new utility function, take a pointer to a coproc + and a status and mark the coproc as dead and having been reaped + with that status. Used by child processes who want to invalidate + the coproc's pid + + 12/5 + ---- +subst.c + - process_substitute: instead of just having a flag to denote that a + file descriptor is connected to a process substitution, store the + pid of the child process (still needs work) + - find_procsub_child,set_procsub_status,reap_procsubs: utility + functions to allow the job control code to detect that a process + substitution child has died and deallocate the file descriptors + or pathname + +subst.h + - find_procsub_child,set_procsub_status,reap_procsubs: extern + declarations + +nojobs.c + - set_pid_status: if we are reaping a process substitution, call + set_procsub_status to record the fact + +jobs.c + - waitchld: if we are reaping a process substitution, call + set_procsub_status to record the fact. Doesn't really do anything + yet + + 12/6 + ---- +execute_cmd.c + - execute_command: don't call unlink_fifo_list if we're in the + middle of executing a list of commands (executing_list != 0). + Partial fix for bug reported by Stephane Chazelas + + - execute_simple_command: don't close process substitution file + descriptors in the parent after forking children in a pipeline; + defer until pipeline completes, since parent may have inherited + fds from a calling scope (e.g., via `.'). EXPERIMENTAL + - execute_disk_command: don't close process substitution file + descriptors in the parent after forking the child. EXPERIMENTAL + + 12/7 + ---- +doc/bash.1,lib/readline/doc/{readline.3,rluser.texi} + - show-mode-in-prompt: clarify that this must be enabled before the + vi and emacs mode strings are prefixed to the prompt. Report from + Rob Foehl + + 12/8 + ---- +execute_cmd.c + - execute_coproc: don't warn about an existing coproc if the write and + read file descriptors are unusable (-1), as they will be after a + call to coproc_closeall in a subshell. Fixes spurious warning + reported by Tobias Hoffmann + +jobs.c + - bgp_resize: avoid overflow when calculating the new size if the + child process limit is something ridiculously large. Report and + fix from Natanael Copa + +execute_cmd.c + - execute_builtin_or_function: if we return via the return builtin, we + don't get a chance to free the saved fifo list, so add an unwind- + protect to make sure it happens. Part of fix for leak reported by + Oyvind Hvidsten + - execute_command_internal: if we unwind via the return builtin (e.g., + we execute a function which then returns via the return builtin to + a previous function), we don't free the saved fifo list, so add an + unwind-protect to make sure the free happens. Rest of fix for leak + reported by Oyvind Hvidsten + +subst.c + - add_fifo_list: for the FIFO case (no /dev/fd), make sure we + initialize the new members of the fifo list after xrealloc + + 12/9 + ---- +subst.c + - dev_fd_list: now a list of type `pid_t' so we can store process + associated with the pipe fd into the right element; change all + necessary functions (copy_fifo_list, add_fifo_list) + - process_substitute: store pid of child process into the right + index in dev_fd_list after opening the pipe. Process ID of -1 means + process has been reaped and fd needs to be closed (or FIFO needs to + be unlinked); value of 0 means slot is unused + +jobs.c + - wait_for_background_pids: call reap_procsubs to make sure we clean + up all reaped process substitutions before trying to wait for + everything (still needs work) + +tests/{run-procsub,procsub.{tests,right}} + - new file, tests of process substitution that have failed in the past + + 12/10 + ----- +jobs.c + - wait_for_background_pids: warn if one of the jobs is stopped + +subst.c + - wait_procsubs: new function, call wait_for for every "live" process + substitution + +jobs.c + - wait_for_background_pids: call wait_procsubs to reap any living + process subsitutions + + 12/13 + ----- +lib/readline/bind.c + - parser_if: add support for testing the readline version, using the + full set of arithmetic comparison operators (and supporting both + = and ==), using version numbers of the form major[.[minor]] + + 12/14 + ----- +subst.[ch] + - string_list_dollar_star: now takes QUOTED and PFLAGS arguments like + string_list_dollar_at, changed all callers. Not used yet. + + 12/16 + ----- +subst.c + - param_expand: broke out cases of expanding unquoted (quoted == 0) + $* on the rhs of an assignment statement (pflags & PF_ASSIGNRHS) + with various values of IFS (unset, null, set to non-null value) to + capture the expansion subtleties. From a report back on 11/24 by + Martijn Dekker + + 12/17 + ----- +array.h + - set_element_value: new define, sets array element AE to VALUE + +variables.c + - set_pipestatus_array: use set_element_value where appropriate + + 12/18 + ----- +subst.c + - parameter_brace_find_indir: when expanding the indirect parameter + to find the eventual variable name, we don't perform word splitting. + Make sure this does the right thing for * and @. Fixes bug + reported by isabella parakiss + + 12/19 + ----- +doc/{bash.1,bashref.texi} + - indirect expansion: make sure to note that the value of the indirect + variable does not undergo word splitting as one of its expansions, + as in fix from 12/18 + + 12/22 + ----- +subst.c + - parameter_brace_expand_rhs: make sure the value this function returns + when OP is `=' is quoted appropriately, as the callers expect. More + changes from Posix interp 221. Fixes report from Martijn Dekker + + +variables.c + - assign_hashcmd: if running in a restricted shell, make sure the + target of the hash assignment can be found via a $PATH search, to + prevent users assigning commands to the hash table they would not + ordinarily have access to. Fixes issue raised by Drew Parker + + +builtins/hash.def + - hash_builtin: if running in a restricted shell, make sure the + pathname target of `hash -p' can be found via a $PATH search, to + prevent users assigning commands to the hash table they would not + ordinarily have access to. + + 12/27 + ----- +array.c,arrayfunc.c,... + - many changes to clean up unused variables and functions. From a + report from Siteshwar Vashisht + + 12/28 + ----- +lib/readline/terminal.c + - _rl_term_clrscroll: save the `E3' termcap capability, which clears + the scrollback buffer where supported. Unused right now + +lib/readline/rlprivate.h + - _rl_term_clrscroll: extern declaration + +lib/readline/bind.c + - parser_if: added simple variable comparison capability. Allowable + operators are `=', `==', and `!='; boolean variables must be + compared to either `on' or `off'; variable names must be separated + from the operator by whitespace + +doc/bash.1,lib/readline/doc/{rluser.texi,readline.3} + - document new `if variable comparison value' construct + + 1/2/2018 + -------- +lib/glob/sm_loop.c + - EXTMATCH: when matching against !(patlist), if a filename beginning + with a `.' does not match any of the patterns in patlist, don't + return it as a match if leading dots need to be matched explicitly + (flags & FNM_PERIOD). Report from Eric Cook + + 1/3 + --- +variables.[ch] + - bind_function_def: takes an additional flags argument. If FLAGS&1, + overwrite any existing function_def hash table entry; if FLAGS==0, + leave any existing function_def alone. + +make_cmd.c + - make_function_def: call bind_function_def with flags == 0 + +execute_cmd.c + - execute_intern_function: call bind_function_def with flags == 1 so + we have function_def information that's correct for where the + function is defined, not just where it's last parsed. Fixes report + from Bruno Vasselle ; final piece of + fix from 12/15/2011 + + 1/4 + --- +subst.c + - param_expand: deal with string_list_dollar_star returning NULL. + Fixes bug reported by Martijn Dekker + +builtins/history.def + - history_builtin: enabled code that performs range deletion + + 1/5 + --- +subst.c + - do_assignment_internal: if performing a compound assignment, make + sure to pass ASS_CHKLOCAL flag to do_compound_assignment if the + assignment word has the W_CHKLOCAL flag set + - do_compound_assignment: honor ASS_CHKLOCAL flag and check for an + existing local variable before creating or modifying a global + variable + +builtins/declare.def + - declare_internal: new (undocumented so far) option: -G. Means to + act on global variables (create, modify) if no local variable is + found with the specified name + - declare_find_variable: new declare-specific wrapper functon for + declare builtin; obeys -g and -G options in one place + - declare_internal: if no variable is found after following any nameref + chain, look up the variable using declare_find_variable to honor the + -G option. XXX - so far, this is the only place that function is used + +subst.c + - shell_expand_word_list: before calling make_internal_declare, add + 'G' to the options list if W_CHKLOCAL is set in the word's flags. + This makes builtins like `readonly' that modify local variables in + a function behave the same for scalar and array variables + + 1/11 + ---- +parse.y + - shell_getc: move code that decides whether to append a space to an + alias expansion here from mk_alexpansion, so we can inhibit adding + a space if we're currently parsing a single or double quoted string + + 1/12 + ---- + +parse.y + - clear_string_list_expander: take a pointer to an alias that's about + to be freed and make sure there aren't any pointers to it in the + list of pushed strings. If there are, zero it out in the pushed + string list to avoid referencing freed memory in pop_string() + +alias.c + - free_alias_data: if an alias being freed is currently being expanded, + call clear_string_list_expander to remove references to it from the + list of pushed strings + + 1/14 + ---- +pcomplib.c + - progcomp_search: add code to look up an alias for the CMD argument + and return the completions for the first word of that alias if one + is found. Just a start at completing aliases, a much-requested + feature + +pcomplete.h + - COPT_LASTUSER: last flag value used by user-settable completion + options + - PCOMP_RETRYFAIL, PCOMP_NOTFOUND: new #defines, possible return values + from programmable_completions in FOUNDP argument. Moved RETRYFAIL + define here from pcomplete.c to avoid collisions with user-settable + option values (COPT_*) + + 1/15 + ---- +pcomplete.c + - programmable_completions: if we don't find any completions for a + command, and RETRY is 0, see if the command is a defined alias, + expand it, and try to expand the first word of the value as a + command, and find any programmable completions for it. Here right + now, could be moved to attempt_shell_completion later if we need + to do more analysis of the expanded line. We'll see how it works + in practice. (Disabled for now.) + + 1/16 + ---- +parse.y + - grammar: when timing the null command, make sure to turn off the + flags in parser_state (PST_REDIRLIST) that make_simple_command sets + when given a NULL second argument, since it assumes that it's going + to turn those off when it gets the next word of the simple command + (which it never gets in this case). Fixes bug reported by + Anti Räis + + 1/19 + ---- +lib/readline/rltty.c + - prepare_terminal_settings (termios/termio): if there is a function + bound to the VDISCARD character in the current keymap, set VDISCARD + to _POSIX_VDISABLE while readline is active. From a report from + Rhialto + + 1/22 + ---- +builtins/history.def + - histtime: check whether or not localtime() returns NULL, and make + sure we only call strftime() with a valid struct tm. This can happen + when the timestamps in the history file overflow a time_t. Fixes bug + reported by Luke Dashjr + +bashline.c + - edit_and_execute_command: if we're in vi editing mode, make sure + we end up in insert mode after executing the commands from the + edited file. This seems to be what other shells do. Report from + Stan Marsh + + 1/26 + ---- +bashline.c + - command_word_completion_function: match alias and shell function + names case-insensitively if the readline completion-ignore-case + variable is set. Inspired by report from + +lib/readline/display.c + - update_line: when performing a dumb update after wrapping the line + (usually due to printing the prompt), make sure we adjust + _rl_last_c_pos if there are invisible characters in prompt lines + other than the first (we assume those invisible characters are in + the last line, which is nearly always the case). We adjust by the + total number of invisible chars less the number of invisible chars + in the first prompt line. From a report in + https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1745273 + +execute_cmd.c + - execute_command_internal: if redirections attached to a compound + command fail, make sure we discard the `internal_fifos' unwind- + protect frame after freeing the copied fifo_list and before returning + + 1/30 + ---- +lib/readline/rlprivate.h + - BRACK_PASTE_FINI: add \r to the end of the string to avoid problems + with the tty driver thinking the cursor was in the wrong position. + Fixes issue reported by Egmont Koblinger + + 1/31 + ---- +lib/sh/zread.c + - zread,zreadintr: call check_signals() before calling read() to + minimize the race window between signal delivery, signal handling, + and a blocking read(2). Partial fix for FIFO read issue reported by + Oyvind Hvidsten + +doc/{bash.1,bashref.texi} + - shopt: document `assoc_expand_once' shell option + + 2/1 + --- +config-top.h + - DONT_REPORT_SIGTERM: define, so non-interactive shells will no + longer print termination messages for child processes killed by + SIGTERM + + 2/6 + --- +lib/readline/text.c + - rl_insert: don't attempt to optimize typeahead if we are only reading + a fixed number of characters (rl_num_chars_to_read > 0) + +redir.c + - redir_special_open: if the shell is restricted, return a + RESTRICTED_REDIRECT error for attempts to open /dev/tcp and /dev/udp + sockets. Inspired by report from Blake Burkhart + - do_redirection_internal: if redir_open returns RESTRICTED_REDIRECT, + return that right away (instead of errno) so we can print a better + error message + + 2/11 + ---- +jobs.c + - bgp_resize: fix problems with (pid_t) overflow when calculating new + size for table when js.c_childmax is near the limit of a pid_t + (e.g., 2**31 - 1 on a 32-bit system, or 2**63-1 on a system with + 32-bit pid_t). Fixes hang reported by Natanael Copa + based on his patch from 12/8. + - bgp_resize: cap max table size for bgpids at MAX_CHILD_MAX (32768) + +include/typemax.h + - TYPE_MINIMUM, TYPE_MAXIMUM: updated definitions from coreutils-8.29, + silences some compiler warnings + + 2/14 + ---- +Makefile.in + - maybe-clean: use cd and pwd -P to test whether or not two directory + names identical, since topdir = '.' and BUILD_DIR = full pathname + when you use something like `bash ./configure'. Problem reported by + Michael Felt + +subst.c + - split_at_delims: if SD_NOQUOTEDELIM is in the flags argument, don't + treat `'' and `"' as candidates for possible sequences of delimiters, + even if they're part of the delimiter set (the delims argument). + Fixes problem with completing lines like `foo --bar='quux baz' xx' + reported by Nick Patavalis + + 2/15 + ---- +copy_cmd.c + - copy_word_list: build the list in the right order, avoiding having + to reverse it at the end. Helps with long argument lists + +shell.c + - bind_args: build the argument list in the right order, avoiding + having to reverse it at the end. + - bind_args: only call push_args to save argc and argv as BASH_ARGC + and BASH_ARGV if debugging mode is enabled (debugging_mode != 0). + Inspired by report from Ambrose Feinstein + - bind_args: note that we've saved BASH_ARGC and BASH_ARGV by setting + bash_argv_initialized + - shell_reinitialize: reset bash_argv_initialized back to 0 so + BASH_ARGV and BASH_ARGC will be recreated if we're in debugging mode + +variables.c + - save_bash_argv: new function, initializes BASH_ARGV and BASH_ARGC + from the saved positional parameters + - init_bash_argv: initialize BASH_ARGV and BASH_ARGC if + bash_argv_initialized == 0 + +builtins/shopt.def + - shopt_set_debug_mode: if we're turning on debug mode, initialize + BASH_ARGC and BASH_ARGV if bash_argv_initialized == 0 + + 2/16 + ---- +execute_cmd.c + - execute_function: make sure BASH_ARGV and BASH_ARGC are initialized + before calling push_args (and before calling remember_args) + +builtins/source.def + - source_builtin: make sure BASH_ARGV and BASH_ARGC are initialized + before calling push_args (and before calling remember_args) + +builtins/evalfile.c + - _evalfile: if the shell compatibility level is 44 or lower, make + sure BASH_ARGV and BASH_ARGC are initialized before calling + array_push + +builtins/shopt.def + - compat44: new shell option. This will be the last compatXX option + +doc/{bash.1,bashref.texi} + - compat44: document new shell option + + 2/21 + ---- +builtins/common.h + - ISOPTION: check s[1] before s[2] to avoid out of bound reads. Fixes + bug reported by jeremy@feusi.co + +input.h + - B_SHAREDBUF: new flag for buffered input fds, indicates that this + fd shares its b_buffer with another fd + +input.c + - duplicate_buffered_stream: when duplicating *from* the buffer + corresponding to bash input, make sure the new buffer has B_SHAREDBUF + in the flags, because copy_buffered_stream copies pointers + - duplicate_buffered_stream: if the buffer being copied to has the + B_SHAREDBUF flag set, make sure the b_buffer doesn't get freed. + Fixes use-after-free bug reported by jeremy@feusi.co + - save_bash_input,close_buffered_stream: make sure a buffer with + B_SHAREDBUF set has its b_buffer set to NULL before calling + free_buffered_stream + + 2/24 + ---- +subst.c + - parameter_brace_expand_error: add parameter saying whether or not + we are checking whether value is null, so we can have different + error messages for ${x:?} and ${x?}. Report and fix from + don fong + + 3/5 + --- +lib/readline/bind.c + - _rl_read_file: instead of calling stat/open on the passed filename, + use open/fstat to avoid one possible filename translation and close + a small (benign) race condition. Report and fix from Roy Ivy + + + 3/11 + ---- +variables.c + - makunbound: if new variable localvar_unset is non-zero, mark local + vars in previous scopes as invisible and unset so they will show + up as unset until that previous scope returns (similar to how local + variables in the current local scope are handled). localvar_unset + is currently set to 0 with no way for a script to change its value. + Eventually there will be an option to modify it. From a bug-bash + discussion started by Nikolai Kondrashov back + on 2/11/2018 + + 3/13 + ---- +subst.c + - expand_word_list_internal: short-circuit and exit right away if a + variable assignment preceding a special builtin fails in posix mode + - expand_word_list_internal: if a variable assignment precedes an + empty command name (after expansion), fix to exit right away when + the shell is in posix mode + + 3/15 + ---- +doc/{bash.1,bashref.texi} + - Add text to Pathname Expansion clarifying that a slash must be + matched by a slash in the pattern when matching pathnames, but + not in other matching contexts. Suggested by + +builtins/common.c + - read_octal: allow octal numbers greater than 777 to accommodate + modes and umasks that include sticky/setuid/setgid bits. Report + and fix from Martijn Dekker + + 3/19 + ---- +lib/readline/bind.c + - rl_generic_bind: make sure we only assign to prevkey in the loop + if the key sequence index is > 0, so ic is valid. Fixes bug + reported by Koichi Murase + +builtins/read.def + - read_builtin: be slightly less aggressive checking for timeouts and + SIGALRM: if we successfully read a character, don't check for a + timeout until we store or process it. Fixes timing problem + reported by Rob Foehl + + 3/22 + ---- +sig.c + - termsig_handler: add a call to exit(1) after the kill, just in case + there are circumstances where the SIG_DFL signal handler is + ignored. Report from Andrei Vagin + + 3/25 + ---- +lib/readline/bind.c + - _rl_function_of_keyseq_internal: new internal function that takes a + length parameter to accommodate NUL in the key sequence. Patch from + Koichi Murase + - rl_function_of_keyseq_len: new application-callable function that + takes a length parameter; otherwise equivalent to rl_function_of_keyseq. + +lib/readline/readline.h + - rl_function_of_keyseq_len: add extern declaration for new function + +lib/readline/doc/rltech.texi + - rl_function_of_keyseq_len: document new function interface + +bashline.c + - bash_execute_unix_command: use rl_function_of_keyseq_len to handle + key sequences with embedded NULs (\C-@). Fix from Koichi Murase + + +lib/readline/bind.c + - rl_bind_key_if_unbound,rl_bind_key_if_unbound_in_map: run the KEY + argument through rl_untranslate_keyseq to produce a symbolic sequence + that can encode \C-@. + - rl_bind_keyseq_if_unbound_in_map: translate the key sequence in order + to accommodate symbolic key sequences; should be a no-op for `raw' + key sequences such as the arrow key seqeunces from terminfo. Change + from Koichi Murase + + 4/2 + --- +jobs.c + - wait_for: when setting the SIGINT signal handler to wait_sigint_handler + make sure we're not setting old_sigint_handler recursively, as we + can when running an external command in a trap we took after a + command exited due to SIGINT. We don't want to overwrite + old_sigint_handler here. Fixes bug reported by Dr. Werner Fink + + +execute_cmd.c + - execute_disk_command: when there is a command_not_found_hook, make + sure the subshell turns off job control before running it, in case + it runs processes. We don't want it to manipulate process groups. + Fixes bug reported by ÐиÑиллов Ðима + - execute_command_internal: make sure the command run by the `command' + builtin doesn't cause the ERR trap to be executed; wait for the + status to be returned by the command builtin. Fixes bug reported by + Martijn Dekker + + 4/4 + --- +subst.c + - process_substitute: handle longjmp back to top_level and function + returns (return_catch) in the child process, like command + substitution, so we don't longjmp back to some arbitrary spot from + the `exit' or `return' builtins, or on an expansion error, like + the command timing code. Fixes bug reported by Basin Ilya + + + 4/6 + --- +parse.y + - read_token_word: when reading a matched pair of backquotes as part + of a word, treat it as quoted so the characters are read as a single + word, but do not let the presence of the backquote mark the word as + quoted. Fixes here-document delimiter bug reported by Denys Vlasenko + + + 4/7 + --- +execute_cmd.c + - execute_case_command: call quote_string_for_globbing with the + QGLOB_CTLESC flag for both quoted and unquoted words, so it will + remove CTLESC/CTLESC in all cases while converting other quoted + characters to use a preceding backslash. Bug reported by + Martijn Dekker + + 4/9 + --- +smatch.c + - posix_cclass_only: helper function that checks whether a pattern has + only posix single-byte character classes ([:alpha:], etc.) or has + none at all + - xstrmatch: if running in a multibyte locale, make sure to short- + circuit to the single-byte matching code only if there are no + unrecognized character class names, since the wide character ctype + functions allow locales to define their own character class names + (e.g., "hyphen"). Fixes issue reported by yangyajing + + 4/10 + ---- +configure.ac,cross-build/qnx.cache + - qnx: add a configure cache file for cross-building, treat qnx 7 like + qnx 6 in terms of cpp options. Fix from Brian Carnes + + +aclocal.m4 + - BASH_CHECK_DEV_STDIN: experimental change to test for /dev/stdin + independently of /dev/fd or /proc/self/fd. Suggested for QNX by + Brian Carnes + + + 4/11 + ---- +lib/glob/glob.c + - glob_testdir: return -2 if DIR is a symlink, to differentiate it from + any other kind of non-directory file + - glob_vector: if we have GX_ALLDIRS (globstar), we want to skip over + symlinks to directories, since we will pick up the real directory + later. Fixes incompatibility reported by Murukesh Mohanan + + +bashline.c + - bash_execute_unix_command: changes to make READLINE_POINT apply to + characters instead of bytes when in a multibyte locale. Report and + fix from Koichi Murase + + 4/12 + ---- +builtins/evalstring.c + - parse_and_execute_cleanup: now takes an argument which is the value + of running_trap at some point before parse_and_execute was called; + changed callers in sig.c, builtins/evalfile.c + +builtins/common.h + - parse_and_execute_cleanup: changed prototype + + 4/13 + ---- +builtins/evalstring.c + - parse_and_execute_cleanup: if the argument holding the previous state + of running_trap is the same value as the current running_trap state, + don't call run_trap_cleanup: assume that there is a caller who will + take care of the cleanup after this returns. Fixes recursive trap + call on "eval return" reported by Martijn Dekker + +parse.y + - read_a_line: if remove_quoted_newline is non-zero, indicating the + here-document delimiter is unquoted, we will be running the contents + of the here-document through word expansion and need to quote CTLESC + and CTLNUL in the input. Fixes bug with ^A in here document reported + by Jorge Alberto Baca Garcia + + 4/18 + ---- +pathexp.c + - quote_string_for_globbing: make sure the QGLOB_CTLESC code handles + both CTLESC CTLESC and CTLESC CTLNUL in the same way. Fixes bug + reported by Martijn Dekker + + 4/19 + ---- +execute_cmd.c + - execute_command_internal: before executing any command in the current + shell, and before copying any existing FIFO list, call + reap_procsubs to unlink or close any process substitution pipes + associated with processes that have exited. Fixes hang in test suite + when trying to open a FIFO with no process having it open for + reading + + 4/26 + ---- +parse.y + - read_token_word: if returning REDIR_WORD for a {id}>foo construct, + for example, make sure to assign the_word to yylval.word before + returning, in case a recursive call to the parser overwrites it + (e.g., when evaluating array indexes). From a message to + austin-group-l from Stephane Chazelas + +lib/glob/sm_loop.c + - BRACKMATCH: if we have an invalid character class in an otherwise + well-formed bracket expression, don't try to match each character + of the (invalid) class individually; just skip over the class and + move on. From a message on the austin-group list from + Stephane Chazelas + + 4/27 + ---- +variables.c + - push_exported_var,push_func_var,push_temp_var: make sure to set the + context correctly in the variable we bind in the previous (non-temp) + scope. Report from Martijn Dekker + +pathexp.c + - unquoted_glob_pattern_p: a pattern that contains a backslash can + have it removed by the matching engine (since backslash is special + in pattern matching), so if the pattern contains a backslash, and + does not end in a backslash, we need to return true. Fixes bug + reported by Robert Elz + +lib/glob/glob_loop.c + - INTERNAL_GLOB_PATTERN_P: same change to return TRUE for a backslash + that doesn't end the pattern + +lib/sh/timeval.c + - print_timeval: use locale_decpoint() instead of fixed `.' to print + decimal point. Bug report in austin-group email from Joerg Schilling + + +lib/sh/clock.c + - print_clock_t: use locale_depoint() in the same way as print_timeval + + 4/29 + ---- +subst.c + - expand_cond_node: if special != 0, make sure to add QGLOB_CTLESC + to the flags passed to quote_string_for_globbing. Same issue as the + one with `case' fixed on 4/7, report from Martijn Dekker + + + 4/30 + ---- +redir.c + - do_redirection_internal: r_close_this: if the file descriptor is + already closed before the shell is asked to close it, make sure to + add an undo list redirect to make sure it stays closed. Report from + Martijn Dekker + + 5/2 + --- +variables.c + - push_posix_temp_var: new function, takes the SHELL_VAR * passed as + an argument and uses the name and value to create a global variable + - merge_temporary_env: if posixly_correct is set, call + push_posix_temp_var to create global variables, otherwise call + push_temp_var to preserve the old behavior. Right now, it's only + called when in posix mode, but that might change. This undoes the + change from 4/27 when in posix mode + + 5/3 + --- +sig.c + - struct that holds the terminating signal information has a new + field: whether that signal is expected to cause a core dump + - termsig_handler: if the call to kill(2) doesn't kill the process, + we have a problem. If our pid is not 1, we just exit with status + 128+sig (fake the sig exit status). If the pid is 1, we assume + we're in a Linux pid namespace and aren't allowed to send a signal + to ourselves. If we need to generate a core dump, we try to get + the kernel to SIGSEGV us by dereferencing location 0. If not, we + just exit with 128+sig. From a report and patch from Andrei Vagin + + + 5/4 + --- +bashline.c + - bash_execute_unix_command: make sure that parse_and_execute is called + with newly-allocated memory to avoid prematurely freeing the + command. Report and fix from Koichi Murase + + 5/7 + --- +builtins/shopt.def + - syslog_history: a shell option to control whether history is logged + to syslog; can be modified at runtime. Original patch from + Siteshwar Vashisht + +config-top.h + - SYSLOG_SHOPT: new configurable option, determines whether there is a + shell option to control syslogging history lines at runtime and sets + the default value of the option + +bashline.c + - syslog_history: new variable to control whether history lines are + sent to syslog; default value is the value of SYSLOG_SHOPT (or 1 + if that's not defined) + - bash_add_history: send history lines to syslog if syslog_history is + non-zero + + 5/10 + ---- + +variables.c + - push_var_context: if we are in Posix mode and manipulating the + temporary environment (temporary_env), implement behavior specified + in Posix interp 1009 and make sure that temporary assignments + preceding function calls modify the current environment *before* + the function is executed. + +[bash-5.0-alpha frozen] + + 5/12 + ---- +execute_cmd.c + - execute_in_subshell: subshells should set loop_level == 0, since + they are no longer "enclosed" by the loop, according to posix. + Report from Aeron.E. Wang + + 5/24 + ---- +Makefile.in + - pkgconfigdir: don't fail installing bash.pc if this directory doesn't + exist or isn't writable -- there's no error in failing to install + something nothing will use + - install-headers-dirs: creat $(pkgconfigdir) if it doesn't exist + +lib/sh/shmbchar.c + - utf8_mblen: replace with version from gnulib + - utf8_mbstrlen: reimplement using utf8_mblen so it handles invalid + multibyte sequences in the same way as mbstrlen + +lib/readline/mbutil.c + - _rl_utf8_mblen: utf-8 specific version of mblen from gnulib + +include/shmbutil.h + - ADVANCE_CHAR,COPY_CHAR_P: do better job detecting end of string in + UTF-8 locales (should not be called with an empty string, but to + be safe) + + 5/25 + ---- +lib/sh/utf8.c + - new file, utf-8-specific functions collected from other files + +externs.h + - extern declarations moved around for utf8.c + +include/shmbutil.h + - SADD_MBCHAR, SADD_MBQCHAR_BODY, ADVANCE_CHAR_P: if the locale is a + UTF-8 locale, don't bother with a call to mbrlen if the current + character cannot start a multibyte character + +variables.c + - push_var_context: only merge the temporary environment in posix mode + if we are executing a shell function (flags & VC_FUNCENV). Report + from Martijn Dekker + +lib/readline/mbutil.c + - _rl_get_char_len: don't call mbrlen if we are in a UTF-8 locale and + the character cannot start a multibyte sequence + +builtins/read.def + - read_builtin: if mb_cur_max > 1, call read_mbchar only if we're not + in a utf-8 locale or, if we are, the character we just read indicates + the start of a multibyte sequence + +subst.c + - string_extract_verbatim: don't call MBRLEN if we're in a utf-8 + locale and the current character can't start a multibyte sequence + - setifs: don't call MBRLEN if we're in a utf-8 locale and the first + character of $IFS can't start a multibyte sequence + +lib/readline/kill.c + - rl_bracketed_paste_begin: make sure we return 0 here if rl_insert_text + returns the right number of characters inserted to be consistent + with other functions. Returns 1 otherwise. Report and fix from + Gabe Krabbe back in March, 2018 + +lib/readline/readline.c + - rl_subseq_result: make sure r is < 0 before checking map[ANYOTHERKEY] + to see if we shadowed a key that should now be tried + + 5/27 + ---- +variables.c + - assign_aliasvar: perform same validity check on subscript assignment + as alias builtin performs on name argument. Bug report from + Mike Jonkmans + + 5/29 + ---- +builtins/setattr.def + - set_var_attribute: we should not propagate a variable assignment + preceding a builtin back to the calling environment unless the + shell is in posix mode. Since previous versions of the shell do + this, setting the shell compatibility level to 44 or less will + continue the propagation behavior + + 6/1 + --- +lib/readline/histexpand.c + - history_tokenize_word: as part of teaching history tokenization more + and more about shell syntax, allow command and process subsitution + and extended globbing patterns to appear within a word being + tokenized and not just at the beginning. Fixes bug reported back in + 2/2017 by ecki@tofex.de + +bashhist.c + - load_history: use HISTSIZE_DEFAULT (still defaults to "500") to set + the initial value of $HISTSIZE. HISTSIZE_DEFAULT can be overridden + in config-top.h + + 6/4 + --- +configure.ac + - make sure we link against an external readline library that's at + least version 8 + + 6/8 + --- +pcomplete.h + - INITIALWORD: internal compspec name for programmable completion on + the initial (usually the command) word + +bashline.c + - attempt_shell_completion: if we are in a command position and the + user has defined a compspec for INITIALWORD, use programmable + completion to complete command words. Original patch from + Luca Boccassi + +lib/readline/doc/rluser.texi,builtins/complete.def,doc/bash.1 + - make it clearer that -D takes precedence over -E when supplied as + options to `complete', not when they are applied during completion + +builtins/complete.def + - complete_builtin,compgen_builtin: add support for -I option + - print_one_completion,print_compopts: display -I when appropriate + +lib/readline/doc/rluser.texi,doc/bash.1 + - complete,compgen: document new -I option and its effect + + 6/10 + ---- +lib/readline/histfile.c + - read_history_range: don't apply the heuristic and try to append a + history line to an existing history entry if we don't have any + history entries. Bug and fix from Edward Huff + + 6/12 + ---- +bashline.c + - attempt_shell_completion: don't all the programmable completion for + INITIALWORD if programmable completion is disabled + - attempt_shell_completion: make sure in_command_position remains set + for an empty command word on an otherwise blank line, making the + presence of assignment statements optional. Report from + Luca Boccassi + + 6/20 + ---- +lib/malloc/malloc.c + - morecore,internal_malloc,internal_free: requests for more than + 128K bytes (defined as MMAP_THRESHOLD and saved in the new + malloc_mmap_threshold variable) are now satisfied via mmap and + freed via munmap. We only use mmap if we have mmap and MAP_ANON + (or MAP_ANONYMOUS). These blocks are not available for splitting + or coalescing, so every request for 128K bytes or smaller is + satisfied via sbrk(). We don't use mremap for realloc yet, but + we could in the future + +lib/malloc/mstats.h + - malloc_stats: the malloc stats now include the number of calls to + mmap and the total number of bytes requested via mmap. The number + of calls to munmap is captured in each bucket's lesscore count + +lib/malloc/stats.c + - print_malloc_stats: now prints an indication of where the change from + sbrk to mmap takes place, and prints number of mmap calls and total + number of bytes allocated using mmap + + 6/22 + ---- +variables.c + - get_bashargcv: new dynamic "fetch" variable for BASH_ARGV and + BASH_ARGC, for backwards compatibility: if a script makes a + reference to either variable at the top level (not in a shell + function) without enabling debugging mode and not having initialized + the variable previously (using a simple semaphore), create the + variables + + 6/25 + ---- +configure.ac + - opt_bash_malloc: bash malloc no longer disabled for systems that + require eight-bit alignment; the bash malloc has had this for a + long time + + 7/4 + --- +bashline.c + - pre_process_line: if command-oriented history is enabled, and the + line being expanded is the second or later in a multi-line command, + and we know the command is being saved as the current history entry, + decrease history_length before calling history_expand so references + like !! refer to the previous history entry as usual + +lib/readline/histexpand.c + - history_quoting_state: new variable, can be set by calling + application before calling history_expand to note that the string + being expanded is part of a quoted string. Can be set to a single + quote, a double quote, or 0 (no quoting) + - history_expand: look at history_quoting_state and honor the + single-quote setting by not expanding any initial portion of the + line before the closing single quote. This allows history expansions + to be performed on a line containing a closing single quote if they + appear after the single quote + +lib/readline/history.h + - history_quoting_state: extern declaration + +bashhist.c + - bash_history_inhibit_expansion: if history_quoting_state indicates + that this string is single-quoted, skip over the single-quoted + portion and determine whether or not the portion after the + quoted string needs to be inhibited from history expansion + +parse.y + - shell_getc: set history_quoting_state based on the contents of the + current delimiter before calling pre_process_line + + 7/6 + --- +lib/readline/doc/hsuser.texi + - describe the default behavior of backslash and single and double + quotes + +lib/readline/doc/hstech.texi + - history_quoting_state: describe effect of setting this variable + - history_quotes_inihibit_expansion: expand the description to include + the default quoting behavior that setting this variable enables + + 7/9 + --- +support/man2html.c + - unescape: use memmove instead of strcpy to handle overlapping strings + Report and fix from Bernhard M. Wiedemann + +lib/sh/getenv.c + - getenv: check that environ is non-NULL before looking through it. + Report and fix from Keeley Hoek + + 7/12 + ---- +braces.c + - mkseq: use better integer overflow handling for systems with 32-bit + ints and 64-bit intmax_ts. Bug reported by Simon Wörner + as the result of fuzzing + +builtins/declare.def + - declare_internal: make sure bind_variable returns non-NULL when + setting attributes for a variable named as an argument to declare + that also appears in the temporary environment (and is a nameref). + Bug reported by Simon Wörner + +parse.y,externs.h + - reset_readahead_token: new convenience function for the rest of + the shell, resets token_to_read if it's a newline (as it will be + after reset_parser is called) + +eval.c + - reader_loop: if we're just going to execute one command, make sure + the read-ahead token isn't set to something that will result in a + NULL command (by calling reset_readahead_token), since the code + will take that as the one command and set EOF_Reached + + 7/15 + ---- +doc/{bash.1,bashref.texi} + - indirect expansion: clarify that the expansion works on parameters, + not just variables (NAMEs). Suggested by konsolebox + + + 7/16 + ---- +doc/{bash.1,bashref.texi} + - INSIDE_EMACS: document its effect on line editing + + 7/17 + ---- +lib/readline/{readline.c,rlprivate.h} + - _rl_eof_found: new variable, private to the readline library, that + indicates whether the current call to readline() will return NULL + because we read EOF + +lib/readline/rltty.c + - rl_deprep_terminal: if bracketed paste mode is active, the last + character of the string to disable it is \r (to avoid confusing + the terminal driver about where the cursor is). In this case, + output a newline before returning so subsequent text (like the + `exit' bash prints) doesn't overwrite the prompt. Bug from + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903936 + +variables.c + - make_local_assoc_variable: add second argument like corresponding + local array function, to allow this function to return an existing + local array variable to the caller for the caller to handle + +variables.h + - make_local_assoc_variable: change function prototype to add second + arg + +{subst.c,variables.c} + - make_local_assoc_variable: change callers + +builtins/declare.def + - declare_internal: call make_local_assoc_variable with a non-zero + second arg to have it return an existing local array variable to be + flagged as an error. Fixes bug reported by Grisha Levit + + - declare_internal: call make_local_array_variable with unconditional + second argument of 1 for the same reason as above + + 7/18 + ---- +variables.c + - bind_invalid_envvar: new function, takes invalid names from the + initial environment (names that are not valid shell identifiers) and + stores them in a separate hash table (invalid_env) + - maybe_make_export_env: make sure to add names from invalid_env to + the export env + - assign_in_env: for now, prevent variable names that aren't shell + identifiers from being added to the temporary environment. Addresses + issue raised by Grisha Levit + +test.c + - unary_test: rearrange code slightly to avoid a wasted variable lookup + if the argument to -v is a subscripted array reference + + 7/19 + ---- +variables.c + - nameref_transform_name: if a name doesn't resolve to a shell variable, + this function will check whether it resolves to a nameref that + points to a variable that hasn't been created yet + +variables.h + - nameref_transform_name: extern declaration + +subst.c + - do_compound_assignment: make sure that we follow any nameref chain + if the name passed resolves to a nameref that points to a variable + that doesn't exist. Fixes issue raised by Grisha Levit + + +builtins/declare.def + - declare_internal: before calling any variant of make_local_variable, + make sure to perform any transformation of the name indicated by an + existing nameref. Fixes issue raised by Grisha Levit + + + 7/20 + ---- +builtins/declare.def + - declare_internal: if we are creating a global variable with -g, even + if we're not giving it a value, check for namerefs at the global + scope to avoid confusion with namerefs at the local (function) scope. + +subst.c + - expand_word_internal: if a double-quoted string expands to nothing, + make sure we note that for later by setting had_quoted_null, just + as we do for single-quoted empty strings + +subst.[ch] + - W_SAWQUOTEDNULL: new flag (replaces W_HASCTLESC, which is unused), + means that we saw a possibly-discarded quoted null while expanding + this word + +subst.c + - expand_word_internal: if expansion results in a non-empty word but + we saw a quoted null during expansion (had_quoted_null == 1), set + W_SAWQUOTED_NULL in the returned word + - expand_word_internal: if a recursive call to param_expand comes back + with W_SAWQUOTEDNULL set in the resulting word, set had_quoted_null + to note it + - parameter_brace_expand_rhs: if a recursive call to expand_word_internal + returns a non-quoted-null string (after an optional call to + string_list) make sure we pass the W_SAWQUOTEDNULL flag back to the + caller + - word_list_split: if a word expands to nothing after expansion and + splitting, but we saw a quoted null during the expansion + (W_SAWQUOTEDNULL), return an empty word + + 7/25 + ---- + +subst.c + - do_compound_assignment: if creating a local variable, make sure to + set `newname' to the name of the variable returned from find_variable, + since that follows namerefs. Fixes issue raised by Grisha Levit + + + 7/29 + ---- +subst.c + - get_var_and_type: if VALUE is NULL, check before calling dequote_string. + Report and fix from Grisha Levit + + 7/30 + ---- +variables.c + - make_local_{array,assoc}_variable: make sure we're not trying to + inherit a value from an incompatible array type. Fixes issue raised + by Grisha Levit + - nameref_transform_name: if we're trying to resolve a nameref that + will be used to create a local variable, make sure the nameref is + at the same variable scope. Report from Grisha Levit + + + 8/2 + --- +array.c + - array_subrange: change to use string_list_pos_params after creating a + WORD_LIST from the array slice, like assoc_subrange does + +subst.c + - parameter_brace_substring: since assoc_subrange and array_subrange + both call string_list_pos_params now, treat the results the same as + the VT_POSPARAMS case (pos_params also calls string_list_pos_params). + Fixes behavior difference between ${a[@]:sub} and ${@:sub} reported + by Ilkka Virta + + 8/3 + --- +array.c + - array_patsub: rewrite to work in terms of a WORD_LIST * and call + string_list_pos_params on the result to be consistent with the + expansions of ${@/pat/rep} and ${*/pat/rep} + +assoc.c + - assoc_patsub: rewrite to work in terms of a WORD_LIST * and call + string_list_pos_params on the result to be consistent with the + expansions of ${@/pat/rep} and ${*/pat/rep} + +subst.c + - parameter_brace_patsub: change how return value of {array,assoc}_patsub + is treated to make it identical to pos_params_pat_subst, since they + all call string_list_pos_params now + - expand_string_for_pat: make sure we preserve the value of + expand_no_split_dollar_star instead of just unconditionally setting + it back to 0 in case it was 1 before this function was called + + 8/6 + --- +array.c + - array_modcase: rewrite to work in terms of a WORD_LIST * and call + string_list_pos_params on the result to be consistent with the + expansions of ${@,,} and ${*,,} + +assoc.c + - assoc_modcase: rewrite to work in terms of a WORD_LIST * and call + string_list_pos_params on the result to be consistent with the + expansions of ${@,,} and ${*,,} + +subst.c + - parameter_brace_casemod: change how return value of {array,assoc}_modcase + is treated to make it identical to pos_params_modcase, since they + all call string_list_pos_params now + + 8/8 + --- +builtins/declare.def + - declare_internal: if we are making local variables, and not dealing + with the nameref attribute, make sure that any nameref variable we + followed when resolving the name given was at the same variable + context. If not, we just want to make or use a local variable with + the name passed; if so, we want to use the nameref value as the + variable name. Report from Grisha Levit + + 8/9 + --- +configure.ac + - globasciiranges: RRI now on by default, must be turned off explicitly + at configure time or runtime with `shopt -u globasciiranges' + + 8/14 + ---- +variables.c + - dispose_saved_dollar_vars: decrement stack pointer before looking + for saved positional parameters to dispose; stack pointer always + points to the first unused slot + + 8/15 + ---- +variables.c + - dollar_arg_stack: now a stack of struct saved_dollar_vars, which has + an array for the first ten (dollar_vars) and a WORD_LIST * for the + remaining (rest_of_args). Fixes performance issue with function calls + and large numbers of positional parameters raised by + Bize Ma + - {save,restore,free,free_saved}_dollar_vars: new functions to manage + dollar_vars and dollar_arg_stack members. Need to keep these in sync + with whatever remember_args does + - push_dollar_vars: use save_dollar_vars, which just copies pointers, + and directly assign rest_of_args, without copying the words, to the + dollar_arg_stack entry. Have to clear dollar_vars and rest_of_args + with the assumption that callers will call remember_args(args, 1) + immediately following + - pop_dollar_vars: free current positional parameters and restore old + ones from pointers saved in dollar_arg_stack, making sure to + invalidate any cached value for "$@" + - dispose_saved_dollar_vars: free saved pointers from current index + into dollar_arg_stack + +doc/{bash.1,bashref.texi} + - POSIXLY_CORRECT: make sure to note that bash makes sure this variable + is set when posix mode is enabled + + 8/17 + ---- +{jobs,nojobs}.c + - set_jobs_list_frozen: set jobs_list_frozen to a particular value. + Intended to save and restore the value around code sections instead + of unconditionally unfreezing it. + +jobs.h + - set_jobs_list_frozen: extern declaration + +execute_cmd.c + - execute_pipeline: if lastpipe is enabled, save and restore the + value of jobs_list_frozen using freeze_jobs_list/set_jobs_list_frozen + to avoid problems with race conditions and nested pipelines + causing jobs to be removed from the jobs table. Fixes savannah issue + https://savannah.gnu.org/support/index.php?109541 reported by + Björn Kautler + + 8/24 + ---- +execute_cmd.c + - lastpipe_cleanup: call set_jobs_list_frozen instead of + unfreeze_jobs_list + - execute_pipeline: set up lastpipe_cleanup with old value of + jobs_list_frozen + + 9/3 + --- +builtins/printf.def + - getuintmax,getfloatmax: on a conversion error, return as much of the + value as we were able to convert instead of 0. Fixes bug reported + by Robert Elz + + 9/4 + --- +lib/readline/text.c,lib/readline/rlprivate.h + - _rl_backward_char_internal: new function, guts of rl_backward_char + and rl_backward_byte, not currently used there + +lib/readline/vi_mode.c + - _rl_vi_advance_point: new function, move point forward by one + character, handling multibyte locales and characters and the end + of line semantics + - _rl_vi_backup_point: new function, move point backward by one + character, handling multibyte locales and characters + - rl_vi_eword,rl_vi_eWord: use rl_vi_advance_point instead of a simple + increment to handle multibyte characters. Fixes bug reported by + Enrico Maria De Angelis + + 9/5 + --- +lib/readline/vi_mode.c + - rl_vi_fword,rl_vi_fWord: use rl_vi_advance_point instead of a simple + increment to handle multibyte characters + - rl_vi_bword,rl_vi_bWord: use rl_vi_backup_point instead of a simple + decrement (and _rl_vi_advance_point where necessary) to handle + multibyte characters + - rl_vi_complete,_rl_vi_change_mbchar_case,_rl_vi_domove_motion_cleanup: + use _rl_vi_advance_point instead of simple rl_point increment + - vi_delete_dispatch,vi_change_dispatch,vi_yank_dispatch: use + INCREMENT_POS instead of a simple increment to rl_mark to handle + multibyte characters + - rl_vi_column: use _rl_forward_char_internal, starting with + rl_point == 0, to handle multibyte characters (Posix says `character + position', not index) + + 9/7 + --- +configure.ac + - changed release status to `beta' + + 9/9 + --- +lib/readline/display.c + - _rl_update_final: if the bottom line has zero characters and we are + on that line at column 0, don't bother with an additional \r\n. + Fixes redisplay nit reported by Per Bothner + + +configure.ac + - openbsd needs DEV_FD_STAT_BROKEN defined + +[bash-5.0-beta frozen] + + 9/11 + ---- +builtins/exec.def + - exec_builtin: make sure to sync the buffered stream where bash is + reading input (especially if it's fd 0) so a command exec'd by the + script can read the rest of stdin after the exec + + 9/15 + ---- +lib/readline/histexpand.c + - history_tokenize_internal: if the event contains embedded newlines + (e.g., bash with command-oriented history and lithist), use them as + word delimiters, equivalent to space and tab, so they don't end up + as separate words. Fixes issue pointed out by Viktor Dukhovni + + - history_tokenize_word: don't break if we get a newline (though we + shouldn't get one due to the loop in history_tokenize_internal + - history_expand_internal: use newline as a whitespace character when + expanding by words, as we do with history_tokenize_internal + +jobs.h + - J_PIPEFAIL: new flag for `flags' element of job struct + +jobs.c + - stop_pipeline: if pipefail_opt set, newjob gets J_PIPEFAIL in its + flags word + - raw_job_exit_status: use J_PIPEFAIL (setting of pipefail when job + created) instead of current setting of pipefail status to determine + how to compute exit status of pipeline. Tentative implementation of + Posix proposal + +expr.c + - exp0: don't call expr_bind_variable with a NULL string. Fixes + fuzzing bug reported by Eduardo Bustamante + - expr_bind_variable: don't try to do anything with a NULL or empty + LHS + + 9/16 + ---- +lib/readline/undo.c + - rl_do_undo: before we release the undo list entry we've just + processed, make sure we avoid any pointer aliasing issues caused + by having the entry being removed as part of the undo list in + _rl_saved_line_for_history. Fixes fuzzing bug reported by + Eduardo Bustamante + + 9/17 + ---- +[bash-5.0-beta released] + + 9/18 + ---- +lib/readline/bind.c + - name_and_keymap: new struct for keymap names and maps + - builtin_keymap_names: static array of builtin keymap names and + maps; preparing for allowing applications to set the names of + keymaps they create; keymap_names is initially a pointer to + this array + - _rl_get_keymap_by_name,_rl_get_keymap_by_map: new functions for + searching the keymap_names array and returning an index + - rl_get_keymap_by_name, rl_get_keymap_name: rewritten in terms of + new functions above + - rl_set_keymap_name (char *name, Keymap map): new function, set + name of MAP to NAME. NAME must not be builtin; MAP must not be one + of the builtin keymaps. Request and initial implementation from + Tom Tromey + +lib/readline/readline.h + - rl_set_keymap_name: new extern declaration for new public function + +lib/readline/doc/rltech.texi + - rl_set_keymap_name: add documentation + +lib/readline/doc/rluser.texi + - add text to `set keymap' description to note that applications + can add keymap names that can be used there + + 9/20 + ---- +parse.y + - shell_getc: don't execute the alias hack (returning a space at the + end of the string) if we are parsing a command substitution that + starts with a double paren (subshell inside a comsub), in which + case the flags are PSH_DPAREN. Fixes fuzzing bug reported by + Eduardo Bustamante + +lib/readline/isearch.c + - _rl_isearch_dispatch: default case: make sure we check multibyte + char length when deciding whether to enlarge the search string + buffer, instead of using the old assumption. Fixes fuzzing bug + reported by Eduardo Bustamante + +builtins/fc.def,execute_cmd.c + - fixed some missing free()s uncovered by coverity. Report from + Siteshwar Vashisht + +lib/glob/glob.c + - glob_vector: make sure name_vector is initialized to NULL + +lib/sh/{pathcanon,pathphys}.c + - {pathcanon,pathphys}: use memmove instead of strcpy on a possibly- + overlapping region of memory + +subst.c + - parameter_list_transform: make sure to dispose the word list in all + cases before returning + - parameter_brace_expand_rhs: make sure t1 is freed before returning + due to an invalid name resulting from an indirect expansion + +support/man2html.c + - fixed a couple of memory leaks + + 9/21 + ---- +subst.c + - process_substitute: if we are part of a job control process chain + (pipeline_pgrp != shell_pgrp), have the child shell forked to run + the process substitution set pipeline_pgrp to its own PID, + effectively becoming a process group leader without changing + its own process group. Fixes stray SIGHUP issue reported by + Jeremy Townshend + + 9/23 + ---- +arrayfunc.c + - assign_array_element: if we are assigning to an existing associative + array, and assoc_expand_once is set, allow `*' and `@' as subscripts. + Partial fix for report from Grisha Levit + +variables.c + - bind_int_variable: if valid_array_reference (lhs) is not true, + make sure that the lhs is a valid identifier before assigning the + value + +arrayfunc.c + - valid_array_reference: allow blank subscripts. They are treated as + `normal' keys for associative arrays and evaluate to 0 for indexed + arrays. More of fix for report from Grisha Levit + + + 9/24 + ---- +bashline.c + - restore_tilde: if the expanded length (xl) is longer than vl + we end up requesting a negative amount of memory (an extremely + large unsigned number). Just punt and return val in this case. + Fuzzing bug reported by Eduardo Bustamante + - restore_tilde: make sure we return what the user typed if tilde + expansion fails + + 9/29 + ---- +builtins/shopt.def + - uncomment `localvar_unset' option definition + +doc/{bash.1,bashref.texi} + - document `localvar_unset' shell option + +arrayfunc.c + - valid_array_reference: if we are parsing a subscript for an existing + associative array, the `assoc_expand_once' option is set, and the + VA_ONEWORD flag is set in FLAGS (meaning there should be nothing + following the closing `]'), don't call skipsubscript to find the + closing `]', use one that is at the end of the word. Part of fix for + issue reported by Grisha Levit + +builtins/{printf,set}.def + - pass VA_ONEWORD as part of flags value everywhere valid_array_reference + is used + +config-top.h + - CHECKWINSIZE_DEFAULT: now 1, so check_window_size is on by default + - HISTEXPAND_DEFAULT: new define, allows builder to enable or disable + history expansion by default at build time + +doc/{bash.1,bashref.texi} + - checkwinsize: document new default value + +bashhist.h + - HISTEXPAND_DEFAULT: don't define if it's already defined. Strict + POSIX mode continues to default to off + + 9/30 + ---- +lib/readline/input.c + - win32_isatty: win32-specific changes from GDB. Patch submitted by + Tom Tromey , originally from Eli Zaretskii + + + 10/1 + ---- +lib/readline/vi_mode.c + - rl_vi_start_inserting: start an undo group so we can grab the text + inserted here as a single unit, avoiding any insert coalescing + performed by rl_insert_text. Report and fix from Richard Todd + + + 10/3 + ---- +subst.c + - parameter_brace_transform: if we're asked to display the attributes + of an unset variable, check that the variable exists even if + get_var_and_type returns NULL (it checks invisible_p). Requested by + Michal Pesa + +lib/readline/kill.c + - _rl_bracketed_text: new function, collects the text pasted in + bracketed paste mode and consumes the bracketed paste end marker; + returns the pasted text and its length + - rl_bracketed_paste_begin: call _rl_bracketed_text to collect the + text + +lib/readline/isearch.c + - _rl_isearch_dispatch: set cxt->lastc to -7 if the input resolves to + rl_bracketed_paste_begin + - _rl_isearch_dispatch: if cxt->lastc == -7, call _rl_bracketed_text + to collect the pasted text and add it to the accumulating search + string. Only works if ESC is not one of the isearch terminators. + Fixes issue reported in Debian bug report 891780, + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891780 + + 10/5 + ---- +variables.c + - push_posix_tempvar_internal: new function, body of push_func_var + with additional argument saying whether it's being called from a + function or (special) builtin code path + - push_builtin_var: new function, calls push_posix_tempvar_internal + with second argument indicating builtin code path + - push_func_var: now a stub that calls push_posix_tempvar_internal + with second argument indicating function code path + - pop_scope: if called from a special builtin, call push_builtin_var + instead of push_func_var to do the right variable propagation + +builtins/shopt.def + - progcomp_alias: uncomment, make available to users + +doc/{bash.1,bashref.texi},lib/readline/doc/rluser.texi + - progcomp_alias: document shopt option, describe its use in + the section on programmable completion + +trap.c + - decode_signal: handle SIGRTMIN+n at runtime, with the `SIG' prefix + or without, case-insensitively if requested, and return SIGRTMIN+n. + These values could be different than what was available at compile + time. Report and patch from Rasmus Villemoes + + 10/8 + ---- +execute_cmd.c + - execute_command_internal: only set line_number from command->value.Subshell + if the type == cm_subshell; otherwise defer and set later + + 10/10 + ----- +examples/loadables/seq.c + - seq: new loadable builtin, derived originally from coreutils:seq.c + but with very little of that code remaining + + 10/12 + ----- +trap.c + - run_pending_traps,_run_trap_internal: honor evalnest_max and + increment/decrement evalnest accordingly, since trap actions + are processed as if run by `eval'. Feature suggsted by Mike + Gerwitz + + 10/16 + ----- +expr.c + - expr_skipsubscript: new function, calls skipsubscript with flags + similar to arrayfunc.c:valid_array_subscript if assoc_expand_once + is set and it looks like we've already expanded the subscript of + an associative array. Reported back on 8/27 by Grisha Levit + + - readtok: call expr_skipsubscript instead of skipsubscript + +arrayfunc.c + - valid_array_reference: call skipsubscript with a third arg computed + from the VA_NOEXPAND flag only if we're expanding an associative + array subscript -- we already figure out whether or not we are + +[bumped release status to beta2] + + 10/20 + ----- +builtins/setattr.def + - set_or_show_attributes: after isolating NAME, make sure to restore + the "[+]=" in case we need the word later. Issue pointed out by + Grisha Levit + + 10/21 + ----- +lib/readline/search.c + - noninc_search_from_pos: if we are supposed to be searching for a + pattern (vi mode), make sure to pass S to _hs_history_patsearch, + since that has any leading `^' stripped + +lib/readline/histsearch.c + - _hs_history_patsearch: if the search isn't anchored, put a `*' at + the beginning to force fnmatch to match anywhere in the line (could + look at this later to make a change to history_search_internal that + would avoid the need to add the leading `*') + +subst.c + - parameter_brace_expand_rhs: treat a failure to assign a variable with + a ${param:=value} expansion as an expansion error, and, in a non- + interactive posix-mode shell, exit the shell + - param_expand: don't set W_SPLITSPACE for $* unless IFS is NULL; + consistent with other uses of W_SPLITSPACE + + 10/22 + ----- +doc/{bash.1,bashref.texi} + - tweak description of bash conditional expressions to note that the + test and [ commands determine their behavior based on the number of + arguments. Suggested by Ilkka Virta + + 10/24 + ----- +execute_cmd.c + - execute_simple_command: don't set $_ to NULL when executing a + command that forks; just leave it unchanged. Tweaked the documentation + slightly as a result. Inspired by report from Ricky Tigg + + + 10/28 + ----- +redir.c + - here_document_to_fd: make sure the temp files used to store here + documents are readable (and writable, where necessary) by the user. + This can happen in the unlikely case that someone decides to shoot + himself in the foot by setting the umask to 400. Issue originally + raised back in March by Stephane Chazelas + ; fix inspired by Martijn Dekker + + + 10/29 + ----- +lib/readline/terminal.c + - bind_termcap_arrow_keys: bind the "kI" capability (what the Insert + keypad key outputs) to overwrite mode. Patch from Xose Vazquez Perez + + + 10/30 + ----- +braces.c + - mkseq: make sure to terminate result array before passing it to + strvec_dispose on an interrupt. Report and fix from Corbin Souffrant + + + 11/6 + ---- +trap.c + - _run_trap_internal: if the signal shows up as SIG_CHANGED after + running the trap handler, check for terminating signals and run any + terminating signal handler indicates. Fixes issue reported by + Owen Stephens + + 11/7 + ---- +execute_cmd.c + - execute_builtin: don't merge the temporary environment when the + `return' builtin is being executed if it's being executed by the + `command' builtin, since that's supposed to inhibit the special + builtin properties. Part of POSIX conformance problems reported + by Martin Rehak + +builtins/cd.def + - bindpwd: if canonicalization fails when -P is specified (e.g. if the + directory name length exceeds PATH_MAX), reset dirname ($PWD value) = + to the_current_working_directory (Posix cd description, step 10.) + Part of POSIX conformance problems reported by Martin Rehak + + +builtins/kill.def + - kill_builtin: support -sSIG and -nSIG without requiring them to be + separate arguments. POSIX says a "conforming implementation" should + accept them. + Part of POSIX conformance problems reported by Martin Rehak + + + 11/8 + ---- +arrayfunc.c + - array_value_internal: return NULL for invisible array variables. + Fixes issue with FUNCNAME sometimes returning invalid value reported + by Great Big Dot + +builtins/cd.def + - change_to_directory: if we are in posix mode, and the chdir to the + absolute pathname ($PWD/dirname) fails, return an error without + trying to use just `dirname' (posix cd step 10). + Part of POSIX conformance problems reported by Martin Rehak + + +execute_cmd.c + - execute_case_command: use expand_word_leave_quoted to expand the + word, then dequote the resulting string. This performs the + expansions in the order posix specifies. + Part of POSIX conformance problems reported by Martin Rehak + + +subst.c + - expand_word_unsplit: rewrite in terms of expand_word_leave_quoted + - ifs_whitespace: new macro, Posix ifs whitespace (ISSPACE; member + of current locale's space char class) + - ifs_whitesep: new macro, whitespace that is a member of $IFS; used + by list_string and get_word_from_string + - list_string: use ifs_whitesep instead of spctabnl in case $IFS + contains whitespace characters that are not space, tab, or newline + - get_word_from_string: use ifs_whitesep instead of spctabnl in case + $IFS contains whitespace characters that are not space, tab, or + newline. + Part of POSIX conformance problems reported by Martin Rehak + + + 11/9 + ---- +general.c + - posix_initialize: enable the shift_verbose option when turning on + posix mode, and disable it when posix mode is disabled. From a + report by Eric Blake + +doc/bashref.texi + - posix mode: note the effect of posix mode on shift_verbose + + 11/12 + ----- +subst.c + - parameter_brace_expand: if parameter_brace_expand_word returns an + error, make sure to set TEMP = 0 (to note that the variable is unset). + From a report by Grisha Levit + - param_expand: if expanding $! when set -u is enabled, honor the + PF_IGNUNBOUND flag and just return NULL, relying on the caller to + take care of understanding that the variable is unset + From a report by Grisha Levit + - parameter_brace_expand: if we are checking nullness, and we have a + valid array expansion, a quoted null string resulting from the array + expansion of a * or @ subscript satisfies the nullness check. + From a report by Grisha Levit + + 11/14 + ----- +aclocal.m4 + - BASH_CHECK_LIB_TERMCAP: add last-ditch check for libncursesw, since + it's apparently the only curses library on some distributions. + Report from John Frankish + + 11/16 + ----- +bashline.c + - attempt_shell_completion: allow an initial word completion to + complete a partial first word (point appears in the middle of + the word) before resorting to command completion. Report and fix + from Luca Boccassi + +[bash-5.0-beta2 frozen] + + 11/27 + ----- +bashline.c + - attempt_shell_completion: better fix for problems with fix from + 11/16. Report and fix from Tom Ryder + +expr.c + - expr_skipsubscript: fix return type. Report and fix from + Andreas Schwab + + 11/29 + ----- +subst.c + - quote_escapes_internal: refactored quote_escapes into a function + that takes an additional flag saying whether or not we are going + to split the result. If we are not, and CTLESC is in IFS, we quote + the CTLESC (ditto for CTLNUL) to prevent it being removed when the + string is dequoted. + - quote_escapes: call quote_escapes_internal with FLAGS == 0 + - quote_rhs: new function, calls quote_escapes with FLAGS == PF_NOSPLIT2 + so that a CTLESC will be quoted if CTLESC is in $IFS + - parameter_brace_expand_word: call quote_rhs on the value of a variable + if PFLAGS includes PF_ASSIGNRHS, indicating that we will not be + splitting the word, but we will be dequoting it. Fixes bug reported + by Martijn Dekker + - param_expand: same change as for parameter_brace_expand_word + +execute_cmd.c + - execute_in_subshell: if we are running a trap (running_trap > 0), + turn off the SIG_INPROGRESS and SIG_CHANGED flags for that signal + by calling run_trap_cleanup and reset running_trap to 0 (watch the + second part!). Tagged for bash-5.1. + + 11/30 + ----- +lib/readline/doc/rltech.texi + - rl_set_keymap_name: correct typo in the name; some updates to the + description that clarify usage. Report from + + 12/4 + ---- +aclocal.m4 + - BASH_FUNC_FNMATCH_EQUIV_FALLBACK: a test of whether fnmatch(3) + understands bracket equivalence classes ([=c=]) for characters + that collate with equal weights but are not identical + +configure.ac,config.h.in + - call BASH_FUNC_FNMATCH_EQUIV_FALLBACK and define + FNMATCH_EQUIV_FALLBACK to 1 if it can be used for equivalence + classes + + 12/5 + ---- +execute_cmd.c + - eval_arith_for_expr,execute_arith_command,execute_cond_command: make + sure running_trap == 0 before we reset the_printed_command_except_trap + Report from Peng Yu + +lib/glob/smatch.c + - _fnmatch_fallback_wc: new function, takes two wide characters c1 and + c2, converts them to a pattern ([[=c2=]]) and a string (c1) for + fnmatch to determine whether or not they are members of the same + equivalence class + - collequiv_wc: call _fnmatch_fallback_wc if rangecmp_wc returns + non-zero if FNMATCH_EQUIV_FALLBACK is defined, so we know that + fnmatch understands equivalence classes. Another Posix test suite + issue from Martin Rehak + + 12/6 + ---- +redir.c + - add missing cases to switch statements to shut up gcc + + 12/7 + ---- +builtins/set.def + - find_minus_o_option: new helper function, returns index into + o_options given option name + - minus_o_option_value,set_minus_o_option: use find_minus_o_option + +general.c + - new table of variables (currently all shopt options) that are + modified by going into and out of posix mode; num_posix_options() + returns the number of variables + - get_posix_options: fill in a bitmap passed as an argument (or return + a new one) of values of posix-mode-modified variables in the table + - set_posix_options: set values of posix-mode-modified variables from + the table using the passed bitmap for values + +builtins/set.def + - get_current_options: make the bitmap large enough to hold the options + in the set table and the table of posix-mode-modified variables; call + get_posix_options to fill in those values after the values from the + o_options table + - set_current_options: call set_posix_options to reset the values of + the posix-mode-modified variables at the end of the bitmap, after + the o_options values. Fixes issue reported by PJ Eby + + + 12/9 + ---- +parse.y + - select_command: add two additional productions to support select + commands without a word_list following the `in'. Fixes omission + reported by Martijn Dekker + + 12/11 + ----- +variables.c + - assign_in_env: don't allow namerefs in temporary environment + assignments to create variables with invalid names for export. Fixes + bug reported by Grisha Levit + + 12/14 + ----- +parse.y + - don't change last_command_exit_value in the 'error yacc_EOF' production + if the parser sets it to something non-zero; just make sure it + indicates an error. Fixes problem with unexpected EOF in eval + reported by Martijn Dekker + + 12/17 + ----- +expr.c + - exp2 -> expmuldiv + +lib/sh/smatch.c + - fnmatch: add extern declaration if FNMATCH_EQUIV_FALLBACK is being + used + +hashlib.c + - hash_string: add FNV offset as initial value for hash instead of + starting at 0, changes hash for associative arrays and requires a + bunch of changes to the "right" test suite files + +variables.c + - rseed: make it explicitly 32 bits; that's all we're interested in + anyway + + 12/18 + ----- + +variables.c + - brand: add some comments, make the constants explicitly 32 bits; + use signed 32-bit values for the intermediate calculations. The + algorithm is still minstd + +[bash-5.0-rc1 frozen] + + 12/21 + ----- +doc/bash.1 + - }1: remove macro definition; it's outlived its bugfix purpose. + Report from Derek Schrock + + 12/22 + ----- +subst.c + - expand_arith_string: set W_NOTILDE in the flags so we don't perform + tilde expansion at all, even for the previously-special-case array + subscript expansion. Report from Bize Ma + - expand_word_internal: take out Q_ARRAYSUB check for tilde expansion + + 12/26 + ----- +builtins/evalstring.c + - parse_and_execute: if the eval builtin gets a parser error while + parsing a string in posix mode, don't exit the shell if the eval + was run by the command builtin. report from Martijn Dekker + + +examples/loadables/{basename,dirname}.c + - dirname_builtin: skip over any `--' ending the options. Report from + Peng Yu + + 12/27 + ----- +examples/loadables/mkdir.c + - make_path: add argument noting whether or not the user specified -m; + only attempt the chmod on an existing directory if the user did so + - make_path: when creating intermediate directories, perform the + mkdir (path, 0) and chmod separately as the posix text recommends + + 12/28 + ----- +parser.h + - PST_COMMENT: new state, set when the shell is reading characters + until newline as part of comment processing + +parse.y + - shell_getc: don't return a space at the end of a token if the parser + is consuming a comment. Fixes bug reported by Harald van Dijk + + + 12/31 + ----- +lib/glob/glob_loop.c + - INTERNAL_GLOB_PATTERN_P: revert change from 4/27 that makes this + function return non-zero for a backslash in the string. Based on a + report from Tom Ryder + +[bash-5.0 frozen] + +[bash-5.0 released] + + 1/6/2019 + -------- + +examples/loadables/basename.c + - make sure to include bashgetopt.h. Reported by Angel + + +lib/malloc/malloc.c + - stdlib.h: include if botch isn't defined to provide a declaration + for abort() + +hashlib.c,Makefile.in + - fixes to make hash library testing work for others from + Eduardo Bustamante + +lib/readline/unicode.c + - u32toutf16: correct the second argument to be wchar_t *, and treat + it as such, even though it doesn't make a difference in practice. + Report and fix from Eduardo Bustamante + + 1/8 + --- + +builtins/return.def + - return_builtin: return EX_USAGE if we're not executing a shell + function or sourcing a script, so a posix-mode shell exits. Fixes + bug reported by Robert Hailey + +builtins/declare.def + - declare_internal: don't let `declare -f +f' turn off the function + attribute. Fix from Grisha Levit + - declare_internal: reject attempts to add the -A or -a attributes + to functions. Report from Grisha Levit + + 1/9 + --- +bashline.c + - completion_glob_pattern: new function, returns true if the passed + string contains a glob pattern that should be process by the glob + completion code. Completion glob patterns don't pay attention to + backslashes unless they're the last character in the string. This + is a different, more self-contained, fix for the problem reported + by Tom Ryder + +lib/glob/glob_loop.c + - INTERNAL_GLOB_PATTERN_P: restore change from 4/27 and make this + function return non-zero if it encounters a backslash in the string. + It needs to match pathexp.c:unquoted_glob_pattern_p(). Adds fix + back for issue reported by axel@freakout.de + +test.c + - arithcomp: when calling evalexp, make sure to call it with the + EXP_EXPANDED flag, since all arguments here have been evaluated + already + +arrayfunc.c + - array_expand_index: call evalexp with EXP_EXPANDED flag, since we + have run the string through expand_arith_string already + + 1/11 + ---- +parser.h + - PST_ENDALIAS: new state, means we just consumed the last character + of an alias expansion and returned the fake space + +parse.y + - shell_getc: add PST_ENDALIAS to parser_state before returning the + fake space that marks the end of the alias, making sure to do it + only once. With that set, fall through to the pop_string(), making + sure to unset PST_ENDALIAS. Fixes alias bug reported by + Ante Peric + + 1/12 + ---- +lib/glob/glob.c + - {extglob,wextglob}_skipname: make sure we check the rest of the + pattern if the extglob pattern is null, and therefore won't match + anything. If that is followed by a `.', quoted or unquoted, we can + match a leading `.' in the pathname. This code is currently not + active. + +builtins/hash.def + - hash_builtin: if -d is supplied without an argument, print an error + message and return failure, just like -t without an argument. Fixes + inconsistency reported by Dan Jacobson + + 1/13 + ---- +parse.y + - shell_getc: use shellblank when testing the last character of an + alias to determine whether or not to add a trailing space instead + of testing against a space only. These are the non-shell-metacharacters + that can delimit words. Used together with PST_ENDALIAS + + 1/17 + ---- +parse.y + - shell_getc: keep track of whether the last character read from + shell_input_line is an unquoted backslash and don't add a space to + the end of an alias if the alias value ends in an unquoted backslash. + From an austin-group mailing list discussion message from + Harald van Dijk + + 1/20 + ---- +general.c + - check_identifier: make sure CHECK_WORD is non-zero before we check + whether or not the word consists of all digits. This allows function + names to consist solely of digits when not in posix mode. From a + report by Andrey Butirsky + + 1/22 + ---- +bashline.c + - initialize_readline: only unbind ^E in vi_movement_keymap if it's + still bound to the default rl_emacs_editing_mode. Fixes bug + reported by Greg Bell + + 1/23 + ---- +builtins/shopt.def + - we need the extern declaration for syslog_history if SYSLOG_HISTORY + is defined, since it's used even if SYSLOG_SHOPT is not defined. + From a Gentoo Linux bug report, eventually reported to bug-bash by + Tomas Mozes + + 1/25 + ---- +command.h + - CMD_TRY_OPTIMIZING: new command flag, means this (simple) command is + a candidate for fork optimization (suppression) + +builtins/evalstring.c + - can_optimize_connection: new function, takes an AND_OR list (&& or + ||) from parse_and_execute, makes sure it's the last in a possibly + multi-command list, and returns non-zero if it's a simple command, + indicating that it's a candidate for fork optimization. + - parse_and_execute: if we have a cm_connection command, call + can_optimize_connection to determine if it's a suitable candidate + and set CMD_TRY_OPTIMIZING if that returns non-zero + - optimize_fork: don't bother unless the rhs of the && or || command + has the CMD_TRY_OPTIMIZING flag set. These fix the bug reported by + Brad Spencer + +execute_cmd.c + - execute_connection: case AND_AND and OR_OR: call optimize_fork on + the right side of the command before executing `second'. This will + safely restore the fork optimization we removed from + parse_and_execute() + +builtins/complete.def + - build_actions: make sure the function name argument to -F is a + valid shell function name: it doesn't contain any invalid posix- + mode characters and doesn't contain any shell break characters that + would need to be quoted when defining a function. Fixes issue + reported by Great Big Dot + + 1/28 + ---- +variables.c + - dispose_temporary_env: make sure to save temporary_env to a temp + pointer and set temporary_env to NULL before trying to dispose it, + so no flush function ever tries to add a temporary variable back + into the table (e.g., bind_variable()) + + 1/29 + ---- +builtins/evalstring.c + - can_optimize_connection,optimize_fork: add the last command in lists + separated by `;' to the list of candidates for fork optimization + + 1/30 + ---- +examples/loadables/strftime.c + - strftime_builtin: try to extend the buffer longer than tbsize*3, + which is a minimum of 24 characters, in case some of the formats + (e.g., %c) expand to something longer than that. Fixes bug + reported by Stan Marsh + + 1/31 + ---- +lib/readline/undo.c + - rl_do_undo: before inserting text while undoing UNDO_DELETE, or + performing a deletion while undoing UNDO_INSERT, make sure that + rl_point is valid by calling _rl_fix_point. Fuzzing bug and fix + from Eduardo Bustamante + +lib/readline/search.c + - _rl_nsearch_abort: validate new values for rl_point and rl_mark by + calling _rl_fix_point(). Fuzzing bug and fix from + Eduardo Bustamante + +subst.c + - string_extract_double_quoted: if we parse a syntactically-incorrect + $( expression while extracting a double-quoted string, si will + appear to go `backward'. Just skip over the rest of the string and + continue. Fuzzing bug from Eduardo Bustamante + +lib/readline/text.c + - rl_change_case: if towupper or towlower returns a valid wide char + that can't be converted back to a valid multibyte character, use + the original character and go on. Fuzzing bug from + Eduardo Bustamante + +lib/glob/glob.c + - wdequote_pathname: if there are no multibyte characters in pathname, + just call udequote_pathname and don't bother converting it to wide + characters + - glob_pattern_p: if there are no multibyte characters in the pattern, + just call internal_glob_pattern_p right away + +lib/glob/glob_loop.c + - INTERNAL_GLOB_PATTERN_P: return 2 if we see only backslash-quoted + characters without any other unquoted glob pattern characters, so + interested callers can shortcut and just dequote the pathname + +pathexp.c + - unquoted_glob_pattern_p: return 2 if we see only backslash-quoted + characters without any other unquoted glob pattern characters, + consistent with the glob library + - unquoted_glob_pattern_p: don't count a backslash quoting a slash as + a backslash that will trigger a call to shell_glob_filename, since + backslashes at the end of patterns (pathname components) will always + fail to match. XXX - this is provisional + +lib/glob/glob.c + - glob_filename: if we have a directory name that has no unquoted + special glob chars, but has backslashes, just dequote it and return + it without going through the rest of the glob expansions. Partial + fix for issue with unreadable directories reported by + Andrew Church + + 2/2 + --- +lib/readline/readline.c + - readline_internal_teardown: if revert-all-at-newline is set, make + sure that the history position is at the end of the history before + calling _rl_revert_all_lines(). Fixes bug reported by + johnlinp@gmail.com and frederik@ofb.net + + 2/4 + --- +builtins/complete.def + - complete_builtin: fix check for argument to -F to use strpbrk + instead of incomplete use of strcspn. Fix from Grisha Levit + + + 2/5 + --- +lib/readline/readline.c + - rl_parse_and_bind: change parsing of boolean variable values to + look for and consume an optional whitespace-delimited word. This + allows trailing spaces and everything that follows to work. Idea + from Bize Ma + - rl_parse_and_bind: print error message about unknown variable names + instead of calling rl_variable_bind to do it + - rl_variable_bind: report error if setting string variable returns + non-zero + + 2/6 + --- +lib/readline/histfile.c + - read_history_range: close FILE before returning if the history file + size is 0 + + 2/11 + ---- +bashline.c + - edit_and_execute_command: add the current line buffer to the history + list even if it's empty and rely on other code in bash_add_history + to take care to not add multiple semicolons with multiple blank + lines and command_oriented_history. Live with the blank lines as + history entries for now. Fixes problem reported by + Johannes Hielscher + +lib/readline/misc.c + - _rl_revert_all_lines: renamed to _rl_revert_previous_lines, since + that is basically what it does + - _rl_revert_all_lines: now just makes sure the history offset is at + the end of the history and calls _rl_revert_previous_lines. Inspired + by a suggestion from johnlinp@gmail.com + +lib/readline/readline.c + - readline_internal_teardown: revert change of 2/2, moved that code + into the (new) _rl_revert_all_lines + +lib/readline/rlprivate.h + - _rl_revert_previous_lines: new extern declaration + +builtins/bind.def + - bind_builtin: make sure the unwind-protect gets run when the --help + option is used, so use `case GETOPT_HELP:' instead of `CASE_HELPOPT;'. + Report and fix from Koichi Murase + + 2/12 + ---- +lib/readline/util.c + - _rl_abort_internal: don't just turn off the MACRODEF state, call + _rl_kill_kbd_macro to delete any traces of an in-progress macro + definition before turning it off. Fixes fuzzing bug. + + 2/13 + ---- +examples/loadables/Makefile.in + - CCFLAGS: add $(CPPFLAGS) to value, based on a report from + Christian Weisgerber + + 2/15 + ---- +bashline.c + - posix_readline_initialize: keep track of the vi insertion keymap + binding for TAB, since we change it in this function. Save the + old binding before we change it when turning posix mode on, and + restore that old binding when turning posix mode off, as long as + the current binding is still rl_insert. Suggested by a report from + Koichi Murase + + 2/17 + ---- +builtins/exec.def + - exec_builtin: save value of job_control; use it to restore the value + of job_control if an exec fails in an interactive shell instead of + enabling it by default in an interactive shell. Report from + Grisha Levit + +lib/readline/bind.c + - _rl_function_of_keyseq_internal: make sure to use checks against LEN + instead of a NULL character in KEYSEQ to determine the length of the + key sequence. + Report and fix from Koichi Murase + - rl_bind_key: make sure the KEY argument is not larger than the + largest unsigned character. + Report and fix from Koichi Murase + - rl_translate_keyseq: make sure that M-x correctly adds "\ex" to the + key sequence array when convert-meta is set. + Report and fix from Koichi Murase + - rl_translate_keyseq: now unconditionally converts meta characters to + ESC-prefixed key sequences when processing \0nnn \Xnnn and \[char] + escape sequences that resolve to meta characters and for `normal' + characters that have the meta bit set + Report and fix from Koichi Murase + +jobs.c + - end_job_control: if the terminal pgrp (terminal_pgrp) is not the same + as the original pgrp (original_pgrp), set the terminal's pgrp to the + original pgrp so when we reset the shell's pgrp to original_pgrp, + we'll continue to be able to read from the terminal if the shell is + interactive. Fixes bug with turning off job control before starting + an interactive shell reported by Grisha Levit + + + 2/19 + ---- + +jobs.c + - end_job_control: if the setpgid(0, ...) succeeds, reset the value of + shell_pgrp. Fixes pgrp mismatch after failed exec in an interactive + login shell reported by Grisha Levit + + 2/20 + ---- +bashhist.c + - pre_process_line: save history_length before calling history_expand, + and after possibly decrementing history_length, just restore the old + value instead of incrementing it. Fixes bug reported by + Michael Albinus + - bash_add_history: don't bother calling really_add_history if the + history is stifled and the max number of entries is 0 + +aclocal.m4,configure.ac,m4/*.m4 + - replace the old set of gettext m4 macros with the latest m4 files + from the gnulib and gettext distributions + + 2/21 + ---- +builtins/cd.def + - bindpwd: initialize canon_failed to 0 to prevent `cd -e' from always + failing + +command.h + - W_EXPANDRHS: new flag, set when expanding WORD in ${paramOPword} + +subst.c + - expand_string_for_rhs: set W_EXPANDRHS in word to be expanded + +subst.c + - expand_word_internal: when encountering a single or double quoted + string that expands to nothing, add a CTLNUL if the W_EXPANDRHS + flag is set and the word isn't quoted, indicating that the word + will eventually be split and we need to preserve the null to + produce an empty word. From a discussion on bug-bash started by + sunnycemetery@gmail.com + + 2/22 + ---- +bashline.c + - completion_glob_pattern: make sure to skip over a character quoted + by a backslash. Fixes bug reported by John Van Sickle + + + 2/23 + ---- +lib/readline/complete.c + - last_completion_failed: keep track of whether the last completion + attempt generated any matches + - rl_complete: if the last readline command was completion, but the + completion attempt didn't generate any matches, don't regenerate + and display the match list. Treat it as a new completion attempt. + Suggested by Richard Stallman + +bashhist.c + - maybe_append_history: try to handle the case where the number of + history entries in the current shell session is greater than the + number of entries in the history list. Based on a report from + + + 2/25 + ---- +aclocal.m4 + - BASH_FUNC_FNMATCH_EQUIV_FALLBACK: use en_US.UTF-8 instead of + de_DE.UTF-8; it's more likely to be installed + + 2/26 + ---- +doc/{bash.1,bashref.texi} + - extdebug: make sure to note that setting this option in a startup + file causes an attempt to start the debugger. Noted by Linda + Walsh + +builtins/fc.def + - fc_builtin: if we are not listing, and delete the last history entry, + make sure that histbeg or histend, whichever is greater, is clamped + at the value of last_hist to avoid dereferencing the just-removed + history index. Fixes bug reported by Chris King-Parra + + + 2/27 + ---- +shell.c + - init_interactive: assignment to histexp_flag should be protected by + #ifdef BANG_HISTORY. https://savannah.gnu.org/patch/?9759 + +subst.c + - list_string: if we have a non-null string, but quoted null character + removal leaves an empty string, set W_SAWQUOTEDNULL in the returned + word flags so the caller can deal with it + - parameter_brace_expand_rhs: deal with word with null or empty word + and W_SAWQUOTEDNULL in the flags coming back from expand_string_for_rhs + by turning it into a quoted null word and modifying the flags. Part + of fix for bug report from Grisha Levit + - expand_word_internal: if a double-quoted string comes back with a + quoted null as the expansion of "$@", note that we saw it, but still + add a quoted null into the result string instead of short-circuiting. + Part of fix for bug report from Grisha Levit + + 3/1 + --- +examples/loadables/fdflags.c + - O_CLOEXEC: instead of not using it, synthesize a definition for it + from unused bits in the file status word. It's only used as a + placeholder anyway. Fix from code by Robert Elz + +execute_cmd.c + - execute_connection: call optimize_fork on the rhs of a `;' connection + to attempt to optimize the last simple command in a list + + 3/4 + --- +subst.c + - parameter_brace_expand: add `@' to the list of operators that cause + unbound parameter errors. Fixes oversight bug reported by + Martin Schulte + + 3/5 + --- +subst.c + - expand_word_internal: update to fix from 2/21 and 2/27 to accommodate + contexts when word splitting will not take place (W_ASSIGNRHS). Fix + from Grisha Levit + - param_expand: if IFS is unset, and we are expanding $* in a context + where we're not going to be performing word splitting, just treat it + as if IFS=" " and don't set W_SPLITSPACE. Report and hint at fix + from Grisha Levit + - param_expand: if IFS is not null, and we are expanding $* in a + context where we're not going to be performing word splitting, and + we quote a null string (resulting in a quoted null), make sure we + set W_SAWQUOTEDNULL to note this for the caller + - parameter_brace_expand_rhs: make sure to remove any W_SAWQUOTEDNULL + flag for a the word on the rhs of the `=' operator if the original + string is null or the original string is not null and the returned + string (after dequoting) is not null. For instance ${v= ''} should + not have the SAWQUOTEDNULL flag set because it is " " after + expansion and dequoting, even though we saw a quoted null there + + 3/6 + --- +lib/sh/eaccess.c + - sh_eaccess: AIX needs the same kind of additional checks as FreeBSD + and Solaris when running as root and checking whether or not a file + is executable. Report and fix from REIX, Tony + + 3/7 + --- +lib/glob/glob.h + - GX_RECURSE: new flag, indicates internal call to glob_filename + +lib/glob/glob.c + - glob_filename: add GX_RECURSE to recursive call to glob_filename + - glob_filename: dequote a directory name (in the absence of a + filename) only if this is not a recursive call to glob_filename + ((flags & GX_RECURSE) == 0). Fixes bug reported by Dr. Werner Fink + + + 3/8 + --- +parse.y + - handle_eof_input_unit: before calling exit_builtin, set + last_shell_builtin and this_shell_builtin appropriately, since the + exit builtin uses them to determine whether or not to exit + immediately. Fixes bug reported by Tom Levy + +lib/sh/shquote.c + - sh_double_quote,sh_mkdoublequoted,sh_backslash_quote_for_double_quotes: + make sure to handle multibyte characters that may contain characters + that need to be quoted in double quotes; adding a spurious double + quote may turn them into different characters or uncover characters + that are special in double quotes. Fixes bug reported by + Stephane Chazelas + - sh_backslash_quote: don't call COPY_CHAR_P if we're in a UTF-8 + locale and the current character doesn't have its eighth bit set; + only check mb_cur_max and is_basic if we're not in a UTF-8 character + set + + 3/9 + --- +subst.c + - read_comsub: if it looks like we're starting a multibyte character, + read a whole multibyte character from buf and add it all at once, + so we don't quote each byte in a multibyte character sequence. Fixes + bug uncovered by shquote changes from 3/8 + + 3/11 + ---- +subst.c + - expand_word_internal: if we are in a context where word splitting + will not occur, but one where we need to make sure we eventually + expand "$@" to multiple words, add a space as quoted so we can still + split on the space separator in $@. Fixes bug reported by + Grisha Levit + + 3/13 + ---- +subst.c + - parameter_brace_substring, parameter_brace_patsub: treat the case + where pflags includes PF_ASSIGNRHS the same as if IFS is null, since + word splitting will not take place + +{subst,array,assoc}.c,subst.h + - string_list_pos_params: add a fourth argument: pflags; change all + callers to initially pass 0 as fourth arg + + 3/14 + ---- +subst.c + - expand_word_internal: split words with W_ASSIGNRHS flag set specially. + These and subsequent changes fix expansion bugs reported by + Grisha Levit + +subst.c + - string_list_pos_params: if we are expanding `@', make sure we honor + PFLAGS including PF_ASSIGNRHS and use string_list_dollar_at to make + sure the positional parameters are separated by spaces + - string_list_pos_params: if we are expanding `*', make sure we honor + PFLAGS including PF_ASSIGNRHS and separate the positional parameters + with the first character of $IFS + - pos_params_pat_subst,pos_params_modcase: calculate appropriate value + for PFLAGS depending on match flags value, and pass right value to + string_list_pos_params (affects @, * expansion) + - pos_params: now takes PFLAGS as argument to pass to string_list_pos_params; + changed caller + +array.c + - array_pat_subst,array_modcase: calculate appropriate value for + PFLAGS depending on match flags value, and pass right value to + string_list_pos_params (affects @, * subscript expansion) + +array.[ch] + - array_subrange: now takes additional PFLAGS argument to pass to + string_list_pos_params + +assoc.c + - assoc_pat_subst,assoc_modcase: calculate appropriate value for + PFLAGS depending on match flags value, and pass right value to + string_list_pos_params (affects @, * subscript expansion) + STILL NEED TO DO SUBRANGE + +subst.c + - parameter_brace_substring: add PFLAGS argument to array_subrange + +arrayfunc.c + - array_keys: use string_list_pos_params instead of calling + string_list_dollar_{star,at} directly. + +arrayfunc.[ch] + - array_keys: now takes a PFLAGS argument, passes to string_list_pos_params + +subst.c + - parameter_brace_expand: add PFLAGS argument to call to array_keys + +subst.c + - parameter_brace_expand_indir: now takes a PFLAGS argument and uses it + in the call to parameter_brace_expand_word + - parameter_brace_expand: add PFLAGS argument to call to + parameter_brace_expand_indir + + 3/15 + ---- +subst.c + - chk_atstar: now takes a PFLAGS parameter, changed callers. Will + eventually affect whether or not we saw $@ + - chk_atstar: if we see "$*" don't note that we saw $@ unless + expand_no_split_dollar_star is unset. This is what param_expand + does + + 3/18 + ---- +lib/readline/misc.c + - rl_get_previous_history: if we are trying to go back from the + beginning of the history, or if we are trying to go back before the + beginning of the history, call _rl_free_saved_history_line to just + get rid of the history line we saved instead of using + rl_maybe_unsave_line, which modifies the current line buffer. + Fixes bug reported by lessbug + + 3/20 + ---- +execute_cmd.c + - execute_command_internal: save and restore line_number around + user_subshell setting it to the line number saved in the command. + Fixes bug reported in https://bugzilla.novell.com/show_bug.cgi?id=1128936 + + 3/21 + ---- +lib/sh/strtrans.c + - ansicstr: handle multibyte characters that are not preceded by a + backslash so we skip over potential escapes in characters whose + multibyte representation contains a backslash. Fixes issue reported by + Stephane Chazelas + +subst.c + - reap_some_procsubs: reap_procsubs, but parameterized to take the + max index to check -- general function for future use + - reap_procsubs: now just calls reap_some_procsubs with the right arg + +execute_cmd.c + - execute_command_internal: if we are using /dev/fd for process + substitution, reap the procsubs at the end of this function (FIFOs + do it at the beginning -- look at this more closely). Only do it + for loops to avoid fd exhaustion. Fixes bug reported by + sunnycemetery@gmail.com + + 3/22 + ---- +lib/readline/{rlprivate.h,signals.c} + - _rl_interrupt_immediately: removed as no longer used + +redir.c + - heredoc_expand: new function, called for both here-documents and + here-strings, takes care of expanding the document and returns a + string + - write_here_document: use heredoc_expand, call write(2) once on the + entire document; structure is now very similar to write_here_string + + 3/23 + ---- +redir.c + - here_document_to_fd: expand the here document/here string first, + using heredoc_expand, then decide what to do; remove calls to + write_here_document/write_here_string in favor of calling + heredoc_write directly + - here_document_to_fd: if the expanded document is of zero length, + just open /dev/null right away and return it -- idea from yash + - here_document_to_fd: if the length of the expanded document is + between 1 and PIPESIZE (pipe capacity, computed by builtins/psize.aux + and stored in builtins/pipesize.h), try to use a pipe: write + the document to the write end and return the read end. Prompted by a + report from Daniel Kahn Gillmor + +builtins/enable.def + - dyn_load_builtin: add warning if dynamic builtin with a load function + is loaded more than once, before running the load function a second + time. From a suggestion by Stan Marsh + + 3/25 + ---- +jobs.[ch] + - wait_for_any_job: takes a new argument, a struct procstat * that + gets the PID of the exited job's process leader (the one that + contributes the status) and the same status we return from the + function + +builtins/wait.def + - wait_builtin: pass a struct procstat * to wait_for_any_job to get + the pid of the job's process leader (and the same status the + function returns). We don't do anything with it yet + + 3/28 + ---- +variable.c + - seedrand: add a couple more variables to the random seed + +lib/sh/tmpfile.c + - sh_mktmpdir: new function, makes a temporary directory using + mkdtemp if it's available, and generates a filename using + sh_mktmpname (which uses mktemp, if available) and makes a + directory with it if not + +config-{top,bot}.h + - set up to use mkdtemp if available + +externs.h + - sh_mktmpdir: extern declaration + - MT_TEMPFILE: new flag for the tempfile functions; means to use the + value in the NAMEROOT argument as a template for the mktemp/mkstemp/ + mkdtemp functions. Not used in mainline shell code + +examples/loadables/mktemp.c + - mktemp: new loadable builtin, with BSD options and basic semantics + + 3/29 + ---- +builtins/common.c,builtins/printf.def + - builtin_bind_variable: moved bind_printf_variable to common.c from + printf.def, renamed to builtin_bind_variable, made global for other + builtins to use + +builtins/read.def + - bind_read_variable: now uses builtin_bind_variable + + 4/4 + --- +lib/readline/histfile.c + - history_rename: wrapper function for rename(2) to deal with the Win32 + refusal to rename over an existing file; changed callers. Bug and fix + from + + 4/8 + --- +builtins/trap.def + - display_traps,showtrap: take an additional int argument, that, if + non-zero, means to print a trap command for a signal whose disposition + is SIG_DFL + - trap_builtin: if the -p option is given, and posix mode is enabled, + pass the `show every signal' flag to display_traps so SIG_DFL signals + are displayed as `trap -- - '. From an austin-group + interpretation (1212) initiated by Robert Elz . + Tagged for bash-5.1 + + 4/9 + --- +jobs.c + - list_one_job: printing one job counts as notifying the user about + it, so add a call to cleanup_dead_jobs like in the other job display + functions. Fixes https://savannah.gnu.org/support/?109667 reported + by "Brian K. White" + + 4/10 + ---- +redir.c + - HEREDOC_PIPESIZE: define to PIPESIZE if not defined, allow it to be + specified at build time; used in here_document_to_fd to determine + whether or not a pipe is used + - HEREDOC_PIPEMAX: allow build-time definition of the max heredoc size + that will be written to a pipe + - here_document_to_fd: if F_GETPIPE_SZ is defined (Linux), ensure that + the document is shorter than the possibly-dynamic max pipe size, + and fall back to the tempfile implementation if it is not + - HEREDOC_PARANOID: if this is defined to a non-zero value, + here_document_to_fd ensures that both file descriptors opened on + the temporary file refer to the same file + +lib/sh/zmapfd.c + - zmapfd: increased the default allocation sizes + +lib/sh/zcatfd.c + - zcatfd: increased the default allocation sizes + +input.c + - localbuf: increased the default buffer size for reads + + 4/11 + ---- +subst.c + - cond_expand_word: like expand_word_unsplit, we need to peform + quoted null character removal on both the LHS and RHS of the + operator, since we are not performing word splitting. Fixes bug + reported by Matt Whitlock in https://savannah.gnu.org/support/?109671 + + 4/12 + ---- +jobs.c + - wait_for_background_pids: don't bother with the loop that waits for + and reaps all children of the shell in the case that it's inherited + some children it doesn't care about. Report from Daniel Kahn Gillmor + + + 4/14 + ---- +subst.c + - command_substitute: add an unwind-protect to make sure the read end + of the pipe gets closed in the parent on a SIGINT that interrupts + the zread. Fixes fast SIGINT fd leak reported by Tycho Kirchner + + +bashhist.c + - history_number: if enable_history_list is set (`set -o history' has + been executed), return the current history number even if we're + not currently saving commands in the history list + (remember_on_history == 0). Prompted by report from Paul Wise + + + 4/20 + ---- +doc/bash.1,lib/readline/doc/rluser.texi + - make it clear that the `bind' builtin can be used to set readline + keybindings and variables. Suggestion from Dan Jacobson + + + 4/22 + ---- +lib/glob/glob.h + - GX_SYMLINK: new internal flag denoting we are processing a symlink to + a directory. If GX_GLOBSTAR is active, we should not `descend' into + that directory + +lib/glob/glob.c + - glob_filename: if the directory portion of the pattern is `**' + (all_starstar), we have globbed all of the directories corresponding + to that pattern, and we encounter a name that is a symlink to a + directory, don't descend into it: if the filename portion is null, + return that name only; if the filename portion is non-null, skip over + it because we will pick it up when we process the `real' directory. + This is a better fix for the issue originally reported by + Murukesh Mohanan back in 4/2018 and + addresses the issue raised by Eli Schwartz + - glob_dir_to_array: slight optimization: if array[i] is the empty + string, don't bother to strcpy it or check the result for a directory + for GX_MARKDIRS support + + 4/23 + ---- +bashline.c + - test_for_canon_directory: test a pathname for a directory, but + expand and canonicalize it first using bash_filename_stat_hook() + before calling stat(2) + - bash_progcomp_ignore_filenames: strip non-directories out of a match + list, but use the function above that canonicalizes the pathname to + expand the name before testing + - bash_directory_completion_matches: use bash_progcomp_ignore_filenames + to strip out non-directories so we get consistent results between + programmable completion and tab completion. Fixes bug reported by + Ville Skyttä + +builtins/read.def + - read_builtin: allow read -e and read -u N to be used together, by + calling fdopen(fd) if fd != 0. Save and restore rl_instream. Fixes + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927768 + + 4/24 + ---- +lib/readline/input.c + - rl_getc: if readline catches SIGTSTP, the calling application must + not have had it ignored. Run the signal handler and set the signal + hook in case the application wants to handle it. Report from + Robert Elz + + 4/26 + ---- +parse.y + - parser_will_prompt: check and return true if we have consumed the + entire readline line buffer and will have to go back to readline for + more input, printing a prompt as a consequence + +eval.c + - parse_command: if parser_will_prompt() returns 0, indicating that we + still have unconsumed input in the readline line buffer, don't + execute PROMPT_COMMAND. TENTATIVE fix prompted by report from + Matteo Landi + +builtins/read.def + - set_eol_delim: save the old values before changing the bindings for + RETURN and the delimiter character, in case the delimiter is RETURN. + Fixes bug report from Stephane Chazelas + - read_builtin: if the delimiter is '\0' and we are using readline, + don't terminate the buffer and go back to read another character; + allow the NULL to pass through and terminate the read. + Fixes bug report from Stephane Chazelas + + 5/9 + --- +bashhist.c + - bash_delete_histent: decrement history_lines_this_session only if + remove_history returns a non-null history entry, and return failure + if it does return a null entry + +builtins/history.def + - history_builtin: when checking the argument to -d, display an error + if the argument is >= history_base + history_length, since that's + what history_get and remove_history check. Fixes issue reported by + + +support/shobj-conf + - hpux11: change stanza to create shared libraries on later versions of + HPUX 11. Contributed by Michael Osipov + +lib/readline/terminal.c + - _rl_init_terminal_io: assume TGETENT_BROKEN defined means that tgetent + returns 0 on success, as on HPUX 11. Bug reported by Michael Osipov + + +configure.ac + - hpux: add -DTGETENT_BROKEN to LOCAL_CFLAGS + +execute_cmd.c + - select_builtin: set executing_builtin around the call to read_builtin + so we can run traps if the read call is interrupted. From a report + from Andreas Kusalananda Kähäri + + 5/12 + ---- +doc/bashref.texi + - The Restricted Shell: add some language detailing the weaknesses of + the restricted shell mode in isolation, inspired by a discussion on + the zsh mailing list + + 5/15 + ---- +xmalloc.h + - malloc: define to sh_malloc to get file and line information from + malloc (not xmalloc) calls. From a suggestion by achurch@achurch.org + (Andrew Church) + +builtins/evalstring.c + - parse_and_execute: make sure the parser is not expanding an alias + before terminating the loop that processes characters in the string. + Fixes problem with -c commands that end with an alias reported by + Yu Kou + - should_suppress_fork: make sure that we don't try to optimize out a + fork if the parser is still expanding an alias + + 5/16 + ---- +lib/readline/misc.c + - rl_get_previous_history: if previous_history() returns NULL, only + free the saved history if we were the ones who saved it; leave any + existing saved history entry alone. Fixes problem with ^N not working + at the end of the history if we previously moved back to the start + of history + +lib/readline/histfile.c + - read_history_range: when reading until FROM lines with a history + file that has timestamps, make sure to skip to the end of the command + line corresponding to the FROMth line instead of leaving line_start + pointing to it, and keep track of the start of the last timestamp in + last_ts for use by the loop below. Fix for history -n bug reported + by HIROSE Masaaki + +lib/readline/display.c + - init_line_structures: if, for some reason, _rl_screenwidth ends up + bigger than the line_size default of 1024 (e.g., gdb's setting the + terminal width to 0), make sure line_size is at least _rl_screenwidth. + From a report by Tom de Vries + + 5/17 + ---- +variables.c + - brand: split the code into a function that generates a 32-bit value + given the last value in the sequence (intrand32) and a function that + returns a 16-bit random number (brand) + - seedrand: small change in hopes of adding slightly more entropy + - brand: modify the 16-bit version to XOR the top 16 bits of the 32-bit + seed with the bottom 16 bits and return the lower 15 bits of that + result as before. Based on an analysis by Andrew Church + + + 5/18 + ---- +variables.c + - genseed: break code that generates the 32-bit seed for the RNG into + a separate function; call from seedrand + - {brand32,sbrand32,seedrand32}: new 32-bit versions of the random + number generator functions that use the entire 32-bit internal value. + Prep for systems that don't have /dev/urandom or arc4random() + - perturb_rand32: shake up the 32-bit LCRNG in subshells + + 5/19 + ---- +variables.c + - get_urandom32: get a 32-bit random number by using the first one of + these that succeeds: reading from /dev/urandom (if available), + calling arc4random (if available), and using the internal 32-bit + RNG (always available) + - SRANDOM: expand to a 32-bit random number. This is not a LCRNG, so + the numbers shouldn't have any relationship to previous returned + values. Assignments are accepted but have no effect on the sequence. + Not documented yet + + 5/20 + ---- +doc/{bash.1,bashref.texi} + - SRANDOM: document new special variable + + 5/22 + ---- +jobs.c + - find_pid_in_pipeline: abstract some code from find_pipeline to look + for a PID in a specific pipline passed as an argument + - find_pipeline: if we have some saved pipeline(s), look there to find + the PID instead of returning failure. This process could have been + started from a DEBUG trap that saved the_pipeline. Fixes Linux bug + reported by Hengyang Zhao + +builtins/bind.def + - unbind_keyseq: use rl_function_of_keyseq_len so you can unbind ^@ + (which translates to 0). Fixes bug reported by + Dennis Williamson + + 5/23 + ---- +lib/readline/display.c + - rl_redisplay: make sure that the line structures can hold up to + _rl_screenwidth characters, to support applications like gdb that + set the screen width to huge values. Report and fix from + Tom de Vries + + 5/24 + ---- +lib/readline/bind.c + - rl_generic_bind: move `ic' from block scope to function scope to + avoid problems with compilers that destroy and recreate it every + time through the loop. Report and fix from Adam Richter + + + 5/30 + ---- +jobs.c + - wait_for_job: now takes an additional struct procstat * argument, + and returns the pid and status of the job's `controlling process' + to the caller + +{jobs,nojobs}.c + - wait_for_background_pids: take a struct proctstat * argument and fill + it in with pid and status of the last process to terminate + +jobs.h + - wait_for_job, wait_for_background_pids: add additional argument to + declaration + +builtins/wait.def + - wait_builtin: set pstat.{pid,status} each time through the pid-or-job + loop and for wait without arguments + + 6/4 + --- +sig.c + - termsig_handler: clean up last_procsub_child before exiting, after + unlinking all FIFOs or closing FDs to all the pipes. Might need to + send it a SIGTERM too. Fixes issue reported by mwnx + +config-top.h + - CASEMOD_CAPCASE: no longer defined by default + + 6/5 + --- +lib/glob/glob.c + - glob_always_skip_dot_and_dotdot: new global variable, if set to + a non-zero value, no glob pattern will ever match `.' or `..'. + Disabled by default + + 6/7 + --- +bashline.c + - cmd_xmap: changes to support multiple cmd_xmaps, one per editing + mode keymap (one each for vi insert and command modes). Changes from + Koichi Murase + +execute_cmd.c + - execute_arith_command: change from expanding the expression using + expand_words_no_vars to use expand_arith_string, with the accompanying + conversion from a WORD_LIST into a string. This makes it more + consistent with other arithmetic expansions. Inspired by a + discussion begun by Nils Emmerich + + 6/10 + ---- +jobs.c + - waitchld: since process substitutions are asynchronous, save the + status of one that exits (that we still know about) in the bgpids + list + + 6/12 + ---- +jobs.c + - wait_for_background_pids: wait for the last procsub only if it's the + same as last_asynchronous_pid + +bashline.c + - bash_backward_shellword: changes to behave better when at the + beginning of the last character on the line and to leave point at + the beginning of the shellword, like backward-word. Fixes from + Andrew Gaylard + + 6/13 + ---- +bashline.c + - __P: Replaced with PARAMS. First of many + - bash_transpose_shellwords: transpose-words, but using `shellword' + word boundaries like shell-forward-word and shell-backward-word. + Contributed by Andrew Gaylard + - "shell-transpose-words": new name binding for bash_transpose_shellwords + - bash_readline_initialize: add default bindings for shell-forward-word, + shell-backward-word, shell-transpose-words, and shell-kill-word. + Suggested by Andrew Gaylard + +lib/readline/doc/rluser.texi + - shell-transpose-words: document + - {shell-forward-word,shell-backward-word,shell-kill-word,shell-transpose-words}: + document new default bindings bash now adds + +variables.c + - set_argv0: function to assign argv0 if it's found in the initial + shell environment. Suggested by Cuong Manh Le + + - initialize_shell_variables: call set_argv0() as part of shell + initialization + + 6/14 + ---- +execute_cmd.c + - execute_for_command: make sure to call stupidly_hack_special_variables + on the index variable each time bind_variable is called on it. If + someone does something nonsensical like `for OPTIND in ...' we want + the side effects to happen. Reported by Stephane Chazelas + + - execute_select_command: do the same thing for the selection variable + after calling bind_variable + + 6/15 + ---- +builtins/set.def + - unset_builtin: if neither -f nor -v is supplied, and a NAME cannot + be a shell variable because it's not a shell identifier, try to + unset a shell function whether we're in posix mode or not. Suggested + back in 1/2019 by PePa65 and Robert Elz + + +execute_cmd.c + - execute_simple_command: if this is being executed by the command + builtin (flags&CMD_COMMAND_BUILTIN), don't bother to print the + command words if set -x is enabled. From a report by Martijn Dekker + back in 4/2018 + + 6/19 + ---- +lib/glob/glob.c + - glob_filename: if we are not being called recursively, and there is + only a directory name, dequote the passed pathname and see if it + names an existing directory. If it does, return it; otherwise return + failure ((char **)&glob_error_return). This is what makes backslash + escaped-characters in pathnames in shell variables work the same as + the same value passed directly. From an anonymous comment on + https://savannah.gnu.org/support/?109629 and a discussion on the + austin-group list. + + 6/20 + ---- +pathexp.c,lib/glob/glob.c + - posix_glob_backslash: variable to control whether or not pathname + expansion handles backslashes in the pattern the way Posix says it + should. Enabled by default + +pathexp.h + - posix_glob_backslash: new extern declaration + +builtins/shopt.def + - posixglob: new option, reflects the value of posix_glob_backslash + +general.c + - posix_vars: add posix_glob_backslash to the table + - posix_initialize: set posix_glob_backslash to 1 when turning on + posix mode + + 6/21 + ---- +doc/{bash.1,bashref.texi} + - pathname expansion: note that under some circumstances the shell + will invoke the matching engine for words with unquoted backslashes + - posixglob: document the new shell option and its effects + + 6/27 + ---- +{config.h.in,configure.ac} + - setresuid,setresgid: check and set HAVE_{DECL,}_SETRES[UG]ID as + appropriate + +shell.c + - disable_priv_mode: if we have setres[ug]id, use them over + set[ug]id, which only set the save user-id and group-id if the + process is running as root. From Ian Eldred Pudney + in https://savannah.gnu.org/patch/?9822 + + 6/28 + ---- +lib/glob/glob.c + - glob_vector: don't bother trying to read the directory if the filename + pattern doesn't have any globbing characters except backslash; just + dequote the pattern and try to lstat(2) it as if there were no + globbing characters at all. From an austingroup-bugs discussion + message from Stephane Chazelas + +bashline.c + - completion_glob_pattern: just call glob_pattern_p and make sure it + returns 1 (non-backslash globbing characters) + +builtins/help.def + - help_builtin: don't try pattern matching the help topic argument + unless glob_pattern_p returns 1 + +pathexp.c + - unquoted_glob_pattern_p: when in a bracket expression (open > 0), + don't allow an unquoted slash as part of the bracket expression. + Report from Stephane Chazelas + + 7/1 + --- +print_cmd.c + - print_function_def,named_function_string: make sure to call + PRINT_DEFERRED_HEREDOCS to finish printing any here documents and + delimiters before printing the function closing brace. Fixes bug + reported by Denis McKeon + +execute_cmd.c + - execute_command_internal: call reap_procsubs at the end of executing + a group command on systems that have /dev/fd. Fixes bug reported by + kfm@plushkava.net + + 7/3 + --- +jobs.c + - waitchld: this is in the potential SIGCHLD path, so don't call + bgp_add, which can potentially call malloc. The glibc malloc doesn't + handle that well. Report from howaboutsynergy@protonmail.com + + 7/5 + --- +builtins/bind.def + - bind_builtin: make sure return_code is >= 0 before returning it. + Fixes bug with bind -x and invalid key sequences reported by + bashbug@jonkmans.nl + + 7/8 + --- +doc/{bash.1,bashref.texi} + - unset: fixed up list of special variables that lose their special + properties if they are unset. Report and fix from Edward Huff + + + 7/9 + --- +test.c + - unary_test: update the `-N' test to use timespecs and nanosecond + granularity if available, and use mtime > atime instead of the + old mtime >= atime. Fixes bug reported by kfm@plushkava.net + +lib/sh/strtod.c + - strtod: make sure to use locale_decpoint() to determine the radix + character + + 7/11 + ---- +lib/sh/utf8.c + - utf8_mblen: return -2 if the UTF-8 sequence is incomplete + - utf8_mblen: 4-byte UTF-8 characters start with a byte <= 0xf4; limit + to 4-byte UTF-8 (since 5- and 6-byte code points were removed in 2003) + + 7/12 + ---- +parse.y,shell.h + - sh_input_line_state_t: if HANDLE_MULTIBYTE is defined, add members + for saving shell_input_line_property and its associated size; let + save_line_state and restore_line_state manage it. This means + restore_line_state no longer calls set_line_mbstate. From a report + from astian + +parse.y + - set_line_mbstate: if the current locale is not multibyte, just set + everything in the property array to 1 + - set_line_mbstate: use locale_utf8locale to optimize away calls to + mbrlen; just use utf8_mblen + + 7/14 + ---- +variables.c + - sv_tz: remake the export env if TZ is being unset. Fixes bug + reported by Travis Everett + +lib/readline/display.c + - rl_expand_prompt: if the prompt contains embedded newlines, compute + local_prompt_prefix before local_prompt because each call sets + local_prompt_newlines, and we want the values computed in the call + that uses local_prompt to be the ones that we use. Fixes prompt + wrapping bug reported by Tianon Gravi + + 7/16 + ---- +Makefile.in + - added a number of dependencies from Vemake Vemake + as reported in + http://savannah.gnu.org/patch/download.php?file_id=47219 + + 7/19 + ---- +lib/sh/utf8.c + - utf8_mblen: changes to handle invalid multibyte sequences better, + even when N means that the sequence would be too short anyway + +arrayfunc.c + - bind_assoc_var_internal: new convenience function to assign a + key-value pair to an associative array. It gets the SHELL_VAR * AND + a HASH_TABLE *, which may or may not correspond to the assoc_cell + of the variable, and performs the insertion into the hash table. + Callers take care of passing the right values. + - bind_assoc_variable: call bind_assoc_var_internal to do the real + work + - assign_compound_array_list: change to assign associative array + key-value pairs into a new hash table (NHASH), so we can still use + the old value for expansion. We do this in place of clearing out + the contents of the associative array before performing the expansion + and assignments. After doing all the assignments into NHASH, we swap + NHASH into the variable as its value and dispose of the old value. + Fixes inconsistency reported by Darren 'Tadgy' Austin + + + 7/20 + ---- +aclocal.m4 + - include bashansi.h in a bunch of AC_TRY_RUN recipies to avoid + exit() being flagged as an implicit declaration. Report and fix + from Chris Yungmann + +shell.c + - set_exit_status: set last_command_exit_value to the argument and make + sure to set PIPESTATUS from that exit value + +shell.h + - set_exit_status: extern declaration + +parse.y + - report_syntax_error: make sure to set PIPESTATUS if we set + last_command_exit_value on a syntax error + - parse_string_to_word_list,parse_compound_assignment: set PIPESTATUS + when we set last_command_exit_value + +sig.c + - throw_to_top_level,sigint_sighandler: set PIPESTATUS when we set + last_command_exit_value + +variables.c + - sv_locale: call set_exit_status to set PIPESTATUS and last_command_exit_value + +arrayfunc.c + - find_or_make_array_variable,array_expand_index,assign_compound_array_list: + call set_exit_status to set PIPESTATUS and last_command_exit_value + +builtins/evalstring.c + - parse_and_execute: set PIPESTATUS when we set last_command_exit_value + +braces.c + - brace_expand: call set_exit_status to set PIPESTATUS and last_command_exit_value + +eval.c + - reader_loop: call set_exit_status to set PIPESTATUS and last_command_exit_value + +jobs.c + - make_child,wait_sigint_handler: set PIPESTATUS and last_command_exit_value + at the same time diff --git a/Makefile.in b/Makefile.in index f0e5926ec..9fc10b4fc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile for bash-5.0, version 4.28 +# Makefile for bash-5.0, version 4.29 # # Copyright (C) 1996-2018 Free Software Foundation, Inc. @@ -592,7 +592,7 @@ $(Program): .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP) @echo " ***********************************************************" @echo -bashbug: $(SDIR)/bashbug.sh config.h Makefile $(VERSPROG) +bashbug: $(SDIR)/bashbug.sh $(VERSPROG) @sed -e "s%!PATCHLEVEL!%$(PatchLevel)%" \ $(SDIR)/bashbug.sh > $@ @chmod a+rx bashbug @@ -628,12 +628,15 @@ version.h: $(SOURCES) config.h Makefile patchlevel.h $(SHELL) $(SUPPORT_SRC)mkversion.sh -b -S ${topdir} -s $(RELSTATUS) -d $(Version) -o newversion.h \ && mv newversion.h version.h -bashversion$(EXEEXT): patchlevel.h conftypes.h version.h buildversion.o $(SUPPORT_SRC)bashversion.c +bashversion$(EXEEXT): buildversion.o $(SUPPORT_SRC)bashversion.c $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)bashversion.c buildversion.o ${LIBS_FOR_BUILD} -buildversion.o: version.h conftypes.h patchlevel.h $(srcdir)/version.c +buildversion.o: $(srcdir)/version.c $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -DBUILDTOOL -c -o $@ $(srcdir)/version.c +buildversion.o: bashintl.h $(BASHINCDIR)/gettext.h +buildversion.o: version.h patchlevel.h conftypes.h + # old rules GRAM_H = parser-built y.tab.o: y.tab.h y.tab.c ${GRAM_H} command.h ${BASHINCDIR}/stdc.h input.h @@ -711,7 +714,7 @@ mksignames$(EXEEXT): mksignames.o buildsignames.o $(RM) $@ $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ mksignames.o buildsignames.o ${LIBS_FOR_BUILD} -mksyntax$(EXEEXT): ${srcdir}/mksyntax.c config.h syntax.h ${BASHINCDIR}/chartypes.h +mksyntax$(EXEEXT): ${srcdir}/mksyntax.c config.h syntax.h ${BASHINCDIR}/chartypes.h bashansi.h $(RM) $@ ${CC_FOR_BUILD} ${CCFLAGS_FOR_BUILD} ${LDFLAGS_FOR_BUILD} -o $@ ${srcdir}/mksyntax.c ${LIBS_FOR_BUILD} @@ -977,35 +980,44 @@ hashtest: hashlib.c # Files that depend on the definitions in config-top.h, which are not meant # to be changed -bashhist.o: config-top.h -shell.o: config-top.h -input.o: config-top.h -y.tab.o: config-top.h -jobs.o: config-top.h -nojobs.o: config-top.h -execute_cmd.o: config-top.h -variables.o: config-top.h -subst.o: config-top.h -builtins/command.o: config-top.h -builtins/common.o: config-top.h -builtins/declare.o: config-top.h -builtins/break.o: config-top.h -builtins/echo.o: config-top.h -builtins/evalstring.o: config-top.h -builtins/exit.o: config-top.h -builtins/kill.o: config-top.h +array.o: $(srcdir)/config-top.h +bashhist.o: $(srcdir)/config-top.h +shell.o: $(srcdir)/config-top.h +input.o: $(srcdir)/config-top.h +y.tab.o: $(srcdir)/config-top.h +jobs.o: $(srcdir)/config-top.h +nojobs.o: $(srcdir)/config-top.h +execute_cmd.o: $(srcdir)/config-top.h +variables.o: $(srcdir)/config-top.h +findcmd.o: $(srcdir)/config-top.h +subst.o: $(srcdir)/config-top.h +builtins/cd.o: $(srcdir)/config-top.h +builtins/command.o: $(srcdir)/config-top.h +builtins/common.o: $(srcdir)/config-top.h +builtins/declare.o: $(srcdir)/config-top.h +builtins/break.o: $(srcdir)/config-top.h +builtins/echo.o: $(srcdir)/config-top.h +builtins/evalstring.o: $(srcdir)/config-top.h +builtins/exit.o: $(srcdir)/config-top.h +builtins/kill.o: $(srcdir)/config-top.h +builtins/shopt.o: $(srcdir)/config-top.h + +# XXX +${SH_LIBDIR}/tmpfile.o: $(srcdir)/config-top.h # shell basics copy_cmd.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h copy_cmd.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h copy_cmd.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h copy_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h +copy_cmd.o: bashansi.h assoc.h $(BASHINCDIR)/ocache.h $(BASHINCDIR)/chartypes.h dispose_cmd.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h dispose_cmd.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h dispose_cmd.o: error.h general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h dispose_cmd.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h dispose_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h dispose_cmd.o: ${BASHINCDIR}/ocache.h +dispose_cmd.o: assoc.h ${BASHINCDIR}/chartypes.h error.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h flags.h ${BASHINCDIR}/stdc.h error.h error.o: command.h general.h xmalloc.h externs.h input.h bashhist.h error.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h @@ -1013,12 +1025,14 @@ error.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h arr error.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h error.o: make_cmd.h subst.h sig.h pathnames.h externs.h execute_cmd.h error.o: input.h execute_cmd.h +error.o: $(BASHINCDIR)/ocache.h $(BASHINCDIR)/chartypes.h assoc.h eval.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h trap.h flags.h ${DEFSRC}/common.h eval.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h eval.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h eval.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h eval.o: make_cmd.h subst.h sig.h pathnames.h externs.h parser.h eval.o: input.h execute_cmd.h +eval.o: bashhist.h assoc.h ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h execute_cmd.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h execute_cmd.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h execute_cmd.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h @@ -1029,12 +1043,15 @@ execute_cmd.o: execute_cmd.h findcmd.h redir.h trap.h test.h pathexp.h execute_cmd.o: $(DEFSRC)/common.h ${DEFDIR}/builtext.h ${GLOB_LIBSRC}/strmatch.h execute_cmd.o: ${BASHINCDIR}/posixtime.h ${BASHINCDIR}/chartypes.h execute_cmd.o: $(DEFSRC)/getopt.h +execute_cmd.o: bashhist.h input.h ${GRAM_H} assoc.h hashcmd.h alias.h +execute_cmd.o: ${BASHINCDIR}/ocache.h ${BASHINCDIR}/posixwait.h expr.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h expr.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h expr.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h expr.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h expr.o: make_cmd.h subst.h sig.h pathnames.h externs.h flags.h execute_cmd.h expr.o: ${BASHINCDIR}/chartypes.h +expr.o: assoc.h ${BASHINCDIR}/ocache.h ${BASHINCDIR}/typemax.h findcmd.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h ${BASHINCDIR}/posixstat.h bashansi.h findcmd.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/memalloc.h shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h findcmd.o: ${BASHINCDIR}/stdc.h error.h general.h xmalloc.h variables.h arrayfunc.h conftypes.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h @@ -1046,6 +1063,7 @@ flags.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h flags.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h flags.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h execute_cmd.h flags.o: make_cmd.h subst.h sig.h pathnames.h externs.h bashhist.h +flags.o: ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h bashansi.h assoc.h general.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h general.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h general.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h @@ -1054,6 +1072,8 @@ general.o: make_cmd.h subst.h sig.h pathnames.h externs.h flags.h parser.h general.o: pathexp.h general.o: ${BASHINCDIR}/maxpath.h ${BASHINCDIR}/posixtime.h general.o: ${BASHINCDIR}/chartypes.h +general.o: trap.h input.h assoc.h test.h findcmd.h +general.o: ${BASHINCDIR}/ocache.h $(DEFSRC)/common.h hashcmd.o: config.h ${BASHINCDIR}/posixstat.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h hashcmd.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h hashcmd.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashcmd.h @@ -1064,6 +1084,7 @@ hashlib.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command. hashlib.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h hashlib.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h hashlib.o: make_cmd.h subst.h sig.h pathnames.h externs.h +hashlib.o: assoc.h ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h input.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h input.o: command.h ${BASHINCDIR}/stdc.h general.h xmalloc.h input.h error.h externs.h input.o: quit.h shell.h pathnames.h @@ -1071,12 +1092,14 @@ list.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h $ list.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h list.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h list.o: make_cmd.h subst.h sig.h pathnames.h externs.h -locale.o: config.h bashtypes.h bashintl.h ${LIBINTL_H} bashansi.h ${BASHINCDIR}/ansi_stdlib.h +list.o: ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h bashansi.h assoc.h +locale.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h locale.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h locale.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h locale.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h locale.o: make_cmd.h subst.h sig.h pathnames.h externs.h locale.o: ${BASHINCDIR}/chartypes.h +locale.o: input.h assoc.h ${BASHINCDIR}/ocache.h mailcheck.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h mailcheck.o: ${BASHINCDIR}/posixtime.h mailcheck.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h @@ -1084,12 +1107,15 @@ mailcheck.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h mailcheck.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h mailcheck.o: make_cmd.h subst.h sig.h pathnames.h externs.h mailcheck.o: execute_cmd.h mailcheck.h +mailcheck.o: ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h assoc.h make_cmd.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h bashansi.h make_cmd.o: command.h ${BASHINCDIR}/stdc.h general.h xmalloc.h error.h flags.h make_cmd.h make_cmd.o: variables.h arrayfunc.h conftypes.h array.h hashlib.h subst.h input.h externs.h make_cmd.o: jobs.h quit.h sig.h siglist.h syntax.h dispose_cmd.h parser.h make_cmd.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h ${BASHINCDIR}/ocache.h make_cmd.o: shell.h execute_cmd.h pathnames.h +make_cmd.o: $(BASHINCDIR)/maxpath.h make_cmd.c assoc.h $(BASHINCDIR)/chartypes.h +make_cmd.o: unwind_prot.h $(BASHINCDIR)/posixjmp.h bashjmp.h $(BASHINCDIR)/posixwait.h y.tab.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/memalloc.h y.tab.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h y.tab.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h @@ -1097,6 +1123,8 @@ y.tab.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h y.tab.o: make_cmd.h subst.h sig.h pathnames.h externs.h test.h execute_cmd.o y.tab.o: trap.h flags.h parser.h input.h mailcheck.h $(DEFSRC)/common.h y.tab.o: $(DEFDIR)/builtext.h bashline.h bashhist.h jobs.h siglist.h alias.h +y.tab.o: ${BASHINCDIR}/typemax.h assoc.h ${BASHINCDIR}/ocache.h +y.tab.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h ${BASHINCDIR}/posixwait.h pathexp.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h pathexp.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h pathexp.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h @@ -1105,6 +1133,7 @@ pathexp.o: make_cmd.h subst.h sig.h pathnames.h externs.h pathexp.o: pathexp.h flags.h pathexp.o: $(GLOB_LIBSRC)/glob.h $(GLOB_LIBSRC)/strmatch.h pathexp.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h +pathexp.o: ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h assoc.h print_cmd.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h print_cmd.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h print_cmd.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h @@ -1112,12 +1141,15 @@ print_cmd.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h print_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h print_cmd.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h print_cmd.o: ${GRAM_H} $(DEFSRC)/common.h +print_cmd.o: flags.h input.h assoc.h +print_cmd.o: $(BASHINCDIR)/ocache.h $(BASHINCDIR)/chartypes.h redir.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/filecntl.h redir.o: ${BASHINCDIR}/memalloc.h shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h redir.o: general.h xmalloc.h variables.h arrayfunc.h conftypes.h array.h hashlib.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h redir.o: dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h externs.h redir.o: flags.h execute_cmd.h redir.h input.h redir.o: ${DEFDIR}/pipesize.h +redir.o: trap.h assoc.h $(BASHINCDIR)/ocache.h $(BASHINCDIR)/chartypes.h shell.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/filecntl.h shell.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h shell.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h @@ -1125,7 +1157,8 @@ shell.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h shell.o: make_cmd.h subst.h sig.h pathnames.h externs.h parser.h shell.o: flags.h trap.h mailcheck.h builtins.h $(DEFSRC)/common.h shell.o: jobs.h siglist.h input.h execute_cmd.h findcmd.h bashhist.h bashline.h -shell.o: ${GLOB_LIBSRC}/strmatch.h ${BASHINCDIR}/posixtime.h +shell.o: ${GLOB_LIBSRC}/strmatch.h ${BASHINCDIR}/posixtime.h ${BASHINCDIR}/posixwait.h +shell.o: ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h assoc.h alias.h sig.o: config.h bashtypes.h sig.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h sig.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h @@ -1139,6 +1172,7 @@ stringlib.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h comman stringlib.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h stringlib.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h stringlib.o: make_cmd.h subst.h sig.h pathnames.h externs.h +stringlib.o: bashansi.h pathexp.h assoc.h $(BASHINCDIR)/ocache.h stringlib.o: ${GLOB_LIBSRC}/glob.h ${GLOB_LIBSRC}/strmatch.h subst.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/posixstat.h subst.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h @@ -1156,6 +1190,8 @@ test.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h $ test.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h test.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h test.o: make_cmd.h subst.h sig.h pathnames.h externs.h test.h +test.o: ${BASHINCDIR}/stat-time.h ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h +test.o: $(GLOB_LIBSRC)/strmatch.h bashansi.h pathexp.h assoc.h test.o: ${DEFSRC}/common.h trap.o: config.h bashtypes.h trap.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h trap.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h @@ -1166,6 +1202,7 @@ trap.o: signames.h $(DEFSRC)/common.h trap.o: ${DEFDIR}/builtext.h jobs.h unwind_prot.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h command.h ${BASHINCDIR}/stdc.h unwind_prot.o: general.h xmalloc.h unwind_prot.h quit.h sig.h +unwind_prot.o: ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h error.h variables.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h variables.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h variables.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h @@ -1174,15 +1211,16 @@ variables.o: make_cmd.h subst.h sig.h pathnames.h externs.h parser.h variables.o: flags.h execute_cmd.h mailcheck.h input.h $(DEFSRC)/common.h variables.o: findcmd.h bashhist.h hashcmd.h pathexp.h variables.o: pcomplete.h ${BASHINCDIR}/chartypes.h -variables.o: ${BASHINCDIR}/posixtime.h assoc.h +variables.o: ${BASHINCDIR}/posixtime.h assoc.h ${DEFSRC}/getopt.h variables.o: version.h $(DEFDIR)/builtext.h -version.o: conftypes.h patchlevel.h version.h +version.o: conftypes.h patchlevel.h version.h xmalloc.o: config.h bashtypes.h ${BASHINCDIR}/ansi_stdlib.h error.h +xmalloc.o: ${BASHINCDIR}/stdc.h $(ALLOC_LIBSRC)/shmalloc.h # job control jobs.o: config.h bashtypes.h trap.h ${BASHINCDIR}/filecntl.h input.h ${BASHINCDIR}/shtty.h -jobs.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h +jobs.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h assoc.h jobs.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h jobs.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h jobs.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h parser.h @@ -1190,10 +1228,12 @@ jobs.o: execute_cmd.h make_cmd.h subst.h sig.h pathnames.h externs.h jobs.o: jobs.h flags.h $(DEFSRC)/common.h $(DEFDIR)/builtext.h jobs.o: ${BASHINCDIR}/posixwait.h ${BASHINCDIR}/unionwait.h jobs.o: ${BASHINCDIR}/posixtime.h +jobs.o: $(BASHINCDIR)/ocache.h $(BASHINCDIR)/chartypes.h $(BASHINCDIR)/typemax.h nojobs.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h bashjmp.h ${BASHINCDIR}/posixjmp.h nojobs.o: command.h ${BASHINCDIR}/stdc.h general.h xmalloc.h jobs.h quit.h siglist.h externs.h nojobs.o: sig.h error.h ${BASHINCDIR}/shtty.h input.h parser.h nojobs.o: $(DEFDIR)/builtext.h +nojobs.o: $(BASHINCDIR)/ocache.h $(BASHINCDIR)/chartypes.h $(BASHINCDIR)/typemax.h # shell features that may be compiled in @@ -1202,6 +1242,7 @@ array.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h array.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h array.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h array.o: make_cmd.h subst.h sig.h pathnames.h externs.h +array.o: $(BASHINCDIR)/ocache.h $(BASHINCDIR)/chartypes.h array.o: $(DEFSRC)/common.h arrayfunc.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h arrayfunc.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h @@ -1209,6 +1250,7 @@ arrayfunc.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h arrayfunc.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h arrayfunc.o: make_cmd.h subst.h sig.h pathnames.h externs.h pathexp.h arrayfunc.o: execute_cmd.h +arrayfunc.o: assoc.h $(BASHINCDIR)/ocache.h $(BASHINCDIR)/chartypes.h arrayfunc.o: $(DEFSRC)/common.h arrayfunc.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h assoc.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h @@ -1218,6 +1260,7 @@ assoc.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h assoc.o: assoc.h hashlib.h assoc.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h assoc.o: make_cmd.h subst.h sig.h pathnames.h externs.h +assoc.o: array.h ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h assoc.o: $(DEFSRC)/common.h braces.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h braces.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h @@ -1225,16 +1268,18 @@ braces.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h ar braces.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h braces.o: make_cmd.h subst.h sig.h pathnames.h externs.h braces.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h +braces.o: ${BASHINCDIR}/typemax.h ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h alias.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h command.h ${BASHINCDIR}/stdc.h alias.o: general.h xmalloc.h bashtypes.h externs.h alias.h -alias.o: pcomplete.h +alias.o: pcomplete.h hashlib.h alias.o: ${BASHINCDIR}/chartypes.h pcomplib.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h bashtypes.h pcomplib.o: ${BASHINCDIR}/stdc.h hashlib.h pcomplete.h shell.h syntax.h pcomplib.o: bashjmp.h command.h general.h xmalloc.h error.h variables.h arrayfunc.h conftypes.h quit.h pcomplib.o: unwind_prot.h dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h -pcomplib.o: externs.h ${BASHINCDIR}/maxpath.h +pcomplib.o: externs.h ${BASHINCDIR}/maxpath.h assoc.h array.h +pcomplib.o: ${BASHINCDIR}/posixjmp.h ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h pcomplete.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h bashtypes.h pcomplete.o: ${BASHINCDIR}/stdc.h hashlib.h pcomplete.h shell.h syntax.h @@ -1253,13 +1298,15 @@ bashhist.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h bashhist.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h bashhist.o: make_cmd.h subst.h sig.h pathnames.h externs.h parser.h bashhist.o: flags.h input.h parser.h pathexp.h $(DEFSRC)/common.h bashline.h -bashhist.o: $(GLOB_LIBSRC)/strmatch.h +bashhist.o: ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h bashhist.h assoc.h +bashhist.o: $(GLOB_LIBSRC)/strmatch.h ${GLOB_LIBSRC}/glob.h bashline.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h bashline.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h bashline.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h bashline.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h bashline.o: make_cmd.h subst.h sig.h pathnames.h externs.h parser.h bashline.o: builtins.h bashhist.h bashline.h execute_cmd.h findcmd.h pathexp.h +bashline.o: trap.h flags.h assoc.h $(BASHINCDIR)/ocache.h bashline.o: $(DEFSRC)/common.h $(GLOB_LIBSRC)/glob.h alias.h bashline.o: pcomplete.h ${BASHINCDIR}/chartypes.h input.h bashline.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h @@ -1270,32 +1317,51 @@ bracecomp.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h bracecomp.o: array.h hashlib.h alias.h builtins.h bracecomp.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h bracecomp.o: make_cmd.h subst.h sig.h pathnames.h externs.h +bracecomp.o: ${BASHINCDIR}/ocache.h ${BASHINCDIR}/chartypes.h bashhist.h assoc.h bracecomp.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h # library dependencies +bashhist.o: $(RL_LIBSRC)/rltypedefs.h bashline.o: $(RL_LIBSRC)/rlconf.h bashline.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/rlstdc.h bashline.o: $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/readline.h +bashline.o: $(RL_LIBSRC)/rltypedefs.h ${RL_LIBSRC}/rlmbutil.h bracecomp.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h bracecomp.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h +bracecomp.o: $(RL_LIBSRC)/rltypedefs.h y.tab.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h y.tab.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h +y.tab.o: $(RL_LIBSRC)/rltypedefs.h subst.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h subst.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h +shell.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h +shell.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h +shell.o: $(RL_LIBSRC)/rltypedefs.h +variables.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h +variables.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h +variables.o: $(RL_LIBSRC)/rltypedefs.h +jobs.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h +jobs.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h +jobs.o: $(RL_LIBSRC)/rltypedefs.h shell.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h +variables.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h subst.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h bashline.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h bashhist.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h y.tab.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h +bashline.o: $(TILDE_LIBSRC)/tilde.h +bracecomp.o: $(TILDE_LIBSRC)/tilde.h execute_cmd.o: $(TILDE_LIBSRC)/tilde.h general.o: $(TILDE_LIBSRC)/tilde.h mailcheck.o: $(TILDE_LIBSRC)/tilde.h shell.o: $(TILDE_LIBSRC)/tilde.h subst.o: $(TILDE_LIBSRC)/tilde.h variables.o: $(TILDE_LIBSRC)/tilde.h +jobs.o: $(TILDE_LIBSRC)/tilde.h +y.tab.o: $(TILDE_LIBSRC)/tilde.h # libintl dependencies arrayfunc.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h @@ -1309,6 +1375,7 @@ expr.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h general.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h input.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h jobs.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +locale.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h mailcheck.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h make_cmd.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h nojobs.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h @@ -1328,6 +1395,9 @@ variables.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h version.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h xmalloc.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +# XXX +$(MALLOC_SOURCE): bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h + signames.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h # XXX - dependencies checked through here @@ -1367,6 +1437,7 @@ builtins/getopt.o: make_cmd.h subst.h sig.h pathnames.h externs.h builtins/getopt.o: $(DEFSRC)/getopt.h builtins/mkbuiltins.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h builtins/mkbuiltins.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h +builtins/mkbuiltins.o: $(BASHINCDIR)/stdc.h # builtin def files builtins/alias.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h diff --git a/aclocal.m4 b/aclocal.m4 index a366597ac..ff8469297 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -10,6 +10,7 @@ AC_DEFUN(BASH_C_LONG_LONG, ac_cv_c_long_long=yes else AC_TRY_RUN([ +#include "bashansi.h" int main() { @@ -33,6 +34,7 @@ AC_DEFUN(BASH_C_LONG_DOUBLE, ac_cv_c_long_double=yes else AC_TRY_RUN([ +#include "bashansi.h" int main() { @@ -136,6 +138,7 @@ typedef int (*_bashfunc)(const char *, ...); #else typedef int (*_bashfunc)(); #endif +#include "bashansi.h" main() { _bashfunc pf; @@ -193,6 +196,7 @@ AC_CACHE_VAL(bash_cv_under_sys_siglist, #ifdef HAVE_UNISTD_H #include #endif +#include "bashansi.h" #ifndef UNDER_SYS_SIGLIST_DECLARED extern char *_sys_siglist[]; #endif @@ -220,6 +224,7 @@ AC_CACHE_VAL(bash_cv_sys_siglist, #ifdef HAVE_UNISTD_H #include #endif +#include "bashansi.h" #if !HAVE_DECL_SYS_SIGLIST extern char *sys_siglist[]; #endif @@ -275,6 +280,7 @@ AC_CACHE_VAL(bash_cv_dup2_broken, [AC_TRY_RUN([ #include #include +#include "bashansi.h" main() { int fd1, fd2, fl; @@ -337,6 +343,7 @@ AC_CACHE_VAL(bash_cv_opendir_not_robust, # include # endif #endif /* HAVE_DIRENT_H */ +#include "bashansi.h" main() { DIR *dir; @@ -516,6 +523,7 @@ AC_TRY_RUN([ #include #include #include +#include "bashansi.h" main() { #ifdef HAVE_QUAD_T @@ -585,6 +593,7 @@ AC_CACHE_VAL(bash_cv_getenv_redef, #ifdef HAVE_UNISTD_H # include #endif +#include "bashansi.h" #ifndef __STDC__ # ifndef const # define const @@ -788,6 +797,7 @@ AC_CACHE_VAL(bash_cv_func_sigsetjmp, #include #include #include +#include "bashansi.h" main() { @@ -883,6 +893,7 @@ AC_CACHE_VAL(bash_cv_printf_a_format, [AC_TRY_RUN([ #include #include +#include "bashansi.h" int main() @@ -1243,6 +1254,7 @@ AC_CACHE_VAL(bash_cv_pgrp_pipe, #ifdef HAVE_UNISTD_H # include #endif +#include "bashansi.h" main() { # ifdef GETPGRP_VOID @@ -1307,6 +1319,7 @@ AC_CACHE_VAL(bash_cv_must_reinstall_sighandlers, #ifdef HAVE_UNISTD_H #include #endif +#include "bashansi.h" typedef RETSIGTYPE sigfunc(); @@ -1420,6 +1433,7 @@ AC_CACHE_VAL(bash_cv_sys_named_pipes, #ifdef HAVE_UNISTD_H #include #endif +#include "bashansi.h" /* Add more tests in here as appropriate. */ main() @@ -1653,6 +1667,7 @@ AC_CACHE_VAL(bash_cv_unusable_rtsigs, [AC_TRY_RUN([ #include #include +#include "bashansi.h" #ifndef NSIG # define NSIG 64 @@ -1836,6 +1851,7 @@ AC_CACHE_VAL(ac_cv_rl_version, [AC_TRY_RUN([ #include #include +#include "bashansi.h" extern int rl_gnu_readline_p; @@ -2040,6 +2056,7 @@ AC_DEFUN([BASH_FUNC_SNPRINTF], AC_CACHE_CHECK([for standard-conformant snprintf], [bash_cv_func_snprintf], [AC_TRY_RUN([ #include +#include "bashansi.h" main() { diff --git a/arrayfunc.c b/arrayfunc.c index 7e429a15f..5ecad4e8b 100644 --- a/arrayfunc.c +++ b/arrayfunc.c @@ -177,7 +177,41 @@ make_array_variable_value (entry, ind, key, value, flags) return newval; } - + +/* Assign HASH[KEY]=VALUE according to FLAGS. ENTRY is an associative array + variable; HASH is the hash table to assign into. HASH may or may not be + the hash table associated with ENTRY; if it's not, the caller takes care + of it. + XXX - make sure that any dynamic associative array variables recreate the + hash table on each assignment. BASH_CMDS and BASH_ALIASES already do this */ +static SHELL_VAR * +bind_assoc_var_internal (entry, hash, key, value, flags) + SHELL_VAR *entry; + HASH_TABLE *hash; + char *key; + char *value; + int flags; +{ + char *newval; + + /* Use the existing array contents to expand the value */ + newval = make_array_variable_value (entry, 0, key, value, flags); + + if (entry->assign_func) + (*entry->assign_func) (entry, newval, 0, key); + else + assoc_insert (hash, key, newval); + + FREE (newval); + + VUNSETATTR (entry, att_invisible); /* no longer invisible */ + + /* check mark_modified_variables if we ever want to export array vars */ + return (entry); +} + +/* Perform ENTRY[IND]=VALUE or ENTRY[KEY]=VALUE. This is not called for every + assignment to an associative array; see assign_compound_array_list below. */ static SHELL_VAR * bind_array_var_internal (entry, ind, key, value, flags) SHELL_VAR *entry; @@ -271,7 +305,7 @@ bind_assoc_variable (entry, name, key, value, flags) return (entry); } - return (bind_array_var_internal (entry, 0, key, value, flags)); + return (bind_assoc_var_internal (entry, assoc_cell (entry), key, value, flags)); } /* Parse NAME, a lhs of an assignment statement of the form v[s], and @@ -398,7 +432,7 @@ find_or_make_array_variable (name, flags) } else if ((flags & 2) && array_p (var)) { - last_command_exit_value = 1; + set_exit_status (EXECUTION_FAILURE); report_error (_("%s: cannot convert indexed to associative array"), name); return ((SHELL_VAR *)NULL); } @@ -481,6 +515,9 @@ expand_compound_array_assignment (var, value, flags) (ksh93 seems to do this). */ list = parse_string_to_word_list (val, 1, "array assign"); + /* Note that we defer expansion of the assignment statements for associative + arrays here, so we don't have to scan the subscript and find the ending + bracket twice. See the caller below. */ if (var && assoc_p (var)) { if (val != value) @@ -507,7 +544,12 @@ expand_compound_array_assignment (var, value, flags) return nlist; } -/* Callers ensure that VAR is not NULL */ +/* Callers ensure that VAR is not NULL. Associative array assignments have not + been expanded when this is called, so we don't have to scan through the + expanded subscript to find the ending bracket; indexed array assignments + have been expanded. + If this is an associative array, we perform the assignments into NHASH and + set NHASH to be the value of VAR after processing the assignments in NLIST */ void assign_compound_array_list (var, nlist, flags) SHELL_VAR *var; @@ -515,7 +557,7 @@ assign_compound_array_list (var, nlist, flags) int flags; { ARRAY *a; - HASH_TABLE *h; + HASH_TABLE *h, *nhash; WORD_LIST *list; char *w, *val, *nval, *savecmd; int len, iflags, free_val; @@ -523,7 +565,7 @@ assign_compound_array_list (var, nlist, flags) char *akey; a = (var && array_p (var)) ? array_cell (var) : (ARRAY *)0; - h = (var && assoc_p (var)) ? assoc_cell (var) : (HASH_TABLE *)0; + nhash = h = (var && assoc_p (var)) ? assoc_cell (var) : (HASH_TABLE *)0; akey = (char *)0; ind = 0; @@ -535,7 +577,7 @@ assign_compound_array_list (var, nlist, flags) if (a && array_p (var)) array_flush (a); else if (h && assoc_p (var)) - assoc_flush (h); + nhash = assoc_create (h->nbuckets); } last_ind = (a && (flags & ASS_APPEND)) ? array_max_index (a) + 1 : 0; @@ -581,7 +623,7 @@ assign_compound_array_list (var, nlist, flags) if (ALL_ELEMENT_SUB (w[1]) && len == 2) { - last_command_exit_value = 1; + set_exit_status (EXECUTION_FAILURE); if (assoc_p (var)) report_error (_("%s: invalid associative array key"), w); else @@ -629,7 +671,7 @@ assign_compound_array_list (var, nlist, flags) } else if (assoc_p (var)) { - last_command_exit_value = 1; + set_exit_status (EXECUTION_FAILURE); report_error (_("%s: %s: must use subscript when assigning associative array"), var->name, w); continue; } @@ -655,13 +697,23 @@ assign_compound_array_list (var, nlist, flags) savecmd = this_command_name; if (integer_p (var)) this_command_name = (char *)NULL; /* no command name for errors */ - bind_array_var_internal (var, ind, akey, val, iflags); + if (assoc_p (var)) + bind_assoc_var_internal (var, nhash, akey, val, iflags); + else + bind_array_var_internal (var, ind, akey, val, iflags); last_ind++; this_command_name = savecmd; if (free_val) free (val); } + + if (assoc_p (var) && nhash && nhash != h) + { + h = assoc_cell (var); + var_setassoc (var, nhash); + assoc_dispose (h); + } } /* Perform a compound array assignment: VAR->name=( VALUE ). The @@ -970,7 +1022,7 @@ array_expand_index (var, s, len, flags) free (exp); if (expok == 0) { - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); if (no_longjmp_on_fatal_error) return 0; @@ -1251,18 +1303,7 @@ array_keys (s, quoted, pflags) if (l == (WORD_LIST *)NULL) return ((char *) NULL); -#if 1 retval = string_list_pos_params (t[0], l, quoted, pflags); -#else - if (t[0] == '*' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) - { - temp = string_list_dollar_star (l, quoted, 0); - retval = quote_string (temp); - free (temp); - } - else /* ${!name[@]} or unquoted ${!name[*]} */ - retval = string_list_dollar_at (l, quoted, 0); -#endif dispose_words (l); return retval; diff --git a/braces.c b/braces.c index 485de369f..82c17403d 100644 --- a/braces.c +++ b/braces.c @@ -61,10 +61,6 @@ extern int errno; extern int asprintf __P((char **, const char *, ...)) __attribute__((__format__ (printf, 2, 3))); -#if defined (NOTDEF) -extern int last_command_exit_value; -#endif - /* Basic idea: Segregate the text into 3 sections: preamble (stuff before an open brace), @@ -190,7 +186,7 @@ brace_expand (text) if (text[j] == brace_arg_separator) { /* { */ strvec_dispose (result); - last_command_exit_value = 1; + set_exit_status (EXECUTION_FAILURE); report_error ("no closing `%c' in %s", '}', text); throw_to_top_level (); } diff --git a/builtins/evalfile.c b/builtins/evalfile.c index 32a7c8d68..fc3975ec8 100644 --- a/builtins/evalfile.c +++ b/builtins/evalfile.c @@ -123,7 +123,7 @@ file_error_and_exit: if (flags & FEVAL_LONGJMP) { - last_command_exit_value = 1; + last_command_exit_value = EXECUTION_FAILURE; jump_to_top_level (EXITPROG); } diff --git a/builtins/evalstring.c b/builtins/evalstring.c index 2f13a66ae..667ee5cce 100644 --- a/builtins/evalstring.c +++ b/builtins/evalstring.c @@ -339,6 +339,7 @@ parse_and_execute (string, from_file, flags) if (command) run_unwind_frame ("pe_dispose"); last_result = last_command_exit_value = EXECUTION_FAILURE; /* XXX */ + set_pipestatus_from_exit (last_command_exit_value); if (subshell_environment) { should_jump_to_top_level = 1; @@ -389,6 +390,7 @@ parse_and_execute (string, from_file, flags) internal_warning (_("%s: ignoring function definition attempt"), from_file); should_jump_to_top_level = 0; last_result = last_command_exit_value = EX_BADUSAGE; + set_pipestatus_from_exit (last_command_exit_value); reset_parser (); break; } diff --git a/builtins/source.def b/builtins/source.def index bdd197fd1..a6963da70 100644 --- a/builtins/source.def +++ b/builtins/source.def @@ -156,7 +156,7 @@ source_builtin (list) free (x); if (posixly_correct && interactive_shell == 0 && executing_command_builtin == 0) { - last_command_exit_value = 1; + last_command_exit_value = EXECUTION_FAILURE; jump_to_top_level (EXITPROG); } return (EXECUTION_FAILURE); diff --git a/configure b/configure index 8f37d2af0..9f8dadf7d 100755 --- a/configure +++ b/configure @@ -5392,6 +5392,7 @@ else #include #include +#include "bashansi.h" extern int rl_gnu_readline_p; @@ -16915,6 +16916,7 @@ else #include #include +#include "bashansi.h" main() { int fd1, fd2, fl; @@ -16966,6 +16968,7 @@ else #ifdef HAVE_UNISTD_H # include #endif +#include "bashansi.h" main() { # ifdef GETPGRP_VOID @@ -17179,6 +17182,7 @@ else #ifdef HAVE_UNISTD_H #include #endif +#include "bashansi.h" #if !HAVE_DECL_SYS_SIGLIST extern char *sys_siglist[]; #endif @@ -17260,6 +17264,7 @@ else #ifdef HAVE_UNISTD_H #include #endif +#include "bashansi.h" #ifndef UNDER_SYS_SIGLIST_DECLARED extern char *_sys_siglist[]; #endif @@ -17667,6 +17672,7 @@ else #include #include #include +#include "bashansi.h" main() { #ifdef HAVE_QUAD_T @@ -18580,6 +18586,7 @@ else # include # endif #endif /* HAVE_DIRENT_H */ +#include "bashansi.h" main() { DIR *dir; @@ -18693,6 +18700,7 @@ else #ifdef HAVE_UNISTD_H # include #endif +#include "bashansi.h" #ifndef __STDC__ # ifndef const # define const @@ -18814,6 +18822,7 @@ else #include #include #include +#include "bashansi.h" main() { @@ -18953,6 +18962,7 @@ else /* end confdefs.h. */ #include +#include "bashansi.h" main() { @@ -19192,6 +19202,7 @@ else #include #include +#include "bashansi.h" int main() @@ -19304,6 +19315,7 @@ else #ifdef HAVE_UNISTD_H #include #endif +#include "bashansi.h" typedef RETSIGTYPE sigfunc(); @@ -19455,6 +19467,7 @@ else #ifdef HAVE_UNISTD_H #include #endif +#include "bashansi.h" /* Add more tests in here as appropriate. */ main() @@ -19765,6 +19778,7 @@ else #include #include +#include "bashansi.h" #ifndef NSIG # define NSIG 64 diff --git a/error.c b/error.c index 417c902e9..097e18720 100644 --- a/error.c +++ b/error.c @@ -201,7 +201,7 @@ report_error (format, va_alist) if (exit_immediately_on_error) { if (last_command_exit_value == 0) - last_command_exit_value = 1; + last_command_exit_value = EXECUTION_FAILURE; exit_shell (last_command_exit_value); } } diff --git a/eval.c b/eval.c index 982635215..87cc2b9e7 100644 --- a/eval.c +++ b/eval.c @@ -108,7 +108,7 @@ reader_loop () leave existing non-zero values (e.g., > 128 on signal) alone. */ if (last_command_exit_value == 0) - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); if (subshell_environment) { current_command = (COMMAND *)NULL; @@ -144,7 +144,7 @@ reader_loop () { if (interactive_shell == 0 && read_but_dont_execute) { - last_command_exit_value = EXECUTION_SUCCESS; + set_exit_status (EXECUTION_SUCCESS); dispose_command (global_command); global_command = (COMMAND *)NULL; } diff --git a/expr.c b/expr.c index d1092297c..b30050e3a 100644 --- a/expr.c +++ b/expr.c @@ -1177,7 +1177,7 @@ expr_streval (tok, e, lvalue) value = tok; #endif - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); err_unboundvar (value); #if defined (ARRAY_VARS) diff --git a/externs.h b/externs.h index df81e8e74..1f6b2fd91 100644 --- a/externs.h +++ b/externs.h @@ -81,6 +81,7 @@ extern void xtrace_print_cond_term __P((int, int, WORD_DESC *, char *, char *)); extern void exit_shell __P((int)) __attribute__((__noreturn__)); extern void sh_exit __P((int)) __attribute__((__noreturn__)); extern void subshell_exit __P((int)) __attribute__((__noreturn__)); +extern void set_exit_status __P((int)); extern void disable_priv_mode __P((void)); extern void unbind_args __P((void)); diff --git a/jobs.c b/jobs.c index b3aa00de9..8ad90dd3d 100644 --- a/jobs.c +++ b/jobs.c @@ -1994,7 +1994,7 @@ make_child (command, async_p) if (the_pipeline) kill_current_pipeline (); - last_command_exit_value = EX_NOEXEC; + set_exit_status (EX_NOEXEC); throw_to_top_level (); /* Reset signals, etc. */ } @@ -2552,6 +2552,7 @@ wait_sigint_handler (sig) (this_shell_builtin && this_shell_builtin == wait_builtin)) { last_command_exit_value = 128+SIGINT; + set_pipestatus_from_exit (last_command_exit_value); restore_sigint_handler (); /* If we got a SIGINT while in `wait', and SIGINT is trapped, do what POSIX.2 says (see builtins/wait.def for more info). */ @@ -2586,6 +2587,7 @@ wait_sigint_handler (sig) else { last_command_exit_value = 128+SIGINT; + set_pipestatus_from_exit (last_command_exit_value); restore_sigint_handler (); kill (getpid (), SIGINT); } diff --git a/lib/glob/sm_loop.c b/lib/glob/sm_loop.c index cc14fb16c..1e4681a4b 100644 --- a/lib/glob/sm_loop.c +++ b/lib/glob/sm_loop.c @@ -612,6 +612,8 @@ matched: { brcnt++; brchr = *p; + /* If brchr == ':' we need to check that the rest of the characters + form a valid character class name. */ } /* we only want to check brchr if we set it above */ else if (c == L(']') && brcnt > 1 && brchr != 0 && oc == brchr) diff --git a/lib/sh/Makefile.in b/lib/sh/Makefile.in index 06917ba4e..fade8c9be 100644 --- a/lib/sh/Makefile.in +++ b/lib/sh/Makefile.in @@ -275,7 +275,7 @@ strtoumax.o: ${BUILD_DIR}/config.h strtrans.o: ${BUILD_DIR}/config.h times.o: ${BUILD_DIR}/config.h timeval.o: ${BUILD_DIR}/config.h -tmpfile.o: ${BUILD_DIR}/config.h +tmpfile.o: ${BUILD_DIR}/config.h ${topdir}/config-top.h uconvert.o: ${BUILD_DIR}/config.h ufuncs.o: ${BUILD_DIR}/config.h unicode.o: ${BUILD_DIR}/config.h diff --git a/lib/sh/utf8.c b/lib/sh/utf8.c index af2d75788..fed252264 100644 --- a/lib/sh/utf8.c +++ b/lib/sh/utf8.c @@ -76,13 +76,13 @@ utf8_mbsnlen(src, srclen, maxlen) return (count); } -/* Adapted from GNU gnulib */ +/* Adapted from GNU gnulib. Handles UTF-8 characters up to 4 bytes long */ int utf8_mblen (s, n) const char *s; size_t n; { - unsigned char c, c1; + unsigned char c, c1, c2, c3; if (s == 0) return (0); /* no shift states */ @@ -100,31 +100,71 @@ utf8_mblen (s, n) if (n == 1) return -2; - if (n >= 2 && (s[1] ^ 0x80) < 0x40) + /* + * c c1 + * + * U+0080..U+07FF C2..DF 80..BF + */ + + if (n >= 2 && (c1 ^ 0x80) < 0x40) /* 0x80..0xbf */ return 2; } else if (c < 0xf0) { - if (n <= 2) + if (n == 1) return -2; - - if (n >= 3 - && (s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 + + /* + * c c1 c2 + * + * U+0800..U+0FFF E0 A0..BF 80..BF + * U+1000..U+CFFF E1..EC 80..BF 80..BF + * U+D000..U+D7FF ED 80..9F 80..BF + * U+E000..U+FFFF EE..EF 80..BF 80..BF + */ + + if ((c1 ^ 0x80) < 0x40 && (c >= 0xe1 || c1 >= 0xa0) && (c != 0xed || c1 < 0xa0)) - return 3; + { + if (n == 2) + return -2; /* incomplete */ + + c2 = (unsigned char)s[2]; + if ((c2 ^ 0x80) < 0x40) + return 3; + } } else if (c <= 0xf4) { - if (n <= 3) + if (n == 1) return -2; - - if (n >= 4 - && (s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 - && (s[3] ^ 0x80) < 0x40 + + /* + * c c1 c2 c3 + * + * U+10000..U+3FFFF F0 90..BF 80..BF 80..BF + * U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF + * U+100000..U+10FFFF F4 80..8F 80..BF 80..BF + */ + if (((c1 ^ 0x80) < 0x40) && (c >= 0xf1 || c1 >= 0x90) && (c < 0xf4 || (c == 0xf4 && c1 < 0x90))) - return 4; + { + if (n == 2) + return -2; /* incomplete */ + + c2 = (unsigned char)s[2]; + if ((c2 ^ 0x80) < 0x40) + { + if (n == 3) + return -2; + + c3 = (unsigned char)s[3]; + if ((c3 ^ 0x80) < 0x40) + return 4; + } + } } } /* invalid or incomplete multibyte character */ diff --git a/make_cmd.c b/make_cmd.c index ecbbfd6e7..42bd19dc5 100644 --- a/make_cmd.c +++ b/make_cmd.c @@ -1,7 +1,7 @@ /* make_cmd.c -- Functions for making instances of the various parser constructs. */ -/* Copyright (C) 1989-2018 Free Software Foundation, Inc. +/* Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. @@ -235,7 +235,7 @@ make_select_command (name, map_list, action, lineno) #if defined (SELECT_COMMAND) return (make_for_or_select (cm_select, name, map_list, action, lineno)); #else - last_command_exit_value = 2; + set_exit_status (2); return ((COMMAND *)NULL); #endif } @@ -321,7 +321,7 @@ make_arith_for_command (exprs, action, lineno) free (init); free (test); free (step); - last_command_exit_value = 2; + set_exit_status (2); return ((COMMAND *)NULL); } @@ -337,7 +337,7 @@ make_arith_for_command (exprs, action, lineno) return (make_command (cm_arith_for, (SIMPLE_COM *)temp)); #else dispose_words (exprs); - last_command_exit_value = 2; + set_exit_status (2); return ((COMMAND *)NULL); #endif /* ARITH_FOR_COMMAND */ } @@ -447,7 +447,7 @@ make_arith_command (exp) return (command); #else - last_command_exit_value = 2; + set_exit_status (2); return ((COMMAND *)NULL); #endif } @@ -490,7 +490,7 @@ make_cond_command (cond_node) return (command); #else - last_command_exit_value = 2; + set_exit_status (2); return ((COMMAND *)NULL); #endif } diff --git a/parse.y b/parse.y index 6c59f4955..45fce9854 100644 --- a/parse.y +++ b/parse.y @@ -6266,6 +6266,7 @@ report_syntax_error (message) if (interactive && EOF_Reached) EOF_Reached = 0; last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + set_pipestatus_from_exit (last_command_exit_value); return; } @@ -6287,6 +6288,7 @@ report_syntax_error (message) print_offending_line (); last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + set_pipestatus_from_exit (last_command_exit_value); return; } @@ -6318,6 +6320,7 @@ report_syntax_error (message) } last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + set_pipestatus_from_exit (last_command_exit_value); } /* ??? Needed function. ??? We have to be able to discard the constructs @@ -6490,7 +6493,7 @@ parse_string_to_word_list (s, flags, whom) if (wl == &parse_string_error) { - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); if (interactive_shell == 0 && posixly_correct) jump_to_top_level (FORCE_EOF); else @@ -6554,7 +6557,7 @@ parse_compound_assignment (retlenp) if (wl == &parse_string_error) { - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); last_read_token = '\n'; /* XXX */ if (interactive_shell == 0 && posixly_correct) jump_to_top_level (FORCE_EOF); @@ -6815,7 +6818,7 @@ set_line_mbstate () if (locale_utf8locale) { - if ((unsigned char)shell_input_line[previ] < 128) + if ((unsigned char)shell_input_line[previ] < 128) /* i != previ */ mbclen = 1; else { diff --git a/po/zh_TW.po b/po/zh_TW.po index e83e8735a..0e3e57fba 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -1,26 +1,26 @@ # Traditional Chinese translations for bash package. -# Copyright (C) 2008 Free Software Foundation, Inc. +# Copyright (C) 2019 Free Software Foundation, Inc. # This file is distributed under the same license as the bash package. # # Zi-You Dai , 2008. # Mingye Wang (Arthur2e5) , 2015. # Wei-Lun Chao , 2015. -# pan93412 , 2018. +# pan93412 , 2018, 2019. msgid "" msgstr "" -"Project-Id-Version: bash 5.0-beta2\n" +"Project-Id-Version: bash 5.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-12-19 15:52-0500\n" -"PO-Revision-Date: 2018-11-29 20:02+0800\n" +"PO-Revision-Date: 2019-07-16 22:22+0800\n" "Last-Translator: pan93412 \n" "Language-Team: Chinese (traditional) \n" +"Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: zh_TW\n" "X-Bugs: Report translation errors to the Language-Team address.\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Manual Edit && Poedit 2.0.2\n" +"X-Generator: Lokalize 19.04.3\n" #: arrayfunc.c:58 msgid "bad array subscript" @@ -59,7 +59,7 @@ msgstr "%s: 無法建立: %s" #: bashline.c:4144 msgid "bash_execute_unix_command: cannot find keymap for command" -msgstr "bash_execute_unix_command: 無法為命令找到鍵對映" +msgstr "bash_execute_unix_command: 無法為指令找到按鍵映射" #: bashline.c:4254 #, c-format @@ -79,17 +79,17 @@ msgstr "%s: 缺少冒號分隔符" #: braces.c:331 #, c-format msgid "brace expansion: cannot allocate memory for %s" -msgstr "大括號展開: 無法為 %s 分配記憶體" +msgstr "大括號展開:無法為 %s 分配記憶體" #: braces.c:429 #, c-format msgid "brace expansion: failed to allocate memory for %u elements" -msgstr "大括號展開: 為 %u 個元素分配記憶體失敗" +msgstr "大括號展開:為 %u 個元素分配記憶體失敗" #: braces.c:474 #, c-format msgid "brace expansion: failed to allocate memory for `%s'" -msgstr "大括號展開: 為「%s」分配記憶體失敗" +msgstr "大括號展開:為「%s」分配記憶體失敗" #: builtins/alias.def:131 variables.c:1842 #, c-format @@ -103,12 +103,12 @@ msgstr "未啟用列編輯" #: builtins/bind.def:212 #, c-format msgid "`%s': invalid keymap name" -msgstr "「%s」: 無效的鍵對映名" +msgstr "「%s」: 無效的按鍵映射名" #: builtins/bind.def:252 #, c-format msgid "%s: cannot read: %s" -msgstr "%s:不能讀取: %s" +msgstr "%s:不能讀取:%s" #: builtins/bind.def:304 builtins/bind.def:334 #, c-format @@ -144,17 +144,17 @@ msgid "" " \n" " Without EXPR, returns " msgstr "" -"回傳當前子例程呼叫的語境\n" +"回傳目前子例程呼叫的語境\n" " \n" -" 不帶 EXPR 時,回傳" +" 不帶 <表示式> 時,回傳" #: builtins/cd.def:326 msgid "HOME not set" -msgstr "HOME 沒有設置" +msgstr "未設定 HOME" #: builtins/cd.def:334 builtins/common.c:161 test.c:891 msgid "too many arguments" -msgstr "太多引數" +msgstr "太多參數" #: builtins/cd.def:341 msgid "null directory" @@ -162,7 +162,7 @@ msgstr "空的目錄" #: builtins/cd.def:352 msgid "OLDPWD not set" -msgstr "OLDPWD 沒有設置" +msgstr "未設定 OLDPWD" #: builtins/common.c:96 #, c-format @@ -177,17 +177,17 @@ msgstr "警告:" #: builtins/common.c:148 #, c-format msgid "%s: usage: " -msgstr "%s: 用法:" +msgstr "%s:用法:" #: builtins/common.c:193 shell.c:510 shell.c:838 #, c-format msgid "%s: option requires an argument" -msgstr "%s:選項需要一個引數" +msgstr "%s:選項需要一個參數" #: builtins/common.c:200 #, c-format msgid "%s: numeric argument required" -msgstr "%s:需要數字引數" +msgstr "%s:需要數字參數" #: builtins/common.c:207 #, c-format @@ -224,7 +224,7 @@ msgstr "無效數字" #: builtins/common.c:252 #, c-format msgid "%s: invalid signal specification" -msgstr "%s:無效的信號規格" +msgstr "%s:無效的訊號規格" #: builtins/common.c:259 #, c-format @@ -243,7 +243,7 @@ msgstr "%s:%s 超出範圍" #: builtins/common.c:274 builtins/common.c:276 msgid "argument" -msgstr "引數" +msgstr "參數" #: builtins/common.c:276 #, c-format @@ -281,22 +281,22 @@ msgstr "%s:不是一個內建 shell" #: builtins/common.c:323 #, c-format msgid "write error: %s" -msgstr "寫入錯誤: %s" +msgstr "寫入時發生錯誤:%s" #: builtins/common.c:331 #, c-format msgid "error setting terminal attributes: %s" -msgstr "設定終端屬性時出錯: %s" +msgstr "設定終端屬性時發生錯誤: %s" #: builtins/common.c:333 #, c-format msgid "error getting terminal attributes: %s" -msgstr "獲取終端屬性時出錯: %s" +msgstr "取得終端屬性時發生錯誤: %s" #: builtins/common.c:579 #, c-format msgid "%s: error retrieving current directory: %s: %s\n" -msgstr "%s:錯誤檢索當前目錄: %s: %s\n" +msgstr "%s:檢索目前目錄時發生錯誤:%s:%s\n" #: builtins/common.c:645 builtins/common.c:647 #, c-format @@ -320,15 +320,15 @@ msgstr "%s:沒有完成的規格" #: builtins/complete.def:733 msgid "warning: -F option may not work as you expect" -msgstr "警告: -F 選項可能無法按預期工作" +msgstr "警告:-F 選項可能無法按預期工作" #: builtins/complete.def:735 msgid "warning: -C option may not work as you expect" -msgstr "警告: -C 選項可能無法按預期工作" +msgstr "警告:-C 選項可能無法按預期工作" #: builtins/complete.def:883 msgid "not currently executing completion function" -msgstr "當前未執行補完功能" +msgstr "目前未執行補完功能" #: builtins/declare.def:132 msgid "can only be used in a function" @@ -357,7 +357,7 @@ msgstr "「%s」:無效的引用變數名" #: builtins/declare.def:520 msgid "cannot use `-f' to make functions" -msgstr "無法用「-f」生成函數" +msgstr "無法用「-f」產生函數" #: builtins/declare.def:532 execute_cmd.c:5852 #, c-format @@ -416,7 +416,7 @@ msgstr "%s: 是一個目錄" #: builtins/evalfile.c:144 #, c-format msgid "%s: not a regular file" -msgstr "%s: 不是常規檔案" +msgstr "%s: 不是一般檔案" #: builtins/evalfile.c:153 #, c-format @@ -454,7 +454,7 @@ msgstr "有執行中的工作。\n" #: builtins/fc.def:265 msgid "no command found" -msgstr "未找到命令" +msgstr "未找到指令" #: builtins/fc.def:323 builtins/fc.def:372 msgid "history specification" @@ -463,11 +463,11 @@ msgstr "歷史記錄規格" #: builtins/fc.def:393 #, c-format msgid "%s: cannot open temp file: %s" -msgstr "%s: 無法開啟臨時檔案: %s" +msgstr "%s: 無法開啟暫存檔案: %s" #: builtins/fg_bg.def:152 builtins/jobs.def:284 msgid "current" -msgstr "當前" +msgstr "目前" #: builtins/fg_bg.def:161 #, c-format @@ -482,7 +482,7 @@ msgstr "%s: 非法選項 -- %c\n" #: builtins/getopt.c:111 #, c-format msgid "%s: option requires an argument -- %c\n" -msgstr "%s: 選項需要一個引數 -- %c\n" +msgstr "%s: 選項需要一個參數 -- %c\n" #: builtins/hash.def:91 msgid "hashing disabled" @@ -496,19 +496,17 @@ msgstr "%s: 雜湊表為空\n" #: builtins/hash.def:266 #, c-format msgid "hits\tcommand\n" -msgstr "命中\t命令\n" +msgstr "命中\t指令\n" #: builtins/help.def:133 msgid "Shell commands matching keyword `" msgid_plural "Shell commands matching keywords `" -msgstr[0] "Shell 命令,匹配關鍵詞 `" +msgstr[0] "Shell 指令,符合關鍵字 `" #: builtins/help.def:185 #, c-format -msgid "" -"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." -msgstr "" -"沒有與「%s」匹配的說明主題。嘗試「help help」或「man -k %s」或「info %s」。" +msgid "no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "沒有與「%s」符合的說明主題。嘗試「help help」或「man -k %s」或「info %s」。" #: builtins/help.def:224 #, c-format @@ -526,12 +524,12 @@ msgid "" "A star (*) next to a name means that the command is disabled.\n" "\n" msgstr "" -"這些 shell 命令是內部定義的。請輸入「help」以獲取一個列表。\n" +"這些 shell 指令是內部定義的。請輸入「help」以取得一個列表。\n" "輸入「help 名稱」以得到有關函數「名稱」的更多資訊。\n" "使用「info bash」來獲得關於 shell 的更多一般性資訊。\n" -"使用「man -k」或「info」來獲取不在列表中命令的更多資訊。\n" +"使用「man -k」或「info」來取得不在列表中指令的更多資訊。\n" "\n" -"名稱旁邊的星號(*)表示該命令被停用。\n" +"名稱旁邊的星號(*)表示該指令被停用。\n" "\n" #: builtins/history.def:154 @@ -565,7 +563,7 @@ msgstr "其他選項不能與「-x」同時使用" #: builtins/kill.def:211 #, c-format msgid "%s: arguments must be process or job IDs" -msgstr "%s: 引數必須是行程或工作 ID" +msgstr "%s: 參數必須是行程或工作 ID" #: builtins/kill.def:274 msgid "Unknown error" @@ -654,11 +652,11 @@ msgstr "無其他目錄" #: builtins/pushd.def:360 #, c-format msgid "%s: invalid argument" -msgstr "%s: 無效引數" +msgstr "%s: 無效參數" #: builtins/pushd.def:480 msgid "" -msgstr "<無當前目錄>" +msgstr "<無目前目錄>" #: builtins/pushd.def:524 msgid "directory stack empty" @@ -683,17 +681,15 @@ msgid "" " \twith its position in the stack\n" " \n" " Arguments:\n" -" +N\tDisplays the Nth entry counting from the left of the list shown " -"by\n" +" +N\tDisplays the Nth entry counting from the left of the list shown by\n" " \tdirs when invoked without options, starting with zero.\n" " \n" -" -N\tDisplays the Nth entry counting from the right of the list shown " -"by\n" +" -N\tDisplays the Nth entry counting from the right of the list shown by\n" "\tdirs when invoked without options, starting with zero." msgstr "" -"顯示當前記住的目錄列表。 目錄\n" -" 藉由「pushd」命令加入這個列表;您可以\n" -" 使用「popd」命令對列表進行遍歷。\n" +"顯示目前記住的目錄列表。 目錄\n" +" 藉由「pushd」指令加入這個列表;您可以\n" +" 使用「popd」指令對列表進行遍歷。\n" " \n" " 選項:\n" " -c\t刪除所有元素以清除目錄堆疊\n" @@ -703,7 +699,7 @@ msgstr "" " -v\t以堆疊位置為字首,每列一個條目\n" " \t印出目錄堆疊\n" " \n" -" 引數:\n" +" 參數:\n" " +N\t以 dirs 不帶選項輸出的順序,從左起第 N 個條目顯示列表,\n" " \t從 0 開始。\n" " \n" @@ -735,14 +731,14 @@ msgid "" " The `dirs' builtin displays the directory stack." msgstr "" "在目錄堆疊頂部加入一個目錄,或者論詢\n" -" 目錄堆疊,是當前工作目錄成為新的堆疊頂端\n" -" 不帶引數時,交換堆疊頂端的兩個目錄。\n" +" 目錄堆疊,是目前工作目錄成為新的堆疊頂端\n" +" 不帶參數時,交換堆疊頂端的兩個目錄。\n" " \n" " 選項:\n" " -n\t抑制增加堆疊中目錄時通常變更目錄的操作,\n" " \t從而只有堆疊被操作。\n" " \n" -" 引數:\n" +" 參數:\n" " +N\t輪轉堆疊使得第 N 個目錄(「dirs」的\n" " \t輸出列表中左起,從 0 開始)\n" " \t升至堆疊頂端。\n" @@ -752,9 +748,9 @@ msgstr "" " \t升至堆疊頂端\n" " \n" " dir\t新增目錄至堆疊頂端,並\n" -" \t使其成為新的當前工作目錄。\n" +" \t使其成為新的目前工作目錄。\n" " \n" -" 「dirs」內建命令顯示目錄堆疊。" +" 「dirs」內建指令顯示目錄堆疊。" #: builtins/pushd.def:748 msgid "" @@ -776,14 +772,14 @@ msgid "" " \n" " The `dirs' builtin displays the directory stack." msgstr "" -"從目錄堆疊中刪除條目。不帶引數時,刪除\n" +"從目錄堆疊中刪除條目。不帶參數時,刪除\n" " 堆疊頂端目錄並變更至新的堆疊頂端目錄。\n" " \n" " 選項:\n" " -n\t抑制從堆疊中刪除目錄時通常變更目錄操作,\n" " \t從而只有堆疊被操作。\n" " \n" -" 引數:\n" +" 參數:\n" " +N\t從「dirs」輸出的列表中,\n" " \t刪除左起第 N 個條目,計數從 0 開始。例如:「popd +0」\n" " \t刪除第一個目錄,「popd +1」刪除第二個。\n" @@ -835,7 +831,7 @@ msgstr "%s: 不是函數" #: builtins/setattr.def:194 #, c-format msgid "%s: cannot export" -msgstr "%s:無法會出" +msgstr "%s:無法匯出" #: builtins/shift.def:73 builtins/shift.def:79 msgid "shift count" @@ -852,7 +848,7 @@ msgstr "%s: 無效的 shell 選項名稱" #: builtins/source.def:128 msgid "filename argument required" -msgstr "需要檔名引數" +msgstr "需要檔名參數" #: builtins/source.def:154 #, c-format @@ -861,11 +857,11 @@ msgstr "%s: 檔案未找到" #: builtins/suspend.def:102 msgid "cannot suspend" -msgstr "無法懸置" +msgstr "無法暫停" #: builtins/suspend.def:112 msgid "cannot suspend a login shell" -msgstr "無法將登入 shell 懸置" +msgstr "無法暫停登入 shell" #: builtins/type.def:235 #, c-format @@ -885,12 +881,12 @@ msgstr "%s 是一個函數\n" #: builtins/type.def:299 #, c-format msgid "%s is a special shell builtin\n" -msgstr "%s 是特別的 shell 內建\n" +msgstr "%s 是特別的 shell 內建物件\n" #: builtins/type.def:301 #, c-format msgid "%s is a shell builtin\n" -msgstr "%s 是 shell 內建\n" +msgstr "%s 是 shell 內建物件\n" #: builtins/type.def:323 builtins/type.def:408 #, c-format @@ -900,17 +896,17 @@ msgstr "%s 是 %s\n" #: builtins/type.def:343 #, c-format msgid "%s is hashed (%s)\n" -msgstr "%s 已進行雜湊操作(%s)\n" +msgstr "%s 已進行雜湊操作 (%s)\n" #: builtins/ulimit.def:396 #, c-format msgid "%s: invalid limit argument" -msgstr "%s: 無效的 limit 引數" +msgstr "%s: 無效的 limit 參數" #: builtins/ulimit.def:422 #, c-format msgid "`%c': bad command" -msgstr "「%c」:不當的命令" +msgstr "「%c」:不當的指令" #: builtins/ulimit.def:451 #, c-format @@ -947,7 +943,7 @@ msgstr " 列 " #: error.c:164 #, c-format msgid "last command: %s\n" -msgstr "最後的命令: %s\n" +msgstr "最後的指令:%s\n" #: error.c:172 #, c-format @@ -962,11 +958,11 @@ msgstr "通知:" #: error.c:462 msgid "unknown command error" -msgstr "不明命令錯誤" +msgstr "不明指令錯誤" #: error.c:463 msgid "bad command type" -msgstr "不當的命令類型" +msgstr "不當的指令類型" #: error.c:464 msgid "bad connector" @@ -1023,12 +1019,12 @@ msgstr "%s: 超出最大函數巢狀層數 (%d)" #: execute_cmd.c:5340 #, c-format msgid "%s: restricted: cannot specify `/' in command names" -msgstr "%s: 受限的: 無法在命令名稱中使用「/」" +msgstr "%s: 受限的: 無法在指令名稱中使用「/」" #: execute_cmd.c:5438 #, c-format msgid "%s: command not found" -msgstr "%s:命令找不到" +msgstr "%s:指令找不到" #: execute_cmd.c:5682 #, c-format @@ -1093,7 +1089,7 @@ msgstr "指數小於 0" #: expr.c:1028 msgid "identifier expected after pre-increment or pre-decrement" -msgstr "預增符或預減符後應跟有標識符" +msgstr "預增符或預減符後應跟有識別符" #: expr.c:1055 msgid "missing `)'" @@ -1127,22 +1123,22 @@ msgstr "%s: 表示式錯誤\n" #: general.c:69 msgid "getcwd: cannot access parent directories" -msgstr "getcwd: 無法訪問上層目錄" +msgstr "getcwd: 無法存取上層目錄" #: input.c:99 subst.c:5930 #, c-format msgid "cannot reset nodelay mode for fd %d" -msgstr "無法為檔案描述符 %d 重置無延遲模式" +msgstr "無法為檔案描述符 %d 重設無延遲模式" #: input.c:266 #, c-format msgid "cannot allocate new file descriptor for bash input from fd %d" -msgstr "無法從檔案描述符 %d 為 bash 的輸入獲取一個新的檔案描述符" +msgstr "無法為來自 fd %d 的 bash 輸入分配新的檔案描述符" #: input.c:274 #, c-format msgid "save_bash_input: buffer already exists for new fd %d" -msgstr "save_bash_input: 已經存在新的檔案描述符 %d 的緩衝區" +msgstr "save_bash_input: 已經存在提供給新 fd %d 的緩衝區" #: jobs.c:529 msgid "start_pipeline: pgrp pipe" @@ -1151,7 +1147,7 @@ msgstr "start_pipeline: 行程群組管道" #: jobs.c:1084 #, c-format msgid "forked pid %d appears in running job %d" -msgstr "生成的行程識別號 %d 顯示為執行中的工作 %d" +msgstr "產生的行程識別號 %d 顯示為執行中的工作 %d" #: jobs.c:1203 #, c-format @@ -1227,12 +1223,12 @@ msgstr "子行程 setpgid (%ld 到 %ld)" #: jobs.c:2399 nojobs.c:657 #, c-format msgid "wait: pid %ld is not a child of this shell" -msgstr "wait: 行程識別號 %ld 不是當前 shell 的子行程" +msgstr "wait: 行程識別號 %ld 不是目前 shell 的子行程" #: jobs.c:2695 #, c-format msgid "wait_for: No record of process %ld" -msgstr "wiat_for: 沒有行程 %ld 的記錄" +msgstr "wiat_for: 沒有行程 %ld 的紀錄" #: jobs.c:3055 #, c-format @@ -1266,7 +1262,7 @@ msgstr " (核心已傾印)" #: jobs.c:4146 jobs.c:4159 #, c-format msgid "(wd now: %s)\n" -msgstr "(當前工作目錄:%s)\n" +msgstr "(目前工作目錄:%s)\n" #: jobs.c:4191 msgid "initialize_job_control: getpgrp failed" @@ -1317,11 +1313,11 @@ msgstr "malloc: 空閒串列中的區塊損壞" #: lib/malloc/malloc.c:932 msgid "free: called with already freed block argument" -msgstr "free: 用已經釋放的區塊做為呼叫引數" +msgstr "free: 用已經釋放的區塊做為呼叫參數" #: lib/malloc/malloc.c:935 msgid "free: called with unallocated block argument" -msgstr "free: 用未分配的區塊做為呼叫引數" +msgstr "free: 用未分配的區塊做為呼叫參數" #: lib/malloc/malloc.c:954 msgid "free: underflow detected; mh_nbytes out of range" @@ -1333,7 +1329,7 @@ msgstr "free: 啟始和末尾區塊大小不一致" #: lib/malloc/malloc.c:1070 msgid "realloc: called with unallocated block argument" -msgstr "realloc: 用未分配的區塊做為呼叫引數" +msgstr "realloc: 用未分配的區塊做為呼叫參數" #: lib/malloc/malloc.c:1085 msgid "realloc: underflow detected; mh_nbytes out of range" @@ -1379,7 +1375,7 @@ msgstr "%s:不當的網路路徑規格" #: lib/sh/netopen.c:347 msgid "network operations not supported" -msgstr "不支持網路操作" +msgstr "不支援網路操作" #: locale.c:205 #, c-format @@ -1435,7 +1431,7 @@ msgstr "make_here_document:不當的指示類型 %d" #: make_cmd.c:657 #, c-format msgid "here-document at line %d delimited by end-of-file (wanted `%s')" -msgstr "立即文件在第 %d 列被檔案結束符分隔 (需要「%s」)" +msgstr "立即檔案在第 %d 列被檔案結束符分隔 (需要「%s」)" #: make_cmd.c:756 #, c-format @@ -1444,9 +1440,7 @@ msgstr "make_redirection:重新導向指示「%d」超出範圍" #: parse.y:2380 #, c-format -msgid "" -"shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%lu): line " -"truncated" +msgid "shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%lu): line truncated" msgstr "shell_getc: shell_input_line_size (%zu) 超過 SIZE_MAX (%lu):列被截斷" #: parse.y:2786 @@ -1456,7 +1450,7 @@ msgstr "超過此處檔案上限最大值" #: parse.y:3536 parse.y:3906 #, c-format msgid "unexpected EOF while looking for matching `%c'" -msgstr "尋找匹配的「%c」時遇到了未預期的檔案結束符" +msgstr "尋找符合的「%c」時遇到了未預期的檔案結束符" #: parse.y:4606 msgid "unexpected EOF while looking for `]]'" @@ -1483,11 +1477,11 @@ msgstr "預期「)」" #: parse.y:4725 #, c-format msgid "unexpected argument `%s' to conditional unary operator" -msgstr "一元條件運算子使用了未預期的引數「%s」" +msgstr "一元條件運算子使用了未預期的參數「%s」" #: parse.y:4729 msgid "unexpected argument to conditional unary operator" -msgstr "一元條件運算子使用了未預期的引數" +msgstr "一元條件運算子使用了未預期的參數" #: parse.y:4775 #, c-format @@ -1501,26 +1495,26 @@ msgstr "需要二元條件運算子" #: parse.y:4801 #, c-format msgid "unexpected argument `%s' to conditional binary operator" -msgstr "二元條件運算子使用了未預期的引數「%s」" +msgstr "二元條件運算子使用了未預期的參數「%s」" #: parse.y:4805 msgid "unexpected argument to conditional binary operator" -msgstr "二元條件運算子使用了未預期的引數" +msgstr "二元條件運算子使用了未預期的參數" #: parse.y:4816 #, c-format msgid "unexpected token `%c' in conditional command" -msgstr "條件命令中有未預期的字組「%c」" +msgstr "條件指令中有未預期的字組「%c」" #: parse.y:4819 #, c-format msgid "unexpected token `%s' in conditional command" -msgstr "條件命令中有未預期的字組「%s」" +msgstr "條件指令中有未預期的字組「%s」" #: parse.y:4823 #, c-format msgid "unexpected token %d in conditional command" -msgstr "條件命令中有未預期的字組 %d" +msgstr "條件指令中有未預期的字組 %d" #: parse.y:6245 #, c-format @@ -1543,11 +1537,11 @@ msgstr "語法錯誤" #: parse.y:6335 #, c-format msgid "Use \"%s\" to leave the shell.\n" -msgstr "使用「%s」退出 shell 。\n" +msgstr "使用「%s」退出 shell。\n" #: parse.y:6497 msgid "unexpected EOF while looking for matching `)'" -msgstr "尋找匹配的「)」時遇到了未預期的檔案結束符" +msgstr "尋找符合的「)」時遇到了未預期的檔案結束符" #: pcomplete.c:1132 #, c-format @@ -1610,7 +1604,7 @@ msgstr "%s: 受限的: 無法重定向輸出" #: redir.c:188 #, c-format msgid "cannot create temp file for here-document: %s" -msgstr "無法為立即文件建立臨時檔案: %s" +msgstr "無法為立即檔案建立暫存檔案: %s" #: redir.c:192 #, c-format @@ -1627,7 +1621,7 @@ msgstr "重定向錯誤: 無法複製檔案描述符" #: shell.c:343 msgid "could not find /tmp, please create!" -msgstr "無法找到 /tmp ,請建立" +msgstr "無法找到 /tmp,請建立" #: shell.c:347 msgid "/tmp must be a valid directory name" @@ -1689,7 +1683,7 @@ msgstr "Shell 選項:\n" #: shell.c:1988 msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" -msgstr "\t-irsD 或 -c <命令> 或 -O \t\t(僅適合呼叫)\n" +msgstr "\t-irsD 或 -c <指令> 或 -O \t\t(僅適合呼叫)\n" #: shell.c:2007 #, c-format @@ -1704,12 +1698,12 @@ msgstr "輸入「%s -c \"help set\"」更多關於 shell 選項的訊息。\n" #: shell.c:2014 #, c-format msgid "Type `%s -c help' for more information about shell builtin commands.\n" -msgstr "輸入「%s -c help」更多關於內建 shell 命令的訊息。\n" +msgstr "輸入「%s -c help」更多關於內建 shell 指令的訊息。\n" #: shell.c:2015 #, c-format msgid "Use the `bashbug' command to report bugs.\n" -msgstr "使用「bashbug」命令通報程式錯誤。\n" +msgstr "使用「bashbug」指令通報程式錯誤。\n" #: shell.c:2017 #, c-format @@ -1724,7 +1718,7 @@ msgstr "GNU 軟體的常見使用說明:\n" #: sig.c:730 #, c-format msgid "sigprocmask: %d: invalid operation" -msgstr "sigprocmask: %d:無效操作" +msgstr "sigprocmask:%d:無效操作" #: siglist.c:48 msgid "Bogus signal" @@ -1876,7 +1870,7 @@ msgstr "已授予 HFT 監視模式" #: siglist.c:207 msgid "HFT monitor mode retracted" -msgstr "已撤銷 HFT 監視模式" +msgstr "已復原 HFT 監視模式" #: siglist.c:211 msgid "HFT sound sequence has completed" @@ -1898,7 +1892,7 @@ msgstr "不明訊號 #%d" #: subst.c:1454 subst.c:1644 #, c-format msgid "bad substitution: no closing `%s' in %s" -msgstr "錯誤的替換: 在 %2$s 中沒有閉合的「%1$s」" +msgstr "錯誤的取代: 在 %2$s 中沒有閉合的「%1$s」" #: subst.c:3231 #, c-format @@ -1907,11 +1901,11 @@ msgstr "%s: 無法將串列指派給陣列成員" #: subst.c:5789 subst.c:5805 msgid "cannot make pipe for process substitution" -msgstr "無法為行程替換建立管道" +msgstr "無法為行程取代建立管道" #: subst.c:5851 msgid "cannot make child for process substitution" -msgstr "無法為行程替換建立子行程" +msgstr "無法為行程取代建立子行程" #: subst.c:5920 #, c-format @@ -1930,15 +1924,15 @@ msgstr "無法將命名管道 %s 做為檔案描述符 %d 複製" #: subst.c:6062 msgid "command substitution: ignored null byte in input" -msgstr "指令替換:在輸入中忽略了空位元組" +msgstr "指令取代:在輸入中忽略了空位元組" #: subst.c:6190 msgid "cannot make pipe for command substitution" -msgstr "無法為命令替換建立管道" +msgstr "無法為指令取代建立管道" #: subst.c:6233 msgid "cannot make child for command substitution" -msgstr "無法為命令替換建立子行程" +msgstr "無法為指令取代建立子行程" #: subst.c:6259 msgid "command_substitute: cannot duplicate pipe as fd 1" @@ -1952,7 +1946,7 @@ msgstr "%s: 無效的引用變數名" #: subst.c:6806 subst.c:6824 subst.c:6979 #, c-format msgid "%s: invalid indirect expansion" -msgstr "%s: 無效的間接擴展" +msgstr "%s: 無效的間接擴充" #: subst.c:6840 subst.c:6987 #, c-format @@ -1977,7 +1971,7 @@ msgstr "%s: 子串表示式 < 0" #: subst.c:8973 subst.c:8994 #, c-format msgid "%s: bad substitution" -msgstr "%s: 錯誤的替換" +msgstr "%s: 錯誤的取代" #: subst.c:9082 #, c-format @@ -1985,24 +1979,22 @@ msgid "$%s: cannot assign in this way" msgstr "$%s: 無法如此指派" #: subst.c:9485 -msgid "" -"future versions of the shell will force evaluation as an arithmetic " -"substitution" -msgstr "未來版本的 shell 會強制以算術替換求值" +msgid "future versions of the shell will force evaluation as an arithmetic substitution" +msgstr "未來版本的 shell 會強制以算術取代求值" #: subst.c:10043 #, c-format msgid "bad substitution: no closing \"`\" in %s" -msgstr "錯誤的替換: 在 %s 中沒有閉合的「`」" +msgstr "錯誤的取代: 在 %s 中沒有閉合的「`」" #: subst.c:11070 #, c-format msgid "no match: %s" -msgstr "無匹配: %s" +msgstr "無符合: %s" #: test.c:147 msgid "argument expected" -msgstr "需要引數" +msgstr "需要參數" #: test.c:156 #, c-format @@ -2034,7 +2026,7 @@ msgstr "缺少「]」" #: trap.c:216 msgid "invalid signal number" -msgstr "無效信號數字" +msgstr "無效訊號數字" #: trap.c:320 #, c-format @@ -2048,14 +2040,13 @@ msgstr "run_pending_traps: trap_list[%d] 中的錯誤值: %p" #: trap.c:412 #, c-format -msgid "" -"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" -msgstr "run_pending_traps: 信號處理是 SIG_DFL,resending %d (%s) to myself" +msgid "run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "run_pending_traps:訊號處理是 SIG_DFL,resending %d (%s) to myself" #: trap.c:470 #, c-format msgid "trap_handler: bad signal %d" -msgstr "trap_handler:不當的信號 %d" +msgstr "trap_handler:不當的訊號 %d" #: variables.c:412 #, c-format @@ -2065,11 +2056,11 @@ msgstr "錯誤,輸入的函數定義為「%s」" #: variables.c:821 #, c-format msgid "shell level (%d) too high, resetting to 1" -msgstr "shell 層次 (%d) 太高,重置為 1" +msgstr "shell 層次 (%d) 太高,重設為 1" #: variables.c:2655 msgid "make_local_variable: no function context at current scope" -msgstr "make_local_variable: 當前作用域中沒有函數語境" +msgstr "make_local_variable: 目前作用域中沒有函數語境" #: variables.c:2674 #, c-format @@ -2083,7 +2074,7 @@ msgstr "%s:指定數字至名稱參考" #: variables.c:4365 msgid "all_local_variables: no function context at current scope" -msgstr "all_local_variables: 當前作用域中沒有函數語境" +msgstr "all_local_variables: 目前作用域中沒有函數語境" #: variables.c:4698 #, c-format @@ -2132,12 +2123,8 @@ msgid "Copyright (C) 2018 Free Software Foundation, Inc." msgstr "著作權所有 (C) 2018 自由軟體基金會" #: version.c:47 version2.c:47 -msgid "" -"License GPLv3+: GNU GPL version 3 or later \n" -msgstr "" -"許可證 GPLv3+: GNU GPL 許可證第三版或者更新版本 \n" +msgid "License GPLv3+: GNU GPL version 3 or later \n" +msgstr "授權條款 GPLv3+: GNU GPL 授權條款第三版或者更新版本 \n" #: version.c:86 version2.c:86 #, c-format @@ -2146,7 +2133,7 @@ msgstr "GNU bash,版本 %s (%s)\n" #: version.c:91 version2.c:91 msgid "This is free software; you are free to change and redistribute it." -msgstr "本軟體是自由軟體,您可以自由地更改和重新發布。" +msgstr "本軟體是自由軟體,您可以自由地變更和重新發布。" #: version.c:92 version2.c:92 msgid "There is NO WARRANTY, to the extent permitted by law." @@ -2181,12 +2168,8 @@ msgid "unalias [-a] name [name ...]" msgstr "unalias [-a] 名稱 [名稱 …]" #: builtins.c:53 -msgid "" -"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" -"x keyseq:shell-command] [keyseq:readline-function or readline-command]" -msgstr "" -"bind [-lpvsPSVX] [-m 鍵對映] [-f 檔名] [-q 名稱] [-u 名稱] [-r 鍵序列] [-x 鍵" -"序列:shell- 命令] [鍵序列:readline- 函數 或 readline- 命令]" +msgid "bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "bind [-lpvsPSVX] [-m 按鍵映射] [-f 檔名] [-q 名稱] [-u 名稱] [-r 鍵序列] [-x 鍵序列:shell- 指令] [鍵序列:readline- 函數 或 readline- 指令]" #: builtins.c:56 msgid "break [n]" @@ -2198,7 +2181,7 @@ msgstr "continue [n]" #: builtins.c:60 msgid "builtin [shell-builtin [arg ...]]" -msgstr "builtin [shell 內建 [引數 …]]" +msgstr "builtin [shell 內建物件 [參數 …]]" #: builtins.c:63 msgid "caller [expr]" @@ -2214,7 +2197,7 @@ msgstr "pwd [-LP]" #: builtins.c:76 msgid "command [-pVv] command [arg ...]" -msgstr "command [-pVv] 命令 [引數 …]" +msgstr "command [-pVv] 指令 [參數 …]" #: builtins.c:78 msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" @@ -2230,11 +2213,11 @@ msgstr "local [option] 名稱[=值] …" #: builtins.c:85 msgid "echo [-neE] [arg ...]" -msgstr "echo [-neE] [引數 …]" +msgstr "echo [-neE] [參數 …]" #: builtins.c:89 msgid "echo [-n] [arg ...]" -msgstr "echo [-n] [引數 …]" +msgstr "echo [-n] [參數 …]" #: builtins.c:92 msgid "enable [-a] [-dnps] [-f filename] [name ...]" @@ -2242,15 +2225,15 @@ msgstr "enable [-a] [-dnps] [-f 檔名] [名稱 …]" #: builtins.c:94 msgid "eval [arg ...]" -msgstr "eval [引數 …]" +msgstr "eval [參數 …]" #: builtins.c:96 msgid "getopts optstring name [arg]" -msgstr "getopts 選項字串 名稱 [引數]" +msgstr "getopts 選項字串 名稱 [參數]" #: builtins.c:98 msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" -msgstr "exec [-cl] [-a 名稱] [命令 [引數 …]] [重定向 …]" +msgstr "exec [-cl] [-a 名稱] [指令 [參數 …]] [重定向 …]" #: builtins.c:100 msgid "exit [n]" @@ -2262,7 +2245,7 @@ msgstr "logout [n]" #: builtins.c:105 msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" -msgstr "fc [-e 編輯器名] [-lnr] [起始] [終結] 或 fc -s [模式=替換串] [命令]" +msgstr "fc [-e 編輯器名] [-lnr] [起始] [終止] 或 fc -s [模式=取代串] [指令]" #: builtins.c:109 msgid "fg [job_spec]" @@ -2281,40 +2264,28 @@ msgid "help [-dms] [pattern ...]" msgstr "help [-dms] [模式 …]" #: builtins.c:123 -msgid "" -"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " -"[arg...]" -msgstr "" -"history [-c] [-d 偏移量] [n] 或 history -anrw [檔名] 或 history -ps 引數 [參" -"數…]" +msgid "history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]" +msgstr "history [-c] [-d 偏移量] [n] 或 history -anrw [檔名] 或 history -ps 參數 [參數…]" #: builtins.c:127 msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" -msgstr "jobs [-lnprs] [工作規格 …] 或 jobs -x 命令 [引數]" +msgstr "jobs [-lnprs] [工作規格 …] 或 jobs -x 指令 [參數]" #: builtins.c:131 msgid "disown [-h] [-ar] [jobspec ... | pid ...]" msgstr "disown [-h] [-ar] [jobspec ... | pid ...]" #: builtins.c:134 -msgid "" -"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " -"[sigspec]" -msgstr "" -"kill [-s 訊號規格 | -n 訊號編號 | - 訊號規格] 行程識別號 | 工作規格 … 或 " -"kill -l [訊號規格]" +msgid "kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]" +msgstr "kill [-s 訊號規格 | -n 訊號編號 | - 訊號規格] 行程識別號 | 工作規格 … 或 kill -l [訊號規格]" #: builtins.c:136 msgid "let arg [arg ...]" -msgstr "let 引數 [引數 …]" +msgstr "let 參數 [參數 …]" #: builtins.c:138 -msgid "" -"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " -"prompt] [-t timeout] [-u fd] [name ...]" -msgstr "" -"read [-ers] [-a 陣列] [-d 分隔符] [-i 緩衝區文字] [-n 讀取字元數] [-N 讀取字" -"符數] [-p 提示符] [-t 逾時] [-u 檔案描述符] [名稱 …]" +msgid "read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]" +msgstr "read [-ers] [-a 陣列] [-d 分隔符] [-i 緩衝區文字] [-n 讀取字元數] [-N 讀取字元數] [-p 提示符] [-t 逾時] [-u 檔案描述符] [名稱 …]" #: builtins.c:140 msgid "return [n]" @@ -2322,7 +2293,7 @@ msgstr "return [n]" #: builtins.c:142 msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" -msgstr "set [--abefhkmnptuvxBCHP] [-o 選項名] [--] [引數 …]" +msgstr "set [--abefhkmnptuvxBCHP] [-o 選項名] [--] [參數 …]" #: builtins.c:144 msgid "unset [-f] [-v] [-n] [name ...]" @@ -2342,11 +2313,11 @@ msgstr "shift [n]" #: builtins.c:152 msgid "source filename [arguments]" -msgstr "source 檔名 [引數]" +msgstr "source 檔名 [參數]" #: builtins.c:154 msgid ". filename [arguments]" -msgstr "。檔名 [引數]" +msgstr ". 檔名 [參數]" #: builtins.c:157 msgid "suspend [-f]" @@ -2358,11 +2329,11 @@ msgstr "test [表示式]" #: builtins.c:162 msgid "[ arg... ]" -msgstr "[ 引數… ]" +msgstr "[ 參數… ]" #: builtins.c:166 msgid "trap [-lp] [[arg] signal_spec ...]" -msgstr "trap [-lp] [[引數] 訊號規格 …]" +msgstr "trap [-lp] [[參數] 訊號規格 …]" #: builtins.c:168 msgid "type [-afptP] name [name ...]" @@ -2386,15 +2357,15 @@ msgstr "wait [行程識別號 …]" #: builtins.c:184 msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" -msgstr "for 名稱 [in 字詞 … ] ; do 命令 ; done" +msgstr "for 名稱 [in 字詞 … ] ; do 指令 ; done" #: builtins.c:186 msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" -msgstr "for (( 表示式1; 表示式2; 表示式3 )); do 命令 ; done" +msgstr "for (( 表示式1; 表示式2; 表示式3 )); do 指令 ; done" #: builtins.c:188 msgid "select NAME [in WORDS ... ;] do COMMANDS; done" -msgstr "select NAME [in 字詞 … ;] do 命令 ; done" +msgstr "select NAME [in 字詞 … ;] do 指令 ; done" #: builtins.c:190 msgid "time [-p] pipeline" @@ -2402,33 +2373,31 @@ msgstr "time [-p] 管道" #: builtins.c:192 msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" -msgstr "case 詞 in [模式 [| 模式]…) 命令 ;;]… esac" +msgstr "case 詞 in [模式 [| 模式]…) 指令 ;;]… esac" #: builtins.c:194 -msgid "" -"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " -"COMMANDS; ] fi" -msgstr "if 命令 ; then 命令 ; [ elif 命令 ; then 命令 ; ]… [ else 命令 ; ] fi" +msgid "if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi" +msgstr "if 指令 ; then 指令 ; [ elif 指令 ; then 指令 ; ]… [ else 指令 ; ] fi" #: builtins.c:196 msgid "while COMMANDS; do COMMANDS; done" -msgstr "while 命令 ; do 命令 ; done" +msgstr "while 指令 ; do 指令 ; done" #: builtins.c:198 msgid "until COMMANDS; do COMMANDS; done" -msgstr "until 命令 ; do 命令 ; done" +msgstr "until 指令 ; do 指令 ; done" #: builtins.c:200 msgid "coproc [NAME] command [redirections]" -msgstr "coproc [名稱] 命令 [重定向]" +msgstr "coproc [名稱] 指令 [重定向]" #: builtins.c:202 msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" -msgstr "function 名稱 { 命令 ; } 或 name () { 命令 ; }" +msgstr "function 名稱 { 指令 ; } 或 name () { 指令 ; }" #: builtins.c:204 msgid "{ COMMANDS ; }" -msgstr "{ 命令 ; }" +msgstr "{ 指令 ; }" #: builtins.c:206 msgid "job_spec [&]" @@ -2464,44 +2433,27 @@ msgstr "shopt [-pqsu] [-o] [選項名 …]" #: builtins.c:228 msgid "printf [-v var] format [arguments]" -msgstr "printf [-v var] 格式 [引數]" +msgstr "printf [-v var] 格式 [參數]" #: builtins.c:231 -msgid "" -"complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-" -"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " -"suffix] [name ...]" -msgstr "" -"complete [-abcdefgjksuv] [-pr] [-DEI] [-o 選項] [-A 動作] [-G 全域模式] [-W " -"詞語列表] [-F 函數] [-C 命令] [-X 過濾模式] [-P 字首] [-S 字尾] [名稱 …]" +msgid "complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]" +msgstr "complete [-abcdefgjksuv] [-pr] [-DEI] [-o 選項] [-A 動作] [-G 全域模式] [-W 詞語列表] [-F 函數] [-C 指令] [-X 過濾模式] [-P 字首] [-S 字尾] [名稱 …]" #: builtins.c:235 -msgid "" -"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " -"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" -msgstr "" -"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " -"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgid "compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" #: builtins.c:239 msgid "compopt [-o|+o option] [-DEI] [name ...]" msgstr "compopt [-o|+o 選項] [-DEI] [名稱 …]" #: builtins.c:242 -msgid "" -"mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C " -"callback] [-c quantum] [array]" -msgstr "" -"mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C " -"callback] [-c quantum] [array]" +msgid "mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]" +msgstr "mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]" #: builtins.c:244 -msgid "" -"readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C " -"callback] [-c quantum] [array]" -msgstr "" -"readarray [-d 分割符號] [-n 計數] [-O 起始序號] [-s 計數] [-t] [-u fd] [-C 回" -"呼] [-c 定量] [陣列]" +msgid "readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]" +msgstr "readarray [-d 分割符號] [-n 計數] [-O 起始序號] [-s 計數] [-t] [-u fd] [-C 回呼] [-c 定量] [陣列]" #: builtins.c:256 msgid "" @@ -2518,24 +2470,23 @@ msgid "" " -p\tprint all defined aliases in a reusable format\n" " \n" " Exit Status:\n" -" alias returns true unless a NAME is supplied for which no alias has " -"been\n" +" alias returns true unless a NAME is supplied for which no alias has been\n" " defined." msgstr "" "定義或顯示別名。\n" " \n" -" 不帶引數時,「alias」以可重用的格式\n" +" 不帶參數時,「alias」以可重用的格式\n" " 「alias 名稱=值」在標準輸出裝置上印出別名列表。\n" " \n" -" 否則,對於每個給定值的名稱定義一個別名。\n" +" 否則,對於每個指定值的名稱定義一個別名。\n" " 值末尾的空格會使下一個字詞被檢測\n" -" 做為別名替換展開。\n" +" 做為別名取代展開。\n" " \n" " 選項:\n" " -p\t以可重用的格式印出所有的已定義別名\n" " \n" " 退出狀態:\n" -" 除非一個沒有定義的名字被做為引數提供,否則 alias \n" +" 除非一個沒有定義的名字被做為參數提供,否則 alias \n" " 回傳值為真。" #: builtins.c:278 @@ -2547,12 +2498,12 @@ msgid "" " \n" " Return success unless a NAME is not an existing alias." msgstr "" -"從別名定義列表中刪除每一個 NAME。\n" +"從別名定義列表中刪除每一個 <名稱>。\n" " \n" " 選項:\n" " -a\t刪除所有的別名定義\n" " \n" -" 回傳成功,除非 NAME 不是一個已存在的別名。" +" 回傳成功,除非 <名稱> 不是一個已存在的別名。" #: builtins.c:291 msgid "" @@ -2566,30 +2517,25 @@ msgid "" " Options:\n" " -m keymap Use KEYMAP as the keymap for the duration of this\n" " command. Acceptable keymap names are emacs,\n" -" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" -"move,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,\n" " vi-command, and vi-insert.\n" " -l List names of functions.\n" " -P List function names and bindings.\n" " -p List functions and bindings in a form that can be\n" " reused as input.\n" -" -S List key sequences that invoke macros and their " -"values\n" -" -s List key sequences that invoke macros and their " -"values\n" +" -S List key sequences that invoke macros and their values\n" +" -s List key sequences that invoke macros and their values\n" " in a form that can be reused as input.\n" " -V List variable names and values\n" " -v List variable names and values in a form that can\n" " be reused as input.\n" " -q function-name Query about which keys invoke the named function.\n" -" -u function-name Unbind all keys which are bound to the named " -"function.\n" +" -u function-name Unbind all keys which are bound to the named function.\n" " -r keyseq Remove the binding for KEYSEQ.\n" " -f filename Read key bindings from FILENAME.\n" " -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" " \t\t\t\tKEYSEQ is entered.\n" -" -X List key sequences bound with -x and associated " -"commands\n" +" -X List key sequences bound with -x and associated commands\n" " in a form that can be reused as input.\n" " \n" " Exit Status:\n" @@ -2598,30 +2544,27 @@ msgstr "" "設定 Readline 鍵繫結和變數。\n" " \n" " 繫結一個鍵序列到一個 Readline 函數或者巨集,或者設定一個\n" -" Readline 變數。非選項引數的語法和 ~/.inputrc 檔案中的等\n" -" 同,但是必須做為一個引數被傳遞,\n" +" Readline 變數。非選項參數的語法和 ~/.inputrc 檔案中的等\n" +" 同,但是必須做為一個參數被傳遞,\n" " 例如,bind '\"\\C-x\\C-r\": re-read-init-file'。\n" " \n" " 選項:\n" -" -m 鍵對映 在此命令執行過程中使用指定的鍵對映。\n" -" 可被接受的鍵對映名字有 emacs、emacs-standard、emacs-" -"meta、\n" +" -m 按鍵映射 在此指令執行過程中使用指定的按鍵映射。\n" +" 可被接受的按鍵映射名字有 emacs、emacs-standard、emacs-meta、\n" " emacs-ctlx、vi、vi-move、vi-command、和 vi-insert。\n" " -l 列出函數名稱。\n" " -P 列出函數名稱和繫結。\n" " -p 以可以重新用作輸入的格式列出函數名稱和繫結。\n" " -S 列出可以啟動巨集的鍵序列以及它們的值\n" -" -s 以可以重新用作輸入的格式列出可以啟動巨集的鍵以及它們的" -"值。\n" +" -s 以可以重新用作輸入的格式列出可以啟動巨集的鍵以及它們的值。\n" " -V 列出變數名稱和它們的值\n" " -v 以可以重新用作輸入的格式列出變數的名稱和它們的值\n" " -q 函數名 查詢指定的函數可以由哪些鍵啟動。\n" " -u 函數名 反繫結所有繫結至指定函數的鍵。\n" " -r 鍵序列 取消指定鍵序列的繫結。\n" " -f 檔名 從指定檔案中讀取鍵繫結。\n" -" -x 鍵序列:shell 命令\t當指定的鍵序列被輸入時,執行指定的 shell 命" -"令。\n" -" -X 以可被重用的形式列出用 -x 繫結的鍵序列和命令。\n" +" -x 鍵序列:shell 指令\t當指定的鍵序列被輸入時,執行指定的 shell 指令。\n" +" -X 以可被重用的形式列出用 -x 繫結的鍵序列和指令。\n" " \n" " 退出狀態:\n" " 除非使用了無法辨認的選項或者錯誤發生,否則回傳 0。" @@ -2656,8 +2599,8 @@ msgid "" msgstr "" "繼續 for、while 或 until 迴圈。\n" " \n" -" 繼續當前 FOR、WHILE 或 UNTIL 迴圈的下一步。\n" -" 如果指定了 N, 則繼續當前的第 N 重迴圈。\n" +" 繼續目前 FOR、WHILE 或 UNTIL 迴圈的下一步。\n" +" 如果指定了 N, 則繼續目前的第 N 重迴圈。\n" " \n" " 退出狀態:\n" " 退出狀態為 0 除非 N 不大於或等於 1。" @@ -2668,22 +2611,20 @@ msgid "" " \n" " Execute SHELL-BUILTIN with arguments ARGs without performing command\n" " lookup. This is useful when you wish to reimplement a shell builtin\n" -" as a shell function, but need to execute the builtin within the " -"function.\n" +" as a shell function, but need to execute the builtin within the function.\n" " \n" " Exit Status:\n" " Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" " not a shell builtin." msgstr "" -"執行 shell 內建。\n" +"執行 shell 內建物件。\n" " \n" -" 帶 <參數> 執行 而不做命令查詢\n" -" 在希望以 shell 函數的形式來重新實現 shell 內建,\n" -" 但需要在函數之內執行該 shell 內建的情況下有用處。\n" +" 帶 <參數> 執行 而不做指令查詢\n" +" 在希望以 shell 函數的形式來重新實現 shell 內建物件,\n" +" 但需要在函數之內執行該 shell 內建物件的情況下有用處。\n" " \n" " 退出狀態:\n" -" 以 的退出狀態為準,或者如果 不是一個 shell 內建" -"時\n" +" 以 的退出狀態為準,或者如果 不是一個 shell 內建物件時\n" " 回傳 false。" #: builtins.c:369 @@ -2701,13 +2642,13 @@ msgid "" " Returns 0 unless the shell is not executing a shell function or EXPR\n" " is invalid." msgstr "" -"回傳當前子呼叫的語境。\n" +"回傳目前子呼叫的語境。\n" " \n" " 不帶有 EXPR 時,回傳「$line $filename」。帶有 EXPR 時,回傳\n" " 「$line $subroutine $filename」;這個額外的資訊可以被用於提供\n" " 堆疊追蹤。\n" " \n" -" EXPR 的值顯示了到當前呼叫框格需要回去多少個呼叫框格;頂部框格\n" +" EXPR 的值顯示了到目前呼叫框格需要回去多少個呼叫框格;頂部框格\n" " 是第 0 框格。\n" " \n" " 退出狀態:\n" @@ -2718,22 +2659,16 @@ msgstr "" msgid "" "Change the shell working directory.\n" " \n" -" Change the current directory to DIR. The default DIR is the value of " -"the\n" +" Change the current directory to DIR. The default DIR is the value of the\n" " HOME shell variable.\n" " \n" -" The variable CDPATH defines the search path for the directory " -"containing\n" -" DIR. Alternative directory names in CDPATH are separated by a colon " -"(:).\n" -" A null directory name is the same as the current directory. If DIR " -"begins\n" +" The variable CDPATH defines the search path for the directory containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon (:).\n" +" A null directory name is the same as the current directory. If DIR begins\n" " with a slash (/), then CDPATH is not used.\n" " \n" -" If the directory is not found, and the shell option `cdable_vars' is " -"set,\n" -" the word is assumed to be a variable name. If that variable has a " -"value,\n" +" If the directory is not found, and the shell option `cdable_vars' is set,\n" +" the word is assumed to be a variable name. If that variable has a value,\n" " its value is used for DIR.\n" " \n" " Options:\n" @@ -2749,41 +2684,33 @@ msgid "" " \t\tattributes as a directory containing the file attributes\n" " \n" " The default is to follow symbolic links, as if `-L' were specified.\n" -" `..' is processed by removing the immediately previous pathname " -"component\n" +" `..' is processed by removing the immediately previous pathname component\n" " back to a slash or the beginning of DIR.\n" " \n" " Exit Status:\n" -" Returns 0 if the directory is changed, and if $PWD is set successfully " -"when\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully when\n" " -P is used; non-zero otherwise." msgstr "" "變更 shell 工作目錄。\n" " \n" -" 變更當前目錄至 DIR 目錄。預設的 DIR 目錄是 shell 變數 HOME\n" +" 變更目前目錄至 <目錄>。預設的 <目錄> 是 shell 變數 HOME\n" " 的值。\n" " \n" -" 變數 CDPATH 定義了含有 DIR 的目錄搜尋路徑,其中不同的目錄名稱由冒號 (:)分" -"隔。\n" -" 一個空的目錄名稱表示當前目錄。如果要切換到的 DIR 由斜線 (/) 開頭,則 " -"CDPATH\n" +" 變數 CDPATH 定義了含有 <目錄> 的目錄搜尋路徑,其中不同的目錄名稱由冒號 (:)分隔。\n" +" 一個空的目錄名稱表示目前目錄。如果要切換到的 <目錄> 由斜線 (/) 開頭,則 CDPATH\n" " 變數不會被使用。\n" " \n" -" 如果路徑找不到,並且 shell 選項「cdable_vars」被設定,則引數詞被假定為一" -"個\n" -" 變數名。如果該變數有值,則它的值被當做 DIR 目錄。\n" +" 如果路徑找不到,並且 shell 選項「cdable_vars」被設定,則參數詞被假定為一個\n" +" 變數名。如果該變數有值,則它的值被當做 <目錄>。\n" " \n" " 選項:\n" -" -L\t強制跟隨符號鏈結: 在處理「..」之後解析 DIR 中的符號鏈結。\n" -" -P\t使用實體目錄結構而不跟隨符號鏈結: 在處理「..」之前解析 DIR 中的符" -"號鏈結。\n" -" -e\t如果使用了 -P 引數,但不能成功確定當前工作目錄時,回傳非零的回傳" -"值。\n" -" -@\t在支援擴展屬性的系統上,將一個有這些屬性的檔案當做有檔案屬性的目" -"錄。\n" +" -L\t強制跟隨符號連結: 在處理「..」之後解析 <目錄> 中的符號連結。\n" +" -P\t使用實體目錄結構而不跟隨符號連結: 在處理「..」之前解析 <目錄> 中的符號連結。\n" +" -e\t如果使用了 -P 參數,但不能成功確定目前工作目錄時,回傳非零的回傳值。\n" +" -@\t在支援擴充屬性的系統上,將一個有這些屬性的檔案當做有檔案屬性的目錄。\n" " \n" -" 預設情況下跟隨符號鏈結,如同指定「-L」。\n" -" 「..」使用移除向前相鄰目錄名成員直到 DIR 開始或一個斜線的方式處理。\n" +" 預設情況下跟隨符號連結,如同指定「-L」。\n" +" 「..」使用移除向前相鄰目錄名成員直到 <目錄> 開始或一個斜線的方式處理。\n" " \n" " 退出狀態:\n" " 如果目錄變更,或在使用 -P 選項時 $PWD 修改成功時回傳 0,否則非零。" @@ -2803,16 +2730,16 @@ msgid "" " Returns 0 unless an invalid option is given or the current directory\n" " cannot be read." msgstr "" -"印出當前工作目錄的名字。\n" +"印出目前工作目錄的名字。\n" " \n" " 選項:\n" -" -L\t印出 $PWD 變數的值,如果它包含了當前的工作目錄\n" -" -P\t印出當前的實體路徑,不帶有任何的符號鏈結\n" +" -L\t印出 $PWD 變數的值,如果它包含了目前的工作目錄\n" +" -P\t印出目前的實體路徑,不帶有任何的符號連結\n" " \n" " 預設情況下,「pwd」的行為和帶「-L」選項一致\n" " \n" " 退出狀態:\n" -" 除非使用了無效選項或者當前目錄不可讀,否則回傳狀態為 0。" +" 除非使用了無效選項或者目前目錄不可讀,否則回傳狀態為 0。" #: builtins.c:442 msgid "" @@ -2823,9 +2750,9 @@ msgid "" " Exit Status:\n" " Always succeeds." msgstr "" -"空的命令。\n" +"空的指令。\n" " \n" -" 沒有效果; 此命令不做任何操作。\n" +" 沒有效果;此指令不做任何操作。\n" " \n" " 退出狀態:\n" " 一律成功。" @@ -2859,8 +2786,7 @@ msgid "" "Execute a simple command or display information about commands.\n" " \n" " Runs COMMAND with ARGS suppressing shell function lookup, or display\n" -" information about the specified COMMANDs. Can be used to invoke " -"commands\n" +" information about the specified COMMANDs. Can be used to invoke commands\n" " on disk when a function with the same name exists.\n" " \n" " Options:\n" @@ -2872,19 +2798,19 @@ msgid "" " Exit Status:\n" " Returns exit status of COMMAND, or failure if COMMAND is not found." msgstr "" -"執行一個簡單命令或者顯示命令的相關資訊。\n" +"執行一個簡單指令或者顯示指令的相關資訊。\n" " \n" -" 帶 ARGS 引數執行 COMMAND 命令且抑制 shell 函數查詢,或顯示\n" -" 指定的 COMMAND 命令的資訊。可以在存在相同名稱函數定義的\n" -" 情況下被用於啟動磁碟上的命令。\n" +" 帶 ARGS 參數執行 COMMAND 指令且抑制 shell 函數查詢,或顯示\n" +" 指定的 COMMAND 指令的資訊。可以在存在相同名稱函數定義的\n" +" 情況下被用於啟動磁碟上的指令。\n" " \n" " 選項:\n" " -p\t使用 PATH 變數的一個預設值以確保所有的標準工具都能被找到。\n" -" -v\t印出 COMMAND 命令的描述,和「type」內建相似\n" -" -V\t印出每個 COMMAND 命令的詳細描述\n" +" -v\t印出 COMMAND 指令的描述,和「type」內建相似\n" +" -V\t印出每個 COMMAND 指令的詳細描述\n" " \n" " 退出狀態:\n" -" 回傳 COMMAND 命令的回傳狀態,或者當找不到 COMMAND 命令時失敗。" +" 回傳 COMMAND 指令的回傳狀態,或者當找不到 COMMAND 指令時失敗。" #: builtins.c:490 msgid "" @@ -2917,8 +2843,7 @@ msgid "" " Variables with the integer attribute have arithmetic evaluation (see\n" " the `let' command) performed when the variable is assigned a value.\n" " \n" -" When used in a function, `declare' makes NAMEs local, as with the " -"`local'\n" +" When used in a function, `declare' makes NAMEs local, as with the `local'\n" " command. The `-g' option suppresses this behavior.\n" " \n" " Exit Status:\n" @@ -2927,7 +2852,7 @@ msgid "" msgstr "" "設定變數值和屬性。\n" " \n" -" 規範變數並且賦予它們屬性。如果沒用給定名稱,\n" +" 規範變數並且賦予它們屬性。如果沒用指定名稱,\n" " 則顯示所有變數的屬性和值。\n" " \n" " 選項:\n" @@ -2950,10 +2875,10 @@ msgstr "" " 用「+」代替「-」會關閉指定選項。\n" " \n" " 帶有整數屬性的變數在指派時將使用算術求值(見\n" -" 「let」命令)\n" +" 「let」指令)\n" " \n" -" 在函數中使用時,「declare」使 <名稱> 成為本地變數,和「local」\n" -" 命令一致。「-g」選項壓制這個行為\n" +" 在函數中使用時,「declare」使 <名稱> 成為本機變數,和「local」\n" +" 指令一致。「-g」選項壓制這個行為\n" " \n" " 退出狀態:\n" " 回傳成功除非使用了無效選項或者發生錯誤。" @@ -2982,25 +2907,22 @@ msgid "" " Returns success unless an invalid option is supplied, a variable\n" " assignment error occurs, or the shell is not executing a function." msgstr "" -"定義本地變數。\n" +"定義本機變數。\n" " \n" -" 建立一個以 NAME 為名稱的變數,並且將 VALUE 指派給它。\n" +" 建立一個以 <名稱> 為名稱的變數,並且將 VALUE 指派給它。\n" " OPTION 選項可以是任何能被「declare」接受的選項。\n" " \n" -" 本地變數只能在函數內部被使用,它們只能在定義它們的函數內\n" +" 本機變數只能在函數內部被使用,它們只能在定義它們的函數內\n" " 部以及子函數中可見。\n" " \n" " 退出狀態:\n" -" 回傳成功,除非使用了無效的選項、發生了指派錯誤或者 shell 不在執行一個函" -"數。" +" 回傳成功,除非使用了無效的選項、發生了指派錯誤或者 shell 不在執行一個函數。" #: builtins.c:555 -#, fuzzy msgid "" "Write arguments to the standard output.\n" " \n" -" Display the ARGs, separated by a single space character and followed by " -"a\n" +" Display the ARGs, separated by a single space character and followed by a\n" " newline, on the standard output.\n" " \n" " Options:\n" @@ -3024,19 +2946,17 @@ msgid "" " \t\t0 to 3 octal digits\n" " \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" " \t\tcan be one or two hex digits\n" -" \\uHHHH\tthe Unicode character whose value is the hexadecimal value " -"HHHH.\n" +" \\uHHHH\tthe Unicode character whose value is the hexadecimal value HHHH.\n" " \t\tHHHH can be one to four hex digits.\n" -" \\UHHHHHHHH the Unicode character whose value is the hexadecimal " -"value\n" +" \\UHHHHHHHH the Unicode character whose value is the hexadecimal value\n" " \t\tHHHHHHHH. HHHHHHHH can be one to eight hex digits.\n" " \n" " Exit Status:\n" " Returns success unless a write error occurs." msgstr "" -"將引數寫入標準輸出。\n" +"將參數寫入標準輸出。\n" " \n" -" 在標準輸出上,顯示用空格分割的 ARG 引數後跟一個換列。\n" +" 在標準輸出上,顯示用空格分割的 ARG 參數後跟一個換列。\n" " \n" " 選項:\n" " -n\t不要追加換列\n" @@ -3054,10 +2974,12 @@ msgstr "" " \\t\t橫向製表符\n" " \\v\t縱向製表符\n" " \\\\\t反斜線\n" -" \\0nnn\t以 NNN (八進位)為 ASCII 碼的字元。 NNN 可以是 0 到 3 個八進位數" -"字\n" -" \\xHH\t以 HH (十六進位)為值的八進位字元。HH 可以是一個或兩個十六進位數" -"字\n" +" \\0nnn\t以 NNN (八進位)為 ASCII 碼的字元。 NNN 可以是 0 到 3 個八進位數字\n" +" \\xHH\t以 HH (十六進位)為值的八進位字元。HH 可以是一個或兩個十六進位數字\n" +" \\uHHHH\t以十六進位 HHHH 為值的 Unicode 字元。\n" +" \t\tHHHH 可為一個到四個十六進位數字。\n" +" \\UHHHHHHHH 以十六進位 HHHHHHHH 為值的 Unicode 字元。\n" +" \t\tHHHHHHHH 可為一個到八個十六進位數字。\n" " \n" " 退出狀態:\n" " 回傳成功除非有寫入錯誤發生。" @@ -3074,9 +2996,9 @@ msgid "" " Exit Status:\n" " Returns success unless a write error occurs." msgstr "" -"寫入引數至標準輸出裝置。\n" +"寫入參數至標準輸出裝置。\n" " \n" -" 在標準輸出裝置上顯示 ARGs 引數和一個換列。\n" +" 在標準輸出裝置上顯示 <參數> 和一個換列。\n" " \n" " 選項:\n" " -n\t不附加換列\n" @@ -3110,48 +3032,47 @@ msgid "" " Exit Status:\n" " Returns success unless NAME is not a shell builtin or an error occurs." msgstr "" -"啟用和停用 shell 內建。\n" +"啟用和停用 shell 內建物件。\n" " \n" -" 啟用和停用 shell 的內建命令。停用使您能夠執行一個和內建\n" -" 命令同名磁碟上的命令,而無須使用完整的路徑名。\n" +" 啟用和停用 shell 的內建指令。停用使您能夠執行一個和內建\n" +" 指令同名磁碟上的指令,而無須使用完整的路徑名。\n" " \n" " \n" " 選項:\n" " -a\t印出一個內建的列表,並顯示其中每一個是否啟用\n" -" -n\t停用每一個 NAME 內建或者顯示一個被停用的內建列表\n" +" -n\t停用每一個 <名稱> 內建或者顯示一個被停用的內建列表\n" " -p\t以可重用的格式印出一個內建的列表\n" " -s\t僅印出 Posix「special」 內建的名稱\n" " \n" " 控制動態載入的選項:\n" -" -f\t從共享物件 FILENAME 檔案中載入 NAME 內建\n" +" -f\t從共享物件 <檔名> 檔案中載入 <名稱> 內建\n" " -d\t刪除以 -f 選項載入的內建\n" " \n" -" 不帶選項時,每一個 NAME 內建都被啟用。\n" +" 不帶選項時,每一個 <名稱> 內建都被啟用。\n" " \n" -" 如果要使用 $PATH 中找到的「test」而不是 shell 內建的版本,\n" +" 如果要使用 $PATH 中找到的「test」而不是 shell 內建物件的版本,\n" " 輸入「enable -n test」。\n" " \n" " 退出狀態:\n" -" 回傳成功,除非 NAME 不是一個 shell 內建或者有錯誤發生。" +" 回傳成功,除非 <名稱> 不是一個 shell 內建物件或者有錯誤發生。" #: builtins.c:638 msgid "" "Execute arguments as a shell command.\n" " \n" -" Combine ARGs into a single string, use the result as input to the " -"shell,\n" +" Combine ARGs into a single string, use the result as input to the shell,\n" " and execute the resulting commands.\n" " \n" " Exit Status:\n" " Returns exit status of command or success if command is null." msgstr "" -"將引數做為 shell 命令執行。\n" +"將參數做為 shell 指令執行。\n" " \n" -" 將 ARGs 合成一個字串,用結果做為 shell 的輸入,\n" -" 並且執行得到的命令。\n" +" 將 <參數> 合成一個字串,用結果做為 shell 的輸入,\n" +" 並且執行得到的指令。\n" " \n" " 退出狀態:\n" -" 以命令的狀態退出,或者在命令為空的情況下回傳成功。" +" 以指令的狀態退出,或者在指令為空的情況下回傳成功。" #: builtins.c:650 msgid "" @@ -3193,39 +3114,39 @@ msgid "" " Returns success if an option is found; fails if the end of options is\n" " encountered or an error occurs." msgstr "" -"解析選項引數。\n" +"解析選項參數。\n" " \n" " Getopts 被 shell 過程用於解析可定位的參數做為選項。\n" " \n" " \n" -" OPTSTRING 字串包含待識別的選項字母;如果一個字母後面跟\n" -" 著分號,則該選項需要一個引數,而該引數應用空格與選項分開。\n" +" <選項字串> 字串包含待識別的選項字母;如果一個字母後面跟\n" +" 著分號,則該選項需要一個參數,而該參數應用空格與選項分開。\n" " \n" " \n" " 每次啟動時,getopts 會將下一個選項放到 shell 變數 $name\n" " 中,如果 name 變數不存在則先將其初始化,而下一個待處\n" -" 理的引數序號放入 shell 變數 OPTIND 中。OPTIND 變數在每\n" +" 理的參數序號放入 shell 變數 OPTIND 中。OPTIND 變數在每\n" " 次 shell 或者 shell 指令稿啟動時都被初始化為 1。當一個選項要\n" -" 求有一個引數時,getopts 將引數放入 shell 變數 OPTARG\n" +" 求有一個參數時,getopts 將參數放入 shell 變數 OPTARG\n" " 中。\n" " \n" -" getopts 有兩種通報錯誤的方法。如果 OPTSTRING 變數的第\n" +" getopts 有兩種通報錯誤的方法。如果 <選項字串> 變數的第\n" " 一個字元是冒號,getopts 使用沉默錯誤通報。在這種模式\n" -" 下,不會印出錯誤訊息。如果看到了一個無效的選項,\n" +" 下,不會印發生錯誤誤訊息。如果看到了一個無效的選項,\n" " getopts 將找到的選項字元放至 OPTARG 變數中。如果一個必\n" -" 須的選項沒有找到,getopts 放一個「:」到 NAME 變數中並且設\n" +" 須的選項沒有找到,getopts 放一個「:」到 <名稱> 變數中並且設\n" " ç½® OPTARG 變數為找到的選項字元。如果 getopts 不在沉默模\n" -" 式中,並且遇到了一個無效的選項,getopts 放置一個「?」到 NAME \n" +" 式中,並且遇到了一個無效的選項,getopts 放置一個「?」到 <名稱> \n" " 變數中並且取消設定 OPTARG 變數。如果必須的選項沒有找到,\n" -" 一個「?」會被放入 NAME 變數中,OPTARG 將被取消設定,並且會\n" +" 一個「?」會被放入 <名稱> 變數中,OPTARG 將被取消設定,並且會\n" " 印出一個診斷資訊。\n" " \n" " 如果 shell 變數 OPTERR 的值為 0,getopts 停用\n" -" 錯誤資訊的印出,即使 OPTSTRING 變數的第一個字元不是一\n" +" 錯誤資訊的印出,即使 <選項字串> 變數的第一個字元不是一\n" " 個冒號。OPTERR 的預設值為 1。\n" " \n" -" Getopts 通常解析可定位的引數($0 - $9),不過如果提供了\n" -" 更多的引數,它們反而會被解析。\n" +" Getopts 通常解析可定位的參數($0 - $9),不過如果提供了\n" +" 更多的參數,它們反而會被解析。\n" " \n" " 退出狀態:\n" " 如果一個選項被找到則回傳成功;如果遇到了選項的結尾或者\n" @@ -3236,8 +3157,7 @@ msgid "" "Replace the shell with the given command.\n" " \n" " Execute COMMAND, replacing this shell with the specified program.\n" -" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " -"specified,\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified,\n" " any redirections take effect in the current shell.\n" " \n" " Options:\n" @@ -3245,30 +3165,28 @@ msgid "" " -c\texecute COMMAND with an empty environment\n" " -l\tplace a dash in the zeroth argument to COMMAND\n" " \n" -" If the command cannot be executed, a non-interactive shell exits, " -"unless\n" +" If the command cannot be executed, a non-interactive shell exits, unless\n" " the shell option `execfail' is set.\n" " \n" " Exit Status:\n" -" Returns success unless COMMAND is not found or a redirection error " -"occurs." +" Returns success unless COMMAND is not found or a redirection error occurs." msgstr "" -"使用指定命令替換 shell。\n" +"使用指定指令取代 shell。\n" " \n" -" 執行 COMMAND 命令,以指定的程式替換這個 shell。\n" -" ARGUMENTS 引數成為 COMMAND 命令的引數。如果\n" -" 沒有指定 COMMAND 命令,則任何的重定向在當前 shell 中生效。\n" +" 執行 COMMAND 指令,以指定的程式取代這個 shell。\n" +" ARGUMENTS 參數成為 COMMAND 指令的參數。如果\n" +" 沒有指定 COMMAND 指令,則任何的重定向在目前 shell 中生效。\n" " \n" " 選項:\n" -" -a 名稱\t做為第 0 個引數傳遞給 COMMAND 命令\n" -" -c\t\t在空環境中執行 COMMAND 命令\n" -" -l\t\t在 COMMAND 命令的第 0 個引數中加一個短線\n" +" -a 名稱\t做為第 0 個參數傳遞給 COMMAND 指令\n" +" -c\t\t在空環境中執行 COMMAND 指令\n" +" -l\t\t在 COMMAND 指令的第 0 個參數中加一個短線\n" " \n" -" 如果命令不能被執行,則退出一個非互動式的 shell,除非\n" +" 如果指令不能被執行,則退出一個非互動式的 shell,除非\n" " shell 選項「execfail」已經設定。\n" " \n" " 退出狀態:\n" -" 回傳成功除非 COMMAND 命令沒有找到或者出現一個重定向錯誤。" +" 回傳成功除非 COMMAND 指令沒有找到或者出現一個重定向錯誤。" #: builtins.c:713 msgid "" @@ -3280,14 +3198,13 @@ msgstr "" "退出 shell。\n" " \n" " 以狀態 N 退出 shell。 如果 N 被省略,則退出狀態\n" -" 為最後一個執行命令的退出狀態。" +" 為最後一個執行指令的退出狀態。" #: builtins.c:722 msgid "" "Exit a login shell.\n" " \n" -" Exits a login shell with exit status N. Returns an error if not " -"executed\n" +" Exits a login shell with exit status N. Returns an error if not executed\n" " in a login shell." msgstr "" "退出一個登入 shell。\n" @@ -3299,15 +3216,13 @@ msgstr "" msgid "" "Display or execute commands from the history list.\n" " \n" -" fc is used to list or edit and re-execute commands from the history " -"list.\n" +" fc is used to list or edit and re-execute commands from the history list.\n" " FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" " string, which means the most recent command beginning with that\n" " string.\n" " \n" " Options:\n" -" -e ENAME\tselect which editor to use. Default is FCEDIT, then " -"EDITOR,\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then EDITOR,\n" " \t\tthen vi\n" " -l \tlist lines instead of editing\n" " -n\tomit line numbers when listing\n" @@ -3321,14 +3236,13 @@ msgid "" " the last command.\n" " \n" " Exit Status:\n" -" Returns success or status of executed command; non-zero if an error " -"occurs." +" Returns success or status of executed command; non-zero if an error occurs." msgstr "" -"從歷史記錄列表中顯示或者執行命令。\n" +"從歷史記錄列表中顯示或者執行指令。\n" " \n" -" fc 被用於從歷史記錄列表中列出或者重新編輯並執行命令。\n" +" fc 被用於從歷史記錄列表中列出或者重新編輯並執行指令。\n" " FIRST 和 LAST 變數可以是數字用於指定範圍,或者 FIRST 可以是\n" -" 字串,意味著以這個字串開頭的最近一個命令。\n" +" 字串,意味著以這個字串開頭的最近一個指令。\n" " \n" " \n" " 選項:\n" @@ -3338,15 +3252,15 @@ msgstr "" " -n\t列舉時省略列號\n" " -r\t反轉列的順序(最新列在前)\n" " \n" -" 用「fc -s [模式=替換 …] [命令]」的格式,COMMAND 命令會在 OLD=NEW\n" -" 替換之後被重新執行。\n" +" 用「fc -s [模式=取代 …] [指令]」的格式,COMMAND 指令會在 OLD=NEW\n" +" 取代之後被重新執行。\n" " \n" " r=「fc -s」是一個有用的別名,這樣的話輸入「r cc」會執行最後一個以「cc」\n" -" 開頭的命令,輸入「r」會重新執行最後一個命令。\n" +" 開頭的指令,輸入「r」會重新執行最後一個指令。\n" " \n" " \n" " 退出狀態:\n" -" 回傳成功,或者執行命令的狀態;如果錯誤發生則回傳非零。" +" 回傳成功,或者執行指令的狀態;如果錯誤發生則回傳非零。" #: builtins.c:762 msgid "" @@ -3361,21 +3275,19 @@ msgid "" msgstr "" "將工作移至前臺。\n" " \n" -" 將以 JOB_SPEC 標識的工作放至前臺,使其成為\n" -" 當前工作。如果 JOB_SPEC 不存在,shell 觀念中的當前工作 \n" +" 將以 JOB_SPEC 識別的工作放至前臺,使其成為\n" +" 目前工作。如果 JOB_SPEC 不存在,shell 觀念中的目前工作 \n" " 將被使用。\n" " \n" " 退出狀態:\n" -" 放至前臺的命令狀態,或者當錯誤發生時為失敗。" +" 放至前臺的指令狀態,或者當錯誤發生時為失敗。" #: builtins.c:777 msgid "" "Move jobs to the background.\n" " \n" -" Place the jobs identified by each JOB_SPEC in the background, as if " -"they\n" -" had been started with `&'. If JOB_SPEC is not present, the shell's " -"notion\n" +" Place the jobs identified by each JOB_SPEC in the background, as if they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's notion\n" " of the current job is used.\n" " \n" " Exit Status:\n" @@ -3383,9 +3295,9 @@ msgid "" msgstr "" "移動工作至後臺。\n" " \n" -" 將 JOB_SPEC 標識的工作放至後臺,就像它們\n" +" 將 JOB_SPEC 識別的工作放至後臺,就像它們\n" " 是帶「&」啟動的一樣。如果 JOB_SPEC 不存在,shell 觀念中的\n" -" 當前工作將會被使用。\n" +" 目前工作將會被使用。\n" " \n" " 退出狀態:\n" " 回傳成功除非工作管理沒有啟用或者錯誤發生。" @@ -3395,8 +3307,7 @@ msgid "" "Remember or display program locations.\n" " \n" " Determine and remember the full pathname of each command NAME. If\n" -" no arguments are given, information about remembered commands is " -"displayed.\n" +" no arguments are given, information about remembered commands is displayed.\n" " \n" " Options:\n" " -d\tforget the remembered location of each NAME\n" @@ -3415,24 +3326,23 @@ msgid "" msgstr "" "記住或顯示程式位置。\n" " \n" -" 確定並記住每一個給定 NAME 名稱命令的完整路徑。\n" -" 如果不提供引數,則顯示已經記住命令的資訊。\n" +" 確定並記住每一個指定 <名稱> 指令的完整路徑。\n" +" 如果不提供參數,則顯示已經記住指令的資訊。\n" " \n" " 選項:\n" -" -d\t\t忘記每一個已經記住的 NAME 的位置\n" +" -d\t\t忘記每一個已經記住的 <名稱> 的位置\n" " -l\t\t以可做為輸入重用的格式顯示\n" -" -p pathname\t使用 pathname 路徑做為 NAME 命令的全路徑\n" +" -p pathname\t使用 pathname 路徑做為 <名稱> 指令的全路徑\n" " -r\t\t忘記所有記住的位置\n" -" -t\t\t印出記住的每一個 NAME 名稱的位置,如果指定了多個\n" -" \t\tNAME 名稱,則每個位置前面會加上相應的 NAME 名稱\n" +" -t\t\t印出記住的每一個 <名稱> 的位置,如果指定了多個\n" +" \t\t<名稱>,則每個位置前面會加上相應的 <名稱> \n" " \t\t\n" -" 引數:\n" -" NAME\t\t每個 NAME 名稱會在 $PATH 路徑變數中被搜尋,並且新增到記住的命" -"令\n" +" 參數:\n" +" <名稱>\t\t每個 <名稱> 會在 $PATH 路徑變數中被搜尋,並且新增到記住的指令\n" " 列表中。\n" " \n" " 退出狀態:\n" -" 回傳成功,除非 NAME 命令沒有找到或者使用了無效的選項。" +" 回傳成功,除非 <名稱> 指令沒有找到或者使用了無效的選項。" #: builtins.c:816 msgid "" @@ -3452,22 +3362,21 @@ msgid "" " PATTERN\tPattern specifying a help topic\n" " \n" " Exit Status:\n" -" Returns success unless PATTERN is not found or an invalid option is " -"given." +" Returns success unless PATTERN is not found or an invalid option is given." msgstr "" -"顯示內建命令的相關資訊。\n" +"顯示內建指令的相關資訊。\n" " \n" -" 顯示內建命令的簡略資訊。如果指定了 PATTERN 模式,\n" -" 給出所有匹配 PATTERN 模式命令的詳細說明,否則印出\n" +" 顯示內建指令的簡略資訊。如果指定了 PATTERN 模式,\n" +" 給出所有符合 PATTERN 模式指令的詳細說明,否則印出\n" " 一個說明主題列表\n" " \n" " 選項:\n" " -d\t輸出每個主題的簡短描述\n" " -m\t以偽 man 手冊的格式顯示使用方法\n" -" -s\t為每一個匹配 PATTERN 模式的主題僅顯示一個用法\n" +" -s\t為每一個符合 PATTERN 模式的主題僅顯示一個用法\n" " \t簡介\n" " \n" -" 引數:\n" +" 參數:\n" " PATTERN\tPattern 模式指定一個說明主題\n" " \n" " 退出狀態:\n" @@ -3501,8 +3410,7 @@ msgid "" " \n" " If the HISTTIMEFORMAT variable is set and not null, its value is used\n" " as a format string for strftime(3) to print the time stamp associated\n" -" with each displayed history entry. No time stamps are printed " -"otherwise.\n" +" with each displayed history entry. No time stamps are printed otherwise.\n" " \n" " Exit Status:\n" " Returns success unless an invalid option is given or an error occurs." @@ -3510,23 +3418,22 @@ msgstr "" "顯示或操縱歷史記錄列表。\n" " \n" " 帶列號顯示歷史記錄列表,將每個被修改的條目加上字首「*」。\n" -" 引數 N 會僅列出最後的 N 個條目。\n" +" 參數 N 會僅列出最後的 N 個條目。\n" " \n" " 選項:\n" " -c\t刪除所有條目從而清空歷史記錄列表。\n" " -d 偏移量\t從指定位置刪除歷史記錄列表。負數偏移量會從歷史記錄列表\n" " \t\t的尾端數回來。\n" " \n" -" -a\t將當前會話的歷史記錄列追加到歷史記錄檔案中\n" +" -a\t將目前工作階段的歷史記錄列追加到歷史記錄檔案中\n" " -n\t從歷史記錄檔案中讀取所有未被讀取的列\n" -"\t\t並且將它們追加到歷史列表 -r\t讀取歷史記錄檔案並將內容追加到歷史記錄" -"列表中\n" -" -w\t將當前歷史記錄寫入到歷史記錄檔案中,並追加到歷史記錄列表中\n" +"\t\t並且將它們追加到歷史列表 -r\t讀取歷史記錄檔案並將內容追加到歷史記錄列表中\n" +" -w\t將目前歷史記錄寫入到歷史記錄檔案中,並追加到歷史記錄列表中\n" " \n" -" -p\t對每一個 ARG 引數展開歷史記錄並顯示結果,而不儲存到歷史記錄列表中\n" -" -s\t以單條記錄追加 ARG 到歷史記錄列表中\n" +" -p\t對每一個 <參數> 展開歷史記錄並顯示結果,而不儲存到歷史記錄列表中\n" +" -s\t以單條紀錄追加 <參數> 到歷史記錄列表中\n" " \n" -" 如果給定了 FILENAME 檔名,則它將被做為歷史記錄檔案。否則\n" +" 如果指定了 <檔名>,則它將被做為歷史記錄檔案。否則\n" " 如果 $HISTFILE 變數有值的話使用之,不然使用 ~/.bash_history 檔案。\n" " \n" " 如果 $HISTTIMEFORMAT 變數被設定並且不為空,它的值會被用於\n" @@ -3571,12 +3478,12 @@ msgstr "" " -r\t限制僅輸出執行中的工作\n" " -s\t限制僅輸出停止的工作\n" " \n" -" 如果使用了 -x 選項,ARG 引數中的所有工作規格會被替換為該工作\n" -" 的行程群組首領的行程識別號,然後執行 COMMAND 命令。\n" +" 如果使用了 -x 選項,<參數> 中的所有工作規格會被取代為該工作\n" +" 的行程群組首領的行程識別號,然後執行 COMMAND 指令。\n" " \n" " 退出狀態:\n" " 回傳成功,除非使用了無效的選項或者有錯誤發生。\n" -" 如果使用 -x 選項,則回傳 COMMAND 命令的退出狀態。" +" 如果使用 -x 選項,則回傳 COMMAND 指令的退出狀態。" #: builtins.c:904 msgid "" @@ -3594,14 +3501,14 @@ msgid "" " Exit Status:\n" " Returns success unless an invalid option or JOBSPEC is given." msgstr "" -"從當前 shell 中刪除工作。\n" +"從目前 shell 中刪除工作。\n" " \n" -" 從活動工作表中刪除每一個 JOBSPEC 引數。不帶任何\n" -" JOBSPEC 引數時,shell 使用觀念中的當前工作。\n" +" 從活動工作表中刪除每一個 JOBSPEC 參數。不帶任何\n" +" JOBSPEC 參數時,shell 使用觀念中的目前工作。\n" " \n" " 選項:\n" -" -a\t如果不提供 JOBSPEC 引數,則刪除所有工作\n" -" -h\t標識每個 JOBSPEC 工作,從而當 shell 接收到 SIGHUP\n" +" -a\t如果不提供 JOBSPEC 參數,則刪除所有工作\n" +" -h\t識別每個 JOBSPEC 工作,從而當 shell 接收到 SIGHUP\n" " \t訊號時不傳送 SIGHUP 給指定工作\n" " -r\t僅刪除執行中的工作\n" " \n" @@ -3639,10 +3546,10 @@ msgstr "" " 選項:\n" " -s sig\tSIG 是訊號名稱\n" " -n sig\tSIG 是訊號編號\n" -" -l\t列出訊號名稱;如果引數後跟「-l」則被假設為訊號編號,\n" +" -l\t列出訊號名稱;如果參數後跟「-l」則被假設為訊號編號,\n" " \t而相應的訊號名稱會被列出\n" " \n" -" Kill 成為 shell 內建有兩個理由:它允許使用工作編號而不是行程識別號,\n" +" Kill 成為 shell 內建物件有兩個理由:它允許使用工作編號而不是行程識別號,\n" " 並且在可以建立的行程數上限達到時允許行程被砍除。\n" " \n" " 退出狀態:\n" @@ -3655,8 +3562,7 @@ msgid "" " Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" " fixed-width integers with no check for overflow, though division by 0\n" " is trapped and flagged as an error. The following list of operators is\n" -" grouped into levels of equal-precedence operators. The levels are " -"listed\n" +" grouped into levels of equal-precedence operators. The levels are listed\n" " in order of decreasing precedence.\n" " \n" " \tid++, id--\tvariable post-increment, post-decrement\n" @@ -3694,7 +3600,7 @@ msgid "" msgstr "" "求值算術表示式。\n" " \n" -" 將每個 ARG 參賽做為算術表示式來求值。求值的計算以定寬的整\n" +" 將每個 <參數> 做為算術表示式來求值。求值的計算以定寬的整\n" " 數完成,不帶溢位檢測,不過除 0 是被置陷阱的並且會報一個錯\n" " 誤。下列運算子被按照相同的算術優先順序組合。列表的順序按照\n" " 優先順序從高至低。\n" @@ -3724,27 +3630,23 @@ msgstr "" " Shell 變數允許做為運算元。表示式中的變數名稱會以值取代\n" " (強制轉換為定寬的整數)。表示式中的變數不需要開啟整數屬性。\n" " \n" -" 運算子按照優先順序進行求值。括號中的子表示式將被先求值,並可取代上述表示" -"式規則。\n" +" 運算子按照優先順序進行求值。括號中的子表示式將被先求值,並可取代上述表示式規則。\n" " \n" " 退出狀態:\n" -" 如果最後一個 ARG 引數求值為 0,則 let 回傳 1; 否則 let 回傳 0。" +" 如果最後一個 <參數> 求值為 0,則 let 回傳 1;否則 let 回傳 0。" #: builtins.c:992 msgid "" "Read a line from the standard input and split it into fields.\n" " \n" " Reads a single line from the standard input, or from file descriptor FD\n" -" if the -u option is supplied. The line is split into fields as with " -"word\n" +" if the -u option is supplied. The line is split into fields as with word\n" " splitting, and the first word is assigned to the first NAME, the second\n" " word to the second NAME, and so on, with any leftover words assigned to\n" -" the last NAME. Only the characters found in $IFS are recognized as " -"word\n" +" the last NAME. Only the characters found in $IFS are recognized as word\n" " delimiters.\n" " \n" -" If no NAMEs are supplied, the line read is stored in the REPLY " -"variable.\n" +" If no NAMEs are supplied, the line read is stored in the REPLY variable.\n" " \n" " Options:\n" " -a array\tassign the words read to sequential indices of the array\n" @@ -3756,8 +3658,7 @@ msgid "" " -n nchars\treturn after reading NCHARS characters rather than waiting\n" " \t\tfor a newline, but honor a delimiter if fewer than\n" " \t\tNCHARS characters are read before the delimiter\n" -" -N nchars\treturn only after reading exactly NCHARS characters, " -"unless\n" +" -N nchars\treturn only after reading exactly NCHARS characters, unless\n" " \t\tEOF is encountered or read times out, ignoring any\n" " \t\tdelimiter\n" " -p prompt\toutput the string PROMPT without a trailing newline before\n" @@ -3775,40 +3676,33 @@ msgid "" " -u fd\tread from file descriptor FD instead of the standard input\n" " \n" " Exit Status:\n" -" The return code is zero, unless end-of-file is encountered, read times " -"out\n" -" (in which case it's greater than 128), a variable assignment error " -"occurs,\n" +" The return code is zero, unless end-of-file is encountered, read times out\n" +" (in which case it's greater than 128), a variable assignment error occurs,\n" " or an invalid file descriptor is supplied as the argument to -u." msgstr "" "從標準輸入讀取一列並將其分為不同的區域。\n" " \n" -" 從標準輸入讀取單獨的一列,或者如果使用了 -u 選項,從檔案描述符 FD 中讀" -"取。\n" -" 該列被分割成區域,如同字詞分割一樣,並且第一個字詞被指派給第一個 NAME 變" -"數,第二\n" -" 個字詞被指派給第二個 NAME 變數,如此繼續,直到剩下所有的字詞被指派給最後" -"一個 NAME\n" +" 從標準輸入讀取單獨的一列,或者如果使用了 -u 選項,從檔案描述符 FD 中讀取。\n" +" 該列被分割成區域,如同字詞分割一樣,並且第一個字詞被指派給第一個 <名稱> 變數,第二\n" +" 個字詞被指派給第二個 <名稱> 變數,如此繼續,直到剩下所有的字詞被指派給最後一個 <名稱>\n" " 變數。只有 $IFS 變數中的字元被認做是字詞分隔符。\n" " \n" -" 如果沒有提供 NAME 變數,則讀取的列被存放在 REPLY 變數中。\n" +" 如果沒有提供 <名稱> 變數,則讀取的列被存放在 REPLY 變數中。\n" " \n" " 選項:\n" " -a array\t將字詞指派給 ARRAY 陣列變數的序列索引成員,從零開始。\n" " -d delim\t持續讀取直到讀入 DELIM 變數中的第一個字元,而不是換列符\n" -" -e\t使用 Readline 獲取列\n" +" -e\t使用 Readline 取得列\n" " -i text\t使用 TEXT 文字做為 Readline 的初始文字\n" " -n nchars\t讀取 nchars 個字元之後回傳,而不是等到讀取換列符。\n" " \t\t但是分隔符仍然有效,如果遇到分隔符之前讀取了不足 nchars 個字元。\n" -" -N nchars\t在準確讀取了 nchars 個字元之後回傳,除非遇到檔案結束符或者讀" -"取逾時,\n" +" -N nchars\t在準確讀取了 nchars 個字元之後回傳,除非遇到檔案結束符或者讀取逾時,\n" " \t\t任何的分隔符都被忽略\n" " -p prompt\t在嘗試讀取之前輸出 PROMPT 提示符並且不帶\n" " \t\t換列符\n" " -r\t不允許反斜線逸出任何字元\n" " -s\t不顯示終端的任何輸入\n" -" -t timeout\t如果在 TIMEOUT 秒內沒有讀取一個完整的列則逾時並且回傳失" -"敗。\n" +" -t timeout\t如果在 TIMEOUT 秒內沒有讀取一個完整的列則逾時並且回傳失敗。\n" " \t\tTMOUT 變數的值是預設逾時時間。\n" " \t\tTIMEOUT 可以是小數。如果 TIMEOUT 是 0,那麼僅當在指定的檔案描述符上\n" " \t\t輸入有效的時候,read 才回傳成功。\n" @@ -3817,7 +3711,7 @@ msgstr "" " \n" " 退出狀態:\n" " 回傳碼為零,除非遇到了檔案結束符,讀取逾時,或者無效的文\n" -" 件描述符做為引數傳遞給了 -u 選項。" +" 件描述符做為參數傳遞給了 -u 選項。" #: builtins.c:1039 msgid "" @@ -3834,7 +3728,7 @@ msgstr "" " \n" " 使一個函數或者被引用的指令稿以指定的回傳值 N 退出。\n" " 如果 N 被省略,則回傳狀態就是\n" -" 函數或指令稿中的最後一個執行命令的狀態。\n" +" 函數或指令稿中的最後一個執行指令的狀態。\n" " \n" " 退出狀態:\n" " 回傳 N,或者如果 shell 不在執行一個函數或引用指令稿時,失敗。" @@ -3882,8 +3776,7 @@ msgid "" " physical same as -P\n" " pipefail the return value of a pipeline is the status of\n" " the last command to exit with a non-zero status,\n" -" or zero if no command exited with a non-zero " -"status\n" +" or zero if no command exited with a non-zero status\n" " posix change the behavior of bash where the default\n" " operation differs from the Posix standard to\n" " match the standard\n" @@ -3907,8 +3800,7 @@ msgid "" " by default when the shell is interactive.\n" " -P If set, do not resolve symbolic links when executing commands\n" " such as cd which change the current directory.\n" -" -T If set, the DEBUG and RETURN traps are inherited by shell " -"functions.\n" +" -T If set, the DEBUG and RETURN traps are inherited by shell functions.\n" " -- Assign any remaining arguments to the positional parameters.\n" " If there are no remaining arguments, the positional parameters\n" " are unset.\n" @@ -3926,19 +3818,19 @@ msgid "" msgstr "" "設定或取消設定 shell 選項和位置參數的值。\n" " \n" -" 變更 shell 選項和位置引數的值,或者顯示 shell 變數的\n" +" 變更 shell 選項和位置參數的值,或者顯示 shell 變數的\n" " 名稱和值。\n" " \n" " 選項:\n" " -a 標記修改或者建立的變數為匯出。\n" -" -b 立即通告工作終結。\n" -" -e 如果一個命令以非零狀態退出,則立即退出。\n" -" -f 停用檔名生成(模式匹配)。\n" -" -h 當查詢命令時記住它們的位置\n" -" -k 所有的指派引數被放在命令的環境中,而不僅僅是\n" -" 命令名稱之前的引數。\n" +" -b 立即通告工作終止。\n" +" -e 如果一個指令以非零狀態退出,則立即退出。\n" +" -f 停用檔名產生(模式符合)。\n" +" -h 當查詢指令時記住它們的位置\n" +" -k 所有的指派參數被放在指令的環境中,而不僅僅是\n" +" 指令名稱之前的參數。\n" " -m 啟用工作控制。\n" -" -n 讀取命令但不執行\n" +" -n 讀取指令但不執行\n" " -o 選項名\n" " 設定與選項名對應的變數:\n" " allexport 與 -a 相同\n" @@ -3949,10 +3841,10 @@ msgstr "" " functrace 與 -T 相同\n" " hashall 與 -h 相同\n" " histexpand 與 -H 相同\n" -" history 啟用命令歷史記錄\n" +" history 啟用指令歷史記錄\n" " ignoreeof shell 讀取檔案結束符時不會退出\n" " interactive-comments\n" -" 允許在互動式命令中顯示註釋\n" +" 允許在互動式指令中顯示註釋\n" " keyword 與 -k 相同\n" " monitor 與 -m 相同\n" " noclobber 與 -C 相同\n" @@ -3963,42 +3855,42 @@ msgstr "" " nounset 與 -u 相同\n" " onecmd 與 -t 相同\n" " physical 與 -P 相同\n" -" pipefail 管道的回傳值是最後一個非零回傳值命令的回傳結果,\n" -" 或者當所有命令都回傳零時也為零。\n" +" pipefail 管道的回傳值是最後一個非零回傳值指令的回傳結果,\n" +" 或者當所有指令都回傳零時也為零。\n" " posix 變更預設時和 Posix 標準不同的 bash 行為\n" -" 以匹配標準\n" +" 以符合標準\n" " privileged 與 -p 相同\n" " verbose 與 -v 相同\n" " vi 使用 vi 風格的列編輯介面\n" " xtrace 與 -x 相同\n" -" -p 無論何時當真實的有效使用者身分不匹配時開啟。\n" +" -p 無論何時當真實的有效使用者身分不符合時開啟。\n" " 停用對 $ENV 檔案的處理以及匯入 shell 函數。\n" " 關閉此選項會導致有效的使用者編號和群組編號設定\n" " 為真實的使用者編號和群組編號\n" -" -t 讀取並執行一個命令之後退出。\n" -" -u 替換時將為設定的變數當做錯誤對待。\n" +" -t 讀取並執行一個指令之後退出。\n" +" -u 取代時將為設定的變數當做錯誤對待。\n" " -v 讀取 shell 輸入列時將它們印出。\n" -" -x 執行命令時印出它們以及引數。\n" +" -x 執行指令時印出它們以及參數。\n" " -B shell 將執行大括號擴充套件。\n" " -C 設定之後禁止以重定向輸出的方式覆蓋常\n" " 規檔案。\n" " -E 設定之後 ERR 陷阱會被 shell 函數繼承。\n" -" -H 啟用 ! 風格的歷史記錄替換。當 shell 是互動式的\n" -" 時候這個標識位預設開啟。\n" -" -P 設定之後類似 cd 的會變更當前目錄的命令不\n" -" 追蹤符號鏈結。\n" +" -H 啟用 ! 風格的歷史記錄取代。當 shell 是互動式的\n" +" 時候這個識別位預設開啟。\n" +" -P 設定之後類似 cd 的會變更目前目錄的指令嗎\n" +" 追蹤符號連結。\n" " -T 設定之後 DEBUG 和 RETURN 陷阱會被 shell 函數繼承。\n" -" - 任何剩餘的引數會被指派給位置引數。\n" +" - 任何剩餘的參數會被指派給位置參數。\n" " -x 和 -v 選項已關閉。\n" " \n" " 使用 + 而不是 - 會使標誌位被關閉。標誌位也可以在\n" -" shell 被啟動時使用。當前的標誌位設定可以在 $- 變\n" -" 量中找到。剩餘的 ARG 引數是位置引數並且是按照\n" -" $1,$2,.。$n 的順序被指派的。如果沒有給定 ARG\n" -" 引數,則印出所有的 shell 變數。\n" +" shell 被啟動時使用。目前的標誌位設定可以在 $- 變\n" +" 量中找到。剩餘的 <參數> 是位置參數並且是按照\n" +" $1,$2,.。$n 的順序被指派的。如果沒有指定 <參數>\n" +" 參數,則印出所有的 shell 變數。\n" " \n" " 退出狀態:\n" -" 回傳成功除非使用了無效的引數。" +" 回傳成功除非使用了無效的參數。" #: builtins.c:1137 msgid "" @@ -4012,8 +3904,7 @@ msgid "" " -n\ttreat each NAME as a name reference and unset the variable itself\n" " \t\trather than the variable it references\n" " \n" -" Without options, unset first tries to unset a variable, and if that " -"fails,\n" +" Without options, unset first tries to unset a variable, and if that fails,\n" " tries to unset a function.\n" " \n" " Some variables cannot be unset; also see `readonly'.\n" @@ -4023,15 +3914,14 @@ msgid "" msgstr "" "取消設定 shell 變數和函數的值和屬性。\n" " \n" -" 對每一個 NAME 名稱,刪除對應的變數或函數。\n" +" 對每一個 <名稱>,刪除對應的變數或函數。\n" " \n" " 選項:\n" -" -f\t將每個 NAME 視為函數\n" -" -v\t將每個 NAME 視為變數\n" -" -n\t將每個 NAME 視為名稱引用,只取消其本身而非其指向的變數\n" +" -f\t將每個 <名稱> 視為函數\n" +" -v\t將每個 <名稱> 視為變數\n" +" -n\t將每個 <名稱> 視為名稱引用,只取消其本身而非其指向的變數\n" " \n" -" 不帶選項時,unset 首先嘗試取消設定一個變數,如果失敗,再嘗試取消設定一個" -"函數。\n" +" 不帶選項時,unset 首先嘗試取消設定一個變數,如果失敗,再嘗試取消設定一個函數。\n" " \n" " 某些變數不可以被取消設定;參見「readonly」。\n" " \n" @@ -4043,8 +3933,7 @@ msgid "" "Set export attribute for shell variables.\n" " \n" " Marks each NAME for automatic export to the environment of subsequently\n" -" executed commands. If VALUE is supplied, assign VALUE before " -"exporting.\n" +" executed commands. If VALUE is supplied, assign VALUE before exporting.\n" " \n" " Options:\n" " -f\trefer to shell functions\n" @@ -4058,18 +3947,18 @@ msgid "" msgstr "" "為 shell 變數設定匯出屬性。\n" " \n" -" 標記每個 NAME 名稱為自動匯出到後續命令執行的環境。如果提供了 VALUE\n" +" 標記每個 <名稱> 為自動匯出到後續指令執行的環境。如果提供了 VALUE\n" " 則匯出前將 VALUE 做為指派。\n" " \n" " 選項:\n" " -f\t指 shell 函數\n" -" -n\t刪除每個 NAME 名稱的匯出屬性\n" +" -n\t刪除每個 <名稱> 的匯出屬性\n" " -p\t顯示所有匯出的變數和函數的列表\n" " \n" -" 「--」的引數停用進一步的選項處理。\n" +" 「--」的參數停用進一步的選項處理。\n" " \n" " 退出狀態:\n" -" 回傳成功,除非使用了無效的選項或者 NAME 名稱。" +" 回傳成功,除非使用了無效的選項或者 <名稱>。" #: builtins.c:1178 msgid "" @@ -4093,7 +3982,7 @@ msgid "" msgstr "" "標記 shell 變數為不可變更。\n" " \n" -" 標記每一個 NAME 名稱為唯讀;這些 NAME 變數的值將不可以被後續的指派\n" +" 標記每一個 <名稱> 為唯讀;這些 <名稱> 變數的值將不可以被後續的指派\n" " 操作所變更。如果提供了 VALUE,則在標記為唯讀之前將 VALUE 值指派給變數。\n" " \n" " 選項:\n" @@ -4102,10 +3991,10 @@ msgstr "" " -f\t指 shell 函數\n" " -p\t顯示唯讀變數或函數列表,取決於是否提供了 -f 選項\n" " \n" -" 「--」的引數停用進一步的選項處理。\n" +" 「--」的參數停用進一步的選項處理。\n" " \n" " 退出狀態:\n" -" 回傳成功,除非使用了無效的選項或者 NAME 名稱。" +" 回傳成功,除非使用了無效的選項或者 <名稱>。" #: builtins.c:1200 msgid "" @@ -4119,7 +4008,7 @@ msgid "" msgstr "" "移位位置參數。\n" " \n" -" 重新命名位置引數 $N+1、$N+2 … 到 $1、$2 … 如果沒有給定 N,\n" +" 重新命名位置參數 $N+1、$N+2 … 到 $1、$2 … 如果沒有指定 N,\n" " 則假設為 1。\n" " \n" " 退出狀態:\n" @@ -4138,14 +4027,14 @@ msgid "" " Returns the status of the last command executed in FILENAME; fails if\n" " FILENAME cannot be read." msgstr "" -"在當前 shell 中執行一個檔案中的命令。\n" +"在目前 shell 中執行一個檔案中的指令。\n" " \n" -" 在當前 shell 中讀取並執行 FILENAME 檔案中的命令。$PATH 變數中的\n" -" 條目被用於尋找包含 FILENAME 檔案的目錄。如果提供了任何的 ARGUMENTS\n" -" 引數,則它們將成為 FILENAME 檔案執行時的位置參數。\n" +" 在目前 shell 中讀取並執行 <檔名> 檔案中的指令。$PATH 變數中的\n" +" 條目被用於尋找包含 <檔名> 檔案的目錄。如果提供了任何的 <參數>\n" +" 參數,則它們將成為 <檔名> 檔案執行時的位置參數。\n" " \n" " 退出狀態:\n" -" 回傳 FILENAME 檔案中最後一個命令的狀態;如果 FILENAME 檔案不可讀則失敗。" +" 回傳 <檔名> 檔案中最後一個指令的狀態;如果 <檔名> 檔案不可讀則失敗。" #: builtins.c:1243 msgid "" @@ -4160,13 +4049,13 @@ msgid "" " Exit Status:\n" " Returns success unless job control is not enabled or an error occurs." msgstr "" -"懸置 shell 執行。\n" +"暫停 shell 執行。\n" " \n" -" 懸置 shell 的執行直到收到 SIGCONT 訊號。\n" -" 登入 shell 不可以被懸置,除非強制執行。\n" +" 暫停 shell 的執行直到收到 SIGCONT 訊號。\n" +" 登入 shell 不可以被暫停,除非強制執行。\n" " \n" " 選項:\n" -" -f\t強制懸置,即使是登入 shell。\n" +" -f\t強制暫停,即使是登入 shell。\n" " \n" " 退出狀態:\n" " 回傳成功,除非沒有啟用工作控制或者有錯誤發生。" @@ -4205,8 +4094,7 @@ msgid "" " -x FILE True if the file is executable by you.\n" " -O FILE True if the file is effectively owned by you.\n" " -G FILE True if the file is effectively owned by your group.\n" -" -N FILE True if the file has been modified since it was last " -"read.\n" +" -N FILE True if the file has been modified since it was last read.\n" " \n" " FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" " modification date).\n" @@ -4227,8 +4115,7 @@ msgid "" " STRING1 != STRING2\n" " True if the strings are not equal.\n" " STRING1 < STRING2\n" -" True if STRING1 sorts before STRING2 " -"lexicographically.\n" +" True if STRING1 sorts before STRING2 lexicographically.\n" " STRING1 > STRING2\n" " True if STRING1 sorts after STRING2 lexicographically.\n" " \n" @@ -4266,15 +4153,15 @@ msgstr "" " -c 檔案 如果檔案為字元特殊檔案則為真。\n" " -d 檔案 如果檔案為目錄則為真。\n" " -e 檔案 如果檔案存在則為真。\n" -" -f 檔案 如果檔案存在且為常規檔案則為真。\n" +" -f 檔案 如果檔案存在且為一般檔案則為真。\n" " -g 檔案 如果檔案的群組屬性設定開啟則為真。\n" -" -h 檔案 如果檔案為符號鏈結則為真。\n" -" -L 檔案 如果檔案為符號鏈結則為真。\n" -" -k 檔案 如果檔案的粘著位元已設定則為真。\n" +" -h 檔案 如果檔案為符號連結則為真。\n" +" -L 檔案 如果檔案為符號連結則為真。\n" +" -k 檔案 如果檔案的黏著位元已設定則為真。\n" " -p 檔案 如果檔案為命名管道則為真。\n" " -r 檔案 如果檔案對於您是可讀的則為真。\n" " -s 檔案 如果檔案存在且不為空則為真。\n" -" -S 檔案 如果檔案是套接字則為真。\n" +" -S 檔案 如果檔案是通訊端則為真。\n" " -t 檔案描述符 如果檔案描述符在終端上開啟則為真。\n" " -u 檔案 如果檔案的使用者數列設定開啟則為真。\n" " -w 檔案 如果檔案對您是可寫的則為真\n" @@ -4288,7 +4175,7 @@ msgstr "" " \n" " FILE1 -ot FILE2 如果 file1 檔案舊於 file2 檔案則為真。\n" " \n" -" FILE1 -ef FILE2 如果 file1 檔案是 file2 檔案的硬式鏈結則為真。\n" +" FILE1 -ef FILE2 如果 file1 檔案是 file2 檔案的硬式連結則為真。\n" " \n" " 字串運算子\n" " \n" @@ -4318,12 +4205,12 @@ msgstr "" " arg1 OP arg2 算術測試。OP 運算子可以是 -eq、-ne、\n" " -lt、-le、-gt、或 -ge 之一。\n" " \n" -" 二元算術運算回傳真,如果 ARG1 引數等於、不等於、\n" -" 小於、小於等於、大於、或者大於等於 ARG2 引數。\n" +" 二元算術運算回傳真,如果 ARG1 參數等於、不等於、\n" +" 小於、小於等於、大於、或者大於等於 ARG2 參數。\n" " \n" " 退出狀態:\n" " 如果 EXPR 表示式求值為真則回傳成功;如果 EXPR 表示式求值\n" -" 為假或者使用了無效的引數則回傳失敗。" +" 為假或者使用了無效的參數則回傳失敗。" #: builtins.c:1341 msgid "" @@ -4334,15 +4221,14 @@ msgid "" msgstr "" "求值條件表示式。\n" " \n" -" 是內建命令「test」的同義詞,但是最後一個引數必須是\n" -" 字元「]」,以匹配起始的「[」。" +" 是內建指令「test」的同義詞,但是最後一個參數必須是\n" +" 字元「]」,以符合起始的「[」。" #: builtins.c:1350 msgid "" "Display process times.\n" " \n" -" Prints the accumulated user and system times for the shell and all of " -"its\n" +" Prints the accumulated user and system times for the shell and all of its\n" " child processes.\n" " \n" " Exit Status:\n" @@ -4360,8 +4246,7 @@ msgstr "" msgid "" "Trap signals and other events.\n" " \n" -" Defines and activates handlers to be run when the shell receives " -"signals\n" +" Defines and activates handlers to be run when the shell receives signals\n" " or other conditions.\n" " \n" " ARG is a command to be read and executed when the shell receives the\n" @@ -4370,55 +4255,46 @@ msgid "" " value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" " shell and by the commands it invokes.\n" " \n" -" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " -"If\n" -" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " -"If\n" -" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " -"a\n" -" script run by the . or source builtins finishes executing. A " -"SIGNAL_SPEC\n" -" of ERR means to execute ARG each time a command's failure would cause " -"the\n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or a\n" +" script run by the . or source builtins finishes executing. A SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause the\n" " shell to exit when the -e option is enabled.\n" " \n" -" If no arguments are supplied, trap prints the list of commands " -"associated\n" +" If no arguments are supplied, trap prints the list of commands associated\n" " with each signal.\n" " \n" " Options:\n" " -l\tprint a list of signal names and their corresponding numbers\n" " -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" " \n" -" Each SIGNAL_SPEC is either a signal name in or a signal " -"number.\n" +" Each SIGNAL_SPEC is either a signal name in or a signal number.\n" " Signal names are case insensitive and the SIG prefix is optional. A\n" " signal may be sent to the shell with \"kill -signal $$\".\n" " \n" " Exit Status:\n" -" Returns success unless a SIGSPEC is invalid or an invalid option is " -"given." +" Returns success unless a SIGSPEC is invalid or an invalid option is given." msgstr "" "對訊號和其他事件設陷阱。\n" " \n" " 定義一個處理器,在 shell 接收到訊號和其他條件下執行。\n" " \n" -" ARG 引數是當 shell 接收到 SIGNAL_SPEC 訊號時讀取和執行的命令。\n" -" 如果沒有指定 ARG 引數 (並且只給出一個 SIGNAL_SPEC 訊號) 或者\n" -" ARG 引數為\n" -" 「-」,每一個指定的引數會被重置為原始值。如果 ARG 引數是一個空串,則每一" -"個\n" -" SIGNAL_SPEC 訊號會被 shell 和它啟動的命令忽略。\n" +" <參數> 是當 shell 接收到 SIGNAL_SPEC 訊號時讀取和執行的指令。\n" +" 如果沒有指定 <參數> (並且只給出一個 SIGNAL_SPEC 訊號) 或者\n" +" <參數> 為\n" +" 「-」,每一個指定的參數會被重設為原始值。如果 <參數> 是一個空串,則每一個\n" +" SIGNAL_SPEC 訊號會被 shell 和它啟動的指令忽略。\n" " \n" -" 如果一個 SIGNAL_SPEC 訊號是 EXIT (0) ,則 ARG 命令會在 shell 退出時被\n" -" 執行。如果一個 SIGNAL_SPEC 訊號是 DEBUG,則 ARG 命令會在每一個簡單命\n" +" 如果一個 SIGNAL_SPEC 訊號是 EXIT (0),則 <參數> 指令會在 shell 退出時被\n" +" 執行。如果一個 SIGNAL_SPEC 訊號是 DEBUG,則 <參數> 指令會在每一個簡單命\n" " 令之前執行。\n" " \n" -" 如果不提供引數,trap 印出列表顯示每一個與每一個訊號相關聯的命令。\n" +" 如果不提供參數,trap 印出列表顯示每一個與每一個訊號相關聯的指令。\n" " \n" " 選項:\n" " -l\t印出一個訊號名稱和它們對應的編號列表\n" -" -p\t印出與每個 SIGNAL_SPEC 訊號相關聯的陷阱命令\n" +" -p\t印出與每個 SIGNAL_SPEC 訊號相關聯的陷阱指令\n" " \n" " 每一個 SIGNAL_SPEC 訊號可以是 中的訊號名稱或者訊號編號。\n" " 訊號名稱大小寫相符且可以使用 SIG 字首。訊號可用「kill - 訊號 $$」\n" @@ -4453,38 +4329,36 @@ msgid "" " NAME\tCommand name to be interpreted.\n" " \n" " Exit Status:\n" -" Returns success if all of the NAMEs are found; fails if any are not " -"found." +" Returns success if all of the NAMEs are found; fails if any are not found." msgstr "" -"顯示命令類型的資訊。\n" +"顯示指令類型的資訊。\n" " \n" -" 對於每一個 NAME 名稱,指示如果做為命令它將如何被解釋。\n" +" 對於每一個 <名稱>,指示如果做為指令它將如何被解釋。\n" " \n" " 選項:\n" -" -a\t顯示所有包含名稱為 NAME 的可執行檔案的位置;\n" +" -a\t顯示所有包含名稱為 <名稱> 的可執行檔案的位置;\n" " \t包括別名、內建和函數。僅當「-p」選項沒有使用時\n" " -f\t抑制 shell 函數查詢\n" -" -P\t為每個 NAME 名稱驚醒 PATH 路徑搜尋,即使它是別名、\n" +" -P\t為每個 <名稱> 驚醒 PATH 路徑搜尋,即使它是別名、\n" " \t內建或函數,並且回傳將被執行的磁碟上檔案的名稱。\n" -" -p\t回傳將被執行的磁碟上檔案的名稱,或者當「type -t NAME」\n" +" -p\t回傳將被執行的磁碟上檔案的名稱,或者當「type -t <名稱>」\n" " \t不回傳「file」時,不回傳任何值。\n" " -t\t回傳下列詞中的任何一個「alias」、「keyword」、\n" -" \t「function」、「builtin」、「file」或者「」,如果 NAME 是相應的\n" -" \t一個別名、shell 保留字、shell 函數、shell 內建、\n" +" \t「function」、「builtin」、「file」或者「」,如果 <名稱> 是相應的\n" +" \t一個別名、shell 保留字、shell 函數、shell 內建物件、\n" " \t磁碟檔案或沒有找到。\n" " \n" -" 引數:\n" -" NAME\t將要解析的命令。\n" +" 參數:\n" +" <名稱>\t將要解析的指令。\n" " \n" " 退出狀態:\n" -" 如果所有的 NAME 命令都找到則回傳成功;任何找不到則失敗。" +" 如果所有的 <名稱> 指令都找到則回傳成功;任何找不到則失敗。" #: builtins.c:1429 msgid "" "Modify shell resource limits.\n" " \n" -" Provides control over the resources available to the shell and " -"processes\n" +" Provides control over the resources available to the shell and processes\n" " it creates, on systems that allow such control.\n" " \n" " Options:\n" @@ -4535,20 +4409,20 @@ msgstr "" " 選項:\n" " -S\t使用軟 (「soft」) 資源限制\n" " -H\t使用硬 (「hard」) 資源限制\n" -" -a\t所有當前限制都被通報\n" -" -b\t套接字快取尺寸\n" +" -a\t所有目前限制都被通報\n" +" -b\t通訊端快取尺寸\n" " -c\t建立核心檔案的最大尺寸\n" " -d\t一個行程的資料區最大尺寸\n" " -e\t最高的排程優先順序 (「nice」)\n" " -f\t有 shell 及其子行程可以寫入的最大檔案尺寸\n" -" -i\t最多可以懸置的訊號數\n" +" -i\t最多可以暫停的訊號數\n" " -k\t為這個進程所分配的最大 kqueues 數量\n" " -l\t一個行程可以鎖定的最大記憶體尺寸\n" " -m\t最大的記憶體進駐尺寸\n" " -n\t最多開啟的檔案描述符個數\n" " -p\t管道緩衝區尺寸\n" " -q\tPOSIX 資訊佇列的最大位元組數\n" -" -r\t實時排程的最大優先順序\n" +" -r\t即時排程的最大優先順序\n" " -s\t最大堆疊尺寸\n" " -P\t偽終端的最大數量\n" " -t\t最大的 CPU 時間,以秒為單位\n" @@ -4560,9 +4434,8 @@ msgstr "" " 並非所有選項在所有系統上可用。\n" " \n" " 如果提供了 LIMIT 變數,則它為指定資源的新值;特別的 LIMIT 值為\n" -" 「soft」、「hard」和「unlimited」,分別表示當前的軟限制,硬限制和無限" -"制。\n" -" 否則印出指定資源的當前限制值,不帶選項則假定為 -f\n" +" 「soft」、「hard」和「unlimited」,分別表示目前的軟限制,硬限制和無限制。\n" +" 否則印出指定資源的目前限制值,不帶選項則假定為 -f\n" " \n" " 取值都是 1024 位元組為單位,除了 -t 以秒為單位,-p 以 512 位元組遞增,\n" " -u 為無尺度的行程數量。\n" @@ -4590,7 +4463,7 @@ msgstr "" "顯示或設定檔案模式遮罩。\n" " \n" " 設定使用者檔案建立遮罩為 MODE 模式。如果省略了 MODE,則\n" -" 印出當前遮罩的值。\n" +" 印出目前遮罩的值。\n" " \n" " 如果 MODE 模式以數字開頭,則被當做八進位數字解析;否則是一個\n" " chmod(1) 可接收的符號模式串。\n" @@ -4606,8 +4479,7 @@ msgstr "" msgid "" "Wait for job completion and return exit status.\n" " \n" -" Waits for each process identified by an ID, which may be a process ID or " -"a\n" +" Waits for each process identified by an ID, which may be a process ID or a\n" " job specification, and reports its termination status. If ID is not\n" " given, waits for all currently active child processes, and the return\n" " status is zero. If ID is a job specification, waits for all processes\n" @@ -4626,13 +4498,13 @@ msgstr "" "等待工作完成並回傳退出狀態。\n" " \n" " 等待以 ID 編號識別的行程,其中 ID 可以是行程編號或者工作規格,\n" -" 並通報它的終止狀態。如果 ID 沒有給出,則等待所有的當前活躍子\n" +" 並通報它的終止狀態。如果 ID 沒有給出,則等待所有的目前活躍子\n" " 行程,並且回傳狀態為零。如果 ID 是工作規格,等待工作管道中的\n" " 所有行程。\n" " \n" -" 若給定了 -n 選項,等待下一個工作完成並回傳其狀態。\n" +" 若指定了 -n 選項,等待下一個工作完成並回傳其狀態。\n" " \n" -" 如果給定了 -f 選項且啟用工作管理,則等待指定 ID 終止,而非\n" +" 如果指定了 -f 選項且啟用工作管理,則等待指定 ID 終止,而非\n" " 等到其變更狀態。\n" " \n" " 退出狀態:\n" @@ -4642,24 +4514,21 @@ msgstr "" msgid "" "Wait for process completion and return exit status.\n" " \n" -" Waits for each process specified by a PID and reports its termination " -"status.\n" +" Waits for each process specified by a PID and reports its termination status.\n" " If PID is not given, waits for all currently active child processes,\n" " and the return status is zero. PID must be a process ID.\n" " \n" " Exit Status:\n" -" Returns the status of the last PID; fails if PID is invalid or an " -"invalid\n" +" Returns the status of the last PID; fails if PID is invalid or an invalid\n" " option is given." msgstr "" "等待行程完成並且回傳退出狀態。\n" " \n" -" 等待指定行程並通報它的終止狀態。如果沒有提供 PID,則當前所有的活躍\n" +" 等待指定行程並通報它的終止狀態。如果沒有提供 PID,則目前所有的活躍\n" " 子行程都會被等待,並且回傳碼為零。PID 必須為行程識別號。\n" " \n" " 退出狀態:\n" -" 回傳行程 ID 的狀態;如果 PID 是無效的行程識別號或者指定了無效的選項則失" -"敗。" +" 回傳行程 ID 的狀態;如果 PID 是無效的行程識別號或者指定了無效的選項則失敗。" #: builtins.c:1538 msgid "" @@ -4673,14 +4542,14 @@ msgid "" " Exit Status:\n" " Returns the status of the last command executed." msgstr "" -"為列表中的每個成員執行命令。\n" +"為列表中的每個成員執行指令。\n" " \n" -" 「for」迴圈為列表中的每個成員執行一系列的命令。如果沒有\n" +" 「for」迴圈為列表中的每個成員執行一系列的指令。如果沒有\n" " 「in WORDS ...;」則假定使用「in \"$@\"」。對於 WORDS 中的每\n" -" 個元素,NAME 被設定為該元素,並且執行 COMMANDS 命令。\n" +" 個元素,<名稱> 被設定為該元素,並且執行 <指令>。\n" " \n" " 退出狀態:\n" -" 回傳最後執行命令的狀態。" +" 回傳最後執行指令的狀態。" #: builtins.c:1552 msgid "" @@ -4703,14 +4572,14 @@ msgstr "" " 等價於\n" " \t(( EXP1 ))\n" " \twhile (( EXP2 )); do\n" -" \t\tCOMMANDS\n" +" \t\t<指令>\n" " \t\t(( EXP3 ))\n" " \tdone\n" " EXP1、EXP2 和 EXP3 都是算術表示式。如果省略任何表示式,\n" " 則等同於使用了求值為 1 的表示式。\n" " \n" " 退出狀態:\n" -" 回傳最後執行命令的狀態。" +" 回傳最後執行指令的狀態。" #: builtins.c:1570 msgid "" @@ -4731,19 +4600,19 @@ msgid "" " Exit Status:\n" " Returns the status of the last command executed." msgstr "" -"從列表中選取詞並且執行命令。\n" +"從列表中選取詞並且執行指令。\n" " \n" -" WORDS 變數被展開,生成一個字詞的列表。展開的字詞集合被印出\n" +" WORDS 變數被展開,產生一個字詞的列表。展開的字詞集合被印出\n" " 在標準錯誤輸出裝置上,每個以一個數字做字首。如果沒有「in WORDS」\n" " 則假定使用「in \"$@\"」。PS3 提示符會被顯示並且從標準輸入讀入一列\n" -" 如果該列由被顯示字詞對應的數字組成,則 NAME 變數被設定為相應\n" +" 如果該列由被顯示字詞對應的數字組成,則 <名稱> 變數被設定為相應\n" " 的字詞。如果列為空,則 WORDS 變數和提示符被重新顯示。如果讀取了\n" -" 檔案結束符,則命令完成。讀入任何其他的值會導致 NAME 變數被設定\n" -" 為空。讀入的列被存放在變數 REPLY 中。COMMANDS 命令在每次選擇\n" -" 之後執行直到執行一個 break 命令。\n" +" 檔案結束符,則指令完成。讀入任何其他的值會導致 <名稱> 變數被設定\n" +" 為空。讀入的列被存放在變數 REPLY 中。<指令> 在每次選擇\n" +" 之後執行直到執行一個 break 指令。\n" " \n" " 退出狀態:\n" -" 回傳最後一個執行命令的狀態。" +" 回傳最後一個執行指令的狀態。" #: builtins.c:1591 msgid "" @@ -4762,7 +4631,7 @@ msgid "" msgstr "" "通報管道執行的消耗時間。\n" " \n" -" 執行 PIPELINE 並且印出 PIPELINE 終結時實際時間、使用者 CPU 時間和系統\n" +" 執行 PIPELINE 並且印出 PIPELINE 終止時實際時間、使用者 CPU 時間和系統\n" " CPU 時間的總結。\n" " \n" " 選項:\n" @@ -4783,44 +4652,39 @@ msgid "" " Exit Status:\n" " Returns the status of the last command executed." msgstr "" -"基於模式匹配來執行命令。\n" +"基於模式符合來執行指令。\n" " \n" -" 基於 PATTERN 模式匹配的字詞 WORD,有選擇的執行 COMMANDS 命令。\n" +" 基於 PATTERN 模式符合的字詞 WORD,有選擇的執行 <指令>。\n" " 「|」用於分隔多個模式。\n" " \n" " 退出狀態:\n" -" 回傳最後一個執行命令的狀態。" +" 回傳最後一個執行指令的狀態。" #: builtins.c:1620 msgid "" "Execute commands based on conditional.\n" " \n" -" The `if COMMANDS' list is executed. If its exit status is zero, then " -"the\n" -" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " -"is\n" +" The `if COMMANDS' list is executed. If its exit status is zero, then the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list is\n" " executed in turn, and if its exit status is zero, the corresponding\n" -" `then COMMANDS' list is executed and the if command completes. " -"Otherwise,\n" -" the `else COMMANDS' list is executed, if present. The exit status of " -"the\n" -" entire construct is the exit status of the last command executed, or " -"zero\n" +" `then COMMANDS' list is executed and the if command completes. Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of the\n" +" entire construct is the exit status of the last command executed, or zero\n" " if no condition tested true.\n" " \n" " Exit Status:\n" " Returns the status of the last command executed." msgstr "" -"根據條件執行命令。\n" +"根據條件執行指令。\n" " \n" -" 「if COMMANDS」列表被執行。如果退出狀態為零,則執行「then COMMANDS」\n" -" 列表。否則按順序執行每個「elif COMMANDS」列表,並且如果它的退出狀態為\n" -" 零,則執行對應的「then COMMANDS」列表並且 if 命令終止。否則如果存在的\n" -" 情況下,執行「else COMMANDS」列表。整個結構的退出狀態是最後一個執行\n" -" 命令的狀態,或者如果沒有條件測試為真的話,則為零。\n" +" 「if <指令>」列表被執行。如果退出狀態為零,則執行「then <指令>」\n" +" 列表。否則按順序執行每個「elif <指令>」列表,並且如果它的退出狀態為\n" +" 零,則執行對應的「then <指令>」列表並且 if 指令終止。否則如果存在的\n" +" 情況下,執行「else <指令>」列表。整個結構的退出狀態是最後一個執行\n" +" 指令的狀態,或者如果沒有條件測試為真的話,則為零。\n" " \n" " 退出狀態:\n" -" 回傳最後一個執行命令的狀態。" +" 回傳最後一個執行指令的狀態。" #: builtins.c:1637 msgid "" @@ -4832,13 +4696,13 @@ msgid "" " Exit Status:\n" " Returns the status of the last command executed." msgstr "" -"只要測試成功即執行命令。\n" +"只要測試成功即執行指令。\n" " \n" -" 只要在「while」COMMANDS 中的最終命令回傳結果為 0,則\n" -" 展開並執行 COMMANDS 命令。\n" +" 只要在「while」<指令> 中的最終指令回傳結果為 0,則\n" +" 展開並執行 <指令>。\n" " \n" " 退出狀態:\n" -" 回傳最後一個執行命令的狀態。" +" 回傳最後一個執行指令的狀態。" #: builtins.c:1649 msgid "" @@ -4850,13 +4714,13 @@ msgid "" " Exit Status:\n" " Returns the status of the last command executed." msgstr "" -"當測試不同過時執行命令。\n" +"當測試不同過時執行指令。\n" " \n" -" 「until」COMMANDS 命令的最終命令回傳狀態不為 0 時,\n" -" 展開並執行 COMMANDS 命令。\n" +" 「until」<指令> 的最終指令回傳狀態不為 0 時,\n" +" 展開並執行 <指令>。\n" " \n" " 退出狀態:\n" -" 回傳最後一個執行命令的狀態。" +" 回傳最後一個執行指令的狀態。" #: builtins.c:1661 msgid "" @@ -4870,12 +4734,12 @@ msgid "" " Exit Status:\n" " The coproc command returns an exit status of 0." msgstr "" -"建立一個以 NAME 為名的副行程。\n" +"建立一個以 <名稱> 為名的副行程。\n" " \n" -" 非同步執行 COMMANDS 命令,在執行 shell 中的陣列變數 NAME\n" -" 的 0 號和 1 號元素做為檔案描述符,以一個管道連接命令\n" -" 分別做為命令的標準輸出和輸入裝置。\n" -" 預設的 NAME 是「COPROC」。\n" +" 非同步執行 <指令>,在執行 shell 中的陣列變數 <名稱>\n" +" 的 0 號和 1 號元素做為檔案描述符,以一個管道連接指令\n" +" 分別做為指令的標準輸出和輸入裝置。\n" +" 預設的 <名稱> 是「COPROC」。\n" " \n" " 退出狀態:\n" " coprc 指令回傳離開代碼 0。" @@ -4885,8 +4749,7 @@ msgid "" "Define shell function.\n" " \n" " Create a shell function named NAME. When invoked as a simple command,\n" -" NAME runs COMMANDs in the calling shell's context. When NAME is " -"invoked,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is invoked,\n" " the arguments are passed to the function as $1...$n, and the function's\n" " name is in $FUNCNAME.\n" " \n" @@ -4895,13 +4758,13 @@ msgid "" msgstr "" "定義 shell 函數。\n" " \n" -" 建立一個以 NAME 為名的 shell 函數。當做為一個簡單的命令啟用時,\n" -" NAME 函數執行呼叫 shell 語境中的 COMMANDs 命令。當 NAME\n" -" 被啟用時,引數做為 $1…$n 被傳遞給函數,函數的名字儲存在變數\n" +" 建立一個以 <名稱> 為名的 shell 函數。當做為一個簡單的指令啟用時,\n" +" <名稱> 函數執行呼叫 shell 語境中的 COMMANDs 指令。當 <名稱>\n" +" 被啟用時,參數做為 $1…$n 被傳遞給函數,函數的名字儲存在變數\n" " $FUNCNAME 中。\n" " \n" " 退出狀態:\n" -" 回傳成功除非 NAME 為唯讀。" +" 回傳成功除非 <名稱> 為唯讀。" #: builtins.c:1689 msgid "" @@ -4913,13 +4776,13 @@ msgid "" " Exit Status:\n" " Returns the status of the last command executed." msgstr "" -"將命令組合為一個單元。\n" +"將指令組合為一個單元。\n" " \n" -" 執行群組中的命令集合。這是對整個命令集合\n" +" 執行群組中的指令集合。這是對整個指令集合\n" " 做重定向的方法之一。\n" " \n" " 退出狀態:\n" -" 回傳最後一個執行命令的狀態。" +" 回傳最後一個執行指令的狀態。" #: builtins.c:1701 msgid "" @@ -4936,10 +4799,10 @@ msgid "" msgstr "" "在前臺繼續工作\n" " \n" -" 對於 JOB_SPEC 引數來說和「fg」命令等同。繼續一個\n" +" 對於 JOB_SPEC 參數來說和「fg」指令等同。繼續一個\n" " 停止的或者後臺工作。JOB_SPEC 可以指定一個工作\n" " 名字或工作號。在 JOB_SPEC 後加上一個「&」將會把\n" -" 工作放至後臺,就像工作規格被做為「bg」命令的引數\n" +" 工作放至後臺,就像工作規格被做為「bg」指令的參數\n" " 執行一樣。\n" " \n" " 退出狀態:\n" @@ -4967,12 +4830,9 @@ msgstr "" msgid "" "Execute conditional command.\n" " \n" -" Returns a status of 0 or 1 depending on the evaluation of the " -"conditional\n" -" expression EXPRESSION. Expressions are composed of the same primaries " -"used\n" -" by the `test' builtin, and may be combined using the following " -"operators:\n" +" Returns a status of 0 or 1 depending on the evaluation of the conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries used\n" +" by the `test' builtin, and may be combined using the following operators:\n" " \n" " ( EXPRESSION )\tReturns the value of EXPRESSION\n" " ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" @@ -4990,7 +4850,7 @@ msgid "" " Exit Status:\n" " 0 or 1 depending on value of EXPRESSION." msgstr "" -"執行條件命令。\n" +"執行條件指令。\n" " \n" " 根據條件表示式 EXPRESSION 的求值回傳狀態 0 或 1。表示式按照\n" " 「test」內建的相同條件組成,或者可以有下列運算子連接而成:\n" @@ -4998,12 +4858,11 @@ msgstr "" " ( EXPRESSION )\t回傳 EXPRESSION 表示式的值\n" " ! EXPRESSION\t\t如果 EXPRESSION 表示式為假則為真,否則為假\n" " EXPR1 && EXPR2\t如果 EXPR1 和 EXPR2 表示式均為真則為真,否則為假\n" -" EXPR1 || EXPR2\t如果 EXPR1 和 EXPR2 表示式中有一個為真則為真,否則為" -"假\n" +" EXPR1 || EXPR2\t如果 EXPR1 和 EXPR2 表示式中有一個為真則為真,否則為假\n" " \n" " 當使用「==」和「!=」運算子時,運算子右邊的字串被用作模式並且執行一個\n" -" 匹配。當使用「=~」運算子時,運算子右邊的字串被當做正則表示式來進行\n" -" 匹配。\n" +" 符合。當使用「=~」運算子時,運算子右邊的字串被當做正規表示式來進行\n" +" 符合。\n" " \n" " 運算子 && 和 || 將不對 EXPR2 表示式進行求值,如果 EXPR1 表示式足夠確定\n" " 整個表示式的值。\n" @@ -5066,44 +4925,44 @@ msgid "" msgstr "" "常用 shell 變數名稱和使用。\n" " \n" -" BASH_VERSION\t當前 Bash 的版本資訊。\n" -" CDPATH\t用於「cd」命令引數搜尋分號分隔的目錄列表\n" -" GLOBIGNORE\t路徑擴充套件時忽略的檔名匹配模式列表,\n" +" BASH_VERSION\t目前 Bash 的版本資訊。\n" +" CDPATH\t用於「cd」指令參數搜尋分號分隔的目錄列表\n" +" GLOBIGNORE\t路徑擴充套件時忽略的檔名符合模式列表,\n" " \t\t以分號分隔。\n" -" HISTFILE\t您的命令歷史記錄存放的檔案名稱。\n" +" HISTFILE\t您的指令歷史記錄存放的檔案名稱。\n" " HISTFILESIZE\t歷史記錄檔案最多可以儲存的列數。\n" -" HISTSIZE\t一個執行的 shell 最多可以訪問的歷史記錄命令列數。\n" +" HISTSIZE\t一個執行的 shell 最多可以訪問的歷史記錄指令列數。\n" " HOME\t您登入目錄的完整路徑。\n" -" HOSTNAME\t當前主機的主機名。\n" -" HOSTTYPE\t當前版本的 BASH 在其之上執行的 CPU 類型。\n" +" HOSTNAME\t目前主機的主機名稱。\n" +" HOSTTYPE\t目前版本的 BASH 在其之上執行的 CPU 類型。\n" " IGNOREEOF\t控制 shell 收到檔案結束符做為單一輸入後的\n" " \t\t動作。如果設定這個變數,則它的值是 shell 退出之前在\n" " \t\t一個空列上可以連續看到的檔案結束符數量(預設為 10)。\n" " \t\t未設定時,檔案結束符標誌著輸入的結束。\n" -" MACHTYPE\t描述當前執行 Bash 的系統字串。\n" +" MACHTYPE\t描述目前執行 Bash 的系統字串。\n" " MAILCHECK\tBash 檢測新郵件的頻率,以秒為單位。\n" " MAILPATH\tBash 從中檢測新郵件的檔案列表,以分號分隔。\n" " OSTYPE\t執行 Bash 的 Unix 版本。\n" -" PATH\t當尋找命令時搜尋的目錄列表,以冒號分隔。\n" +" PATH\t當尋找指令時搜尋的目錄列表,以冒號分隔。\n" " PROMPT_COMMAND\t印出每一個主提示符之前執行的命\n" " \t\t令。\n" " PS1\t\t主提示符字串。\n" " PS2\t\t從提示符字串。\n" -" PWD\t\t當前目錄的完整路徑。\n" +" PWD\t\t目前目錄的完整路徑。\n" " SHELLOPTS\t已啟用的 shell 選項列表,以冒號分隔。\n" -" TERM\t當前終端類型的名稱。\n" +" TERM\t目前終端類型的名稱。\n" " TIMEFORMAT\t以關鍵則「time」顯示的時間統計資訊的輸出\n" " \t\t格式。\n" -" auto_resume\t非空時,一個單獨的命令詞會首先被在當前\n" -" \t\t停止的工作列表中搜索。如果找到則該工作被置於前臺。\n" -" \t\t如果值為「exact」則意味著命令詞必須精確匹配停止工作\n" -" \t\t列表中的命令。如果值為「substring」則意味著命令詞必\n" -" \t\t須匹配工作的一個子字串。任何其他的值意味著命令詞\n" +" auto_resume\t非空時,一個單獨的指令詞會首先被在目前\n" +" \t\t停止的工作列表中搜尋。如果找到則該工作被置於前臺。\n" +" \t\t如果值為「exact」則意味著指令詞必須精確符合停止工作\n" +" \t\t列表中的指令。如果值為「substring」則意味著指令詞必\n" +" \t\t須符合工作的一個子字串。任何其他的值意味著指令詞\n" " \t\t必須是停止工作的一個字首。\n" -" histchars\t控制歷史記錄展開和快速替換的字元。第一個字元是\n" -" \t\t歷史記錄替換字元,通常是「!」。第二個字元是快速替換字元,\n" +" histchars\t控制歷史記錄展開和快速取代的字元。第一個字元是\n" +" \t\t歷史記錄取代字元,通常是「!」。第二個字元是快速取代字元,\n" " \t\t通常是「^」。第三個是歷史記錄註釋字元,通常是「#」。\n" -" HISTIGNORE\t用於決定哪些命令被存入歷史記錄檔案的模式\n" +" HISTIGNORE\t用於決定哪些指令被存入歷史記錄檔案的模式\n" " \t\t列表,以冒號分隔。\n" #: builtins.c:1811 @@ -5138,14 +4997,14 @@ msgid "" msgstr "" "從堆疊中建立目錄。\n" " \n" -" 從目錄堆疊中建立條目。不帶引數時,建立堆疊頂端目錄,並變更至新的堆疊\n" +" 從目錄堆疊中建立條目。不帶參數時,建立堆疊頂端目錄,並變更至新的堆疊\n" " 頂端目錄。\n" " \n" " 選項:\n" " -n\t抑制從堆疊中刪除目錄時通常的目錄變換操作,從而僅對堆疊\n" " \t進行操作。\n" " \n" -" 引數:\n" +" 參數:\n" " +N\t刪除第 N 個目錄 (「dirs」顯示的目錄列表中左起,從零開始)。\n" " \t例如:「popd +0」刪除第一個目錄,「popd +1」刪除第二個。\n" " \n" @@ -5155,7 +5014,7 @@ msgstr "" " 「dirs」內建顯示目錄堆疊。\n" " \n" " 退出狀態:\n" -" 回傳成功,除非使用了無效的引數或者目錄變換失敗。" +" 回傳成功,除非使用了無效的參數或者目錄變換失敗。" #: builtins.c:1845 msgid "" @@ -5185,14 +5044,14 @@ msgid "" msgstr "" "從堆疊中刪除目錄。\n" " \n" -" 從目錄堆疊中刪除條目。不帶引數時,刪除堆疊頂端目錄,並變更至新的堆疊\n" +" 從目錄堆疊中刪除條目。不帶參數時,刪除堆疊頂端目錄,並變更至新的堆疊\n" " 頂端目錄。\n" " \n" " 選項:\n" " -n\t抑制從堆疊中刪除目錄時通常的目錄變換操作,從而僅對堆疊\n" " \t進行操作。\n" " \n" -" 引數:\n" +" 參數:\n" " +N\t刪除第 N 個目錄 (「dirs」顯示的目錄列表中左起,從零開始)。\n" " \t例如:「popd +0」刪除第一個目錄,「popd +1」刪除第二個。\n" " \n" @@ -5202,7 +5061,7 @@ msgstr "" " 「dirs」內建顯示目錄堆疊。\n" " \n" " 退出狀態:\n" -" 回傳成功,除非使用了無效的引數或者目錄變換失敗。" +" 回傳成功,除非使用了無效的參數或者目錄變換失敗。" #: builtins.c:1875 msgid "" @@ -5234,8 +5093,8 @@ msgid "" msgstr "" "顯示目錄堆疊。\n" " \n" -" 顯示當前記住的目錄列表。藉由「pushd」命令可以將目錄存入列表\n" -" 中;「popd」命令可用於遍歷彈出列表。\n" +" 顯示目前記住的目錄列表。藉由「pushd」指令可以將目錄存入列表\n" +" 中;「popd」指令可用於遍歷彈出列表。\n" " \n" " 選項:\n" " -c\t刪除所有元素以清空目錄堆疊\n" @@ -5243,7 +5102,7 @@ msgstr "" " -p\t每列一個條目印出目錄堆疊\n" " -v\t每列一個條目,以堆疊中位置為字首印出目錄堆疊\n" " \n" -" 引數:\n" +" 參數:\n" " +N\t顯示 dirs 不帶選項啟動時顯示的目錄列表左起中第\n" " \tN 個目錄,從零開始。\n" " \n" @@ -5274,20 +5133,20 @@ msgid "" msgstr "" "設定和取消設定 shell 選項。\n" " \n" -" 變更每個 shell <選項名稱> 的設定。不帶選項引數時,\n" +" 變更每個 shell <選項名稱> 的設定。不帶選項參數時,\n" " 顯示每個提供的 <選項名稱> 或所有 shell 選項 (如果沒有\n" " 傳入任何 <選項名稱>) 和是否每個都有設定到的指示。\n" " \n" " 選項:\n" -" -o\t限制 OPTNAME 為定義用於「set -o」的選項\n" +" -o\t限制 <選項名稱> 為定義用於「set -o」的選項\n" " -p\t印出每個 shell 選項並標註它的狀態。\n" " -q\t抑制輸出\n" -" -s\t啟用(設定)每個 OPTNAME 選項\n" -" -u\t停用(取消設定)每個 OPTNAME 選項\n" +" -s\t啟用(設定)每個 <選項名稱> 選項\n" +" -u\t停用(取消設定)每個 <選項名稱> 選項\n" " \n" " 退出狀態:\n" -" 如果 OPTNAME 選項被啟用則回傳成功;如果是\n" -" 無效的選項或 OPTNAME 被停用則失敗。" +" 如果 <選項名稱> 選項被啟用則回傳成功;如果是\n" +" 無效的選項或 <選項名稱> 被停用則失敗。" #: builtins.c:1927 msgid "" @@ -5297,62 +5156,51 @@ msgid "" " -v var\tassign the output to shell variable VAR rather than\n" " \t\tdisplay it on the standard output\n" " \n" -" FORMAT is a character string which contains three types of objects: " -"plain\n" -" characters, which are simply copied to standard output; character " -"escape\n" +" FORMAT is a character string which contains three types of objects: plain\n" +" characters, which are simply copied to standard output; character escape\n" " sequences, which are converted and copied to the standard output; and\n" -" format specifications, each of which causes printing of the next " -"successive\n" +" format specifications, each of which causes printing of the next successive\n" " argument.\n" " \n" -" In addition to the standard format specifications described in printf" -"(1),\n" +" In addition to the standard format specifications described in printf(1),\n" " printf interprets:\n" " \n" " %b\texpand backslash escape sequences in the corresponding argument\n" " %q\tquote the argument in a way that can be reused as shell input\n" -" %(fmt)T\toutput the date-time string resulting from using FMT as a " -"format\n" +" %(fmt)T\toutput the date-time string resulting from using FMT as a format\n" " \t string for strftime(3)\n" " \n" " The format is re-used as necessary to consume all of the arguments. If\n" " there are fewer arguments than the format requires, extra format\n" -" specifications behave as if a zero value or null string, as " -"appropriate,\n" +" specifications behave as if a zero value or null string, as appropriate,\n" " had been supplied.\n" " \n" " Exit Status:\n" -" Returns success unless an invalid option is given or a write or " -"assignment\n" +" Returns success unless an invalid option is given or a write or assignment\n" " error occurs." msgstr "" -"在 FORMAT 的控制下格式化並印出 ARGUMENTS 引數。\n" +"在 FORMAT 的控制下格式化並印出 <參數>。\n" " \n" " 選項:\n" " -v var\t將輸出指派給 shell 變數 VAR 而不顯示在標準輸出上\n" " \n" " FORMAT 是包含三種物件的字串:簡單地被複製到標準輸出的普通字元;\n" -" 被變換之後複製到標準輸入的逸出字元;以及每個都會影響到下個引數的印出格式" -"化規格。\n" +" 被變換之後複製到標準輸入的逸出字元;以及每個都會影響到下個參數的印出格式化規格。\n" " \n" " 在 printf(1) 中描述的標準控制規格之外,printf 解析:\n" "、 \n" -" %b\t擴充套件對應引數中的反斜線逸出序列\n" -" %q\t以可做為 shell 輸入的格式引用引數\n" +" %b\t擴充套件對應參數中的反斜線逸出序列\n" +" %q\t以可做為 shell 輸入的格式引用參數\n" " %(fmt)T\t以 FMT 為提供 strftime(3) 的格式輸出日期與時間字串 \n" " 退出狀態:\n" " 回傳成功,除非使用了無效的選項或者發生寫入或指派錯誤。" #: builtins.c:1961 -#, fuzzy msgid "" "Specify how arguments are to be completed by Readline.\n" " \n" -" For each NAME, specify how arguments are to be completed. If no " -"options\n" -" are supplied, existing completion specifications are printed in a way " -"that\n" +" For each NAME, specify how arguments are to be completed. If no options\n" +" are supplied, existing completion specifications are printed in a way that\n" " allows them to be reused as input.\n" " \n" " Options:\n" @@ -5367,25 +5215,23 @@ msgid "" " \t\tcommand) word\n" " \n" " When completion is attempted, the actions are applied in the order the\n" -" uppercase-letter options are listed above. If multiple options are " -"supplied,\n" -" the -D option takes precedence over -E, and both take precedence over -" -"I.\n" +" uppercase-letter options are listed above. If multiple options are supplied,\n" +" the -D option takes precedence over -E, and both take precedence over -I.\n" " \n" " Exit Status:\n" " Returns success unless an invalid option is supplied or an error occurs." msgstr "" -"規範 readline 如何完成讀取引數。\n" +"規範 readline 如何完成讀取參數。\n" " \n" -" 規格對於每一個<名稱>如何完成讀取引數。如果不帶選項,\n" +" 規格對於每一個<名稱>如何完成讀取參數。如果不帶選項,\n" " 現有的補完規格會以可以重用為輸入的格式印出。\n" " \n" " 選項:\n" " -p\t以可重用的格式印出現有的補完規格。\n" " -r\t對於每個<名稱>刪除補完規格,或者如果沒有提供<名稱>\n" " \t名稱,刪除所有的補完規格。\n" -" -D\t對於沒有補完規格定義的命令,設定預設的補完動作\n" -" -E\t對於「empty」命令設定補完動作,—— 對於空列的補完。\n" +" -D\t對於沒有補完規格定義的指令,設定預設的補完動作\n" +" -E\t對於「empty」指令設定補完動作,—— 對於空列的補完。\n" " -I\t套用補完和動作到首個 (通常是指令) 單詞\n" " \n" " 嘗試補完時,按照上述大寫字母選項的順序進行動作。 如果傳入了多個選項,\n" @@ -5399,8 +5245,7 @@ msgid "" "Display possible completions depending on the options.\n" " \n" " Intended to be used from within a shell function generating possible\n" -" completions. If the optional WORD argument is supplied, matches " -"against\n" +" completions. If the optional WORD argument is supplied, matches against\n" " WORD are generated.\n" " \n" " Exit Status:\n" @@ -5409,8 +5254,8 @@ msgstr "" "依據選項顯示可能的補完。\n" " \n" " 意圖在能產生可能的補完 shell 函數內部使用。\n" -" 如果提供了可選的 WORD 引數,則產生按照 WORD\n" -" 進行的匹配。\n" +" 如果提供了可選的 WORD 參數,則產生按照 WORD\n" +" 進行的符合。\n" " \n" " 退出狀態:\n" " 除非使用了無效選項或者錯誤發生,否則回傳成功。" @@ -5419,12 +5264,9 @@ msgstr "" msgid "" "Modify or display completion options.\n" " \n" -" Modify the completion options for each NAME, or, if no NAMEs are " -"supplied,\n" -" the completion currently being executed. If no OPTIONs are given, " -"print\n" -" the completion options for each NAME or the current completion " -"specification.\n" +" Modify the completion options for each NAME, or, if no NAMEs are supplied,\n" +" the completion currently being executed. If no OPTIONs are given, print\n" +" the completion options for each NAME or the current completion specification.\n" " \n" " Options:\n" " \t-o option\tSet completion option OPTION for each NAME\n" @@ -5448,47 +5290,41 @@ msgid "" msgstr "" "修改或顯示補完選項。\n" " \n" -" 修改每個 NAME 名稱的補完選項,或如果沒有提供 NAME 名稱,執行當前的補" -"完。\n" -" 如果不帶選項,印出每個 NAME 名稱的補完選項或當前的補完規格。\n" +" 修改每個 <名稱> 的補完選項,或如果沒有提供 <名稱>,執行目前的補完。\n" +" 如果不帶選項,印出每個 <名稱> 的補完選項或目前的補完規格。\n" " \n" " 選項:\n" -" \t-o option\t為每個 NAME 名稱設定補完選項 option\n" -" \t-D\t\t為「default」命令補完變更選項\n" -" \t-E\t\t為「empty」命令補完變更選項\n" +" \t-o option\t為每個 <名稱> 設定補完選項 option\n" +" \t-D\t\t為「default」指令補完變更選項\n" +" \t-E\t\t為「empty」指令補完變更選項\n" " \t-I\t\t為首單詞上的補完變更選項\n" " \n" " 使用「+o」而不是「-o」可以關閉指定的選項。\n" " \n" -" 引數:\n" +" 參數:\n" " \n" -" 每個 NAME 名稱都對應一個之前以藉由「complete」內建定義了補完規格的\n" -" 命令。如果不提供 NAME 名稱,當前生成補完的函數必須呼叫 compopt,\n" -" 並且當前執行的補完生成器選項會被修改。\n" +" 每個 <名稱> 都對應一個之前以藉由「complete」內建定義了補完規格的\n" +" 指令。如果不提供 <名稱>,目前產生補完的函數必須呼叫 compopt,\n" +" 並且目前執行的補完產生器選項會被修改。\n" " \n" " 退出狀態:\n" -" 回傳成功,除非使用了無效的選項或者 NAME 名稱沒有定義補完規格。" +" 回傳成功,除非使用了無效的選項或者 <名稱> 沒有定義補完規格。" #: builtins.c:2037 msgid "" "Read lines from the standard input into an indexed array variable.\n" " \n" -" Read lines from the standard input into the indexed array variable " -"ARRAY, or\n" -" from file descriptor FD if the -u option is supplied. The variable " -"MAPFILE\n" +" Read lines from the standard input into the indexed array variable ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable MAPFILE\n" " is the default ARRAY.\n" " \n" " Options:\n" " -d delim\tUse DELIM to terminate lines, instead of newline\n" -" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " -"copied\n" -" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " -"index is 0\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are copied\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default index is 0\n" " -s count\tDiscard the first COUNT lines read\n" " -t\tRemove a trailing DELIM from each line read (default newline)\n" -" -u fd\tRead lines from file descriptor FD instead of the standard " -"input\n" +" -u fd\tRead lines from file descriptor FD instead of the standard input\n" " -C callback\tEvaluate CALLBACK each time QUANTUM lines are read\n" " -c quantum\tSpecify the number of lines read between each call to\n" " \t\t\tCALLBACK\n" @@ -5501,13 +5337,11 @@ msgid "" " element to be assigned and the line to be assigned to that element\n" " as additional arguments.\n" " \n" -" If not supplied with an explicit origin, mapfile will clear ARRAY " -"before\n" +" If not supplied with an explicit origin, mapfile will clear ARRAY before\n" " assigning to it.\n" " \n" " Exit Status:\n" -" Returns success unless an invalid option is given or ARRAY is readonly " -"or\n" +" Returns success unless an invalid option is given or ARRAY is readonly or\n" " not an indexed array." msgstr "" "從標準輸入讀取列到索引陣列變數中。\n" @@ -5525,11 +5359,11 @@ msgstr "" " -C callback\t每 QUANTUM 次讀列之後對 CALLBACK 回呼求值。\n" " -c quantum\t定義每次呼叫 CALLBACK 回呼之間讀取的列數。\n" " \n" -" 引數:\n" +" 參數:\n" " ARRAY\t\t儲存資料使用的陣列變數\n" " \n" " 如果使用了 -C 而沒有 -c,預設的定量是 5000。當對 CALLBACK 求值時,\n" -" 下一個將被指派的陣列元素索引做為額外引數被傳遞。\n" +" 下一個將被指派的陣列元素索引做為額外參數被傳遞。\n" " \n" " 如果沒有顯式指定起始索引,mapfile 將在指派前清空 ARRAY 變數。\n" " \n" diff --git a/redir.c b/redir.c index 6f4e600bf..fc35f7ca1 100644 --- a/redir.c +++ b/redir.c @@ -120,7 +120,7 @@ do { \ { \ if (fd >= 0) \ close (fd); \ - last_command_exit_value = EXECUTION_FAILURE;\ + set_exit_status (EXECUTION_FAILURE);\ return ((e) == 0 ? EINVAL : (e));\ } \ } while (0) diff --git a/shell.c b/shell.c index cfaf73f3e..9e3a906ae 100644 --- a/shell.c +++ b/shell.c @@ -1038,6 +1038,13 @@ subshell_exit (s) sh_exit (s); } +void +set_exit_status (s) + int s; +{ + set_pipestatus_from_exit (last_command_exit_value = s); +} + /* Source the bash startup files. If POSIXLY_CORRECT is non-zero, we obey the Posix.2 startup file rules: $ENV is expanded, and if the file it names exists, that file is sourced. The Posix.2 rules are in effect diff --git a/sig.c b/sig.c index d26ba1e1e..44cf0f4fb 100644 --- a/sig.c +++ b/sig.c @@ -394,6 +394,7 @@ throw_to_top_level () { if (last_command_exit_value < 128) last_command_exit_value = 128 + SIGINT; + set_pipestatus_from_exit (last_command_exit_value); print_newline = 1; DELINTERRUPT; } @@ -404,6 +405,7 @@ throw_to_top_level () last_command_exit_signal = (last_command_exit_value > 128) ? (last_command_exit_value - 128) : 0; last_command_exit_value |= 128; + set_pipestatus_from_exit (last_command_exit_value); /* Run any traps set on SIGINT, mostly for interactive shells */ if (signal_is_trapped (SIGINT)) @@ -647,6 +649,7 @@ sigint_sighandler (sig) if (wait_intr_flag) { last_command_exit_value = 128 + sig; + set_pipestatus_from_exit (last_command_exit_value); wait_signal_received = sig; SIGRETURN (0); } @@ -655,6 +658,7 @@ sigint_sighandler (sig) { interrupt_immediately = 0; last_command_exit_value = 128 + sig; + set_pipestatus_from_exit (last_command_exit_value); throw_to_top_level (); } #if defined (READLINE) diff --git a/subst.c b/subst.c index ac3f61bad..074c740d2 100644 --- a/subst.c +++ b/subst.c @@ -3270,7 +3270,7 @@ do_assignment_internal (word, expand) retval = 0; /* assignment failure */ else if (noassign_p (entry)) { - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); retval = 1; /* error status, but not assignment failure */ } else @@ -4803,6 +4803,8 @@ match_upattern (string, pat, mtype, sp, ep) end = string + len; mlen = umatchlen (pat, len); + if (mlen > len) + return (0); switch (mtype) { @@ -4958,6 +4960,8 @@ match_wpattern (wstring, indices, wstrlen, wpat, mtype, sp, ep) return (0); mlen = wmatchlen (wpat, wstrlen); + if (mlen > wstrlen) + return (0); /* itrace("wmatchlen (%ls) -> %d", wpat, mlen); */ switch (mtype) @@ -6501,7 +6505,7 @@ array_length_reference (s) { c = *--t; *t = '\0'; - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); err_unboundvar (s); *t = c; return (-1); @@ -6784,7 +6788,7 @@ expand_arrayref: /* y=2 ; typeset -n x=y; echo ${x} is not the same as echo ${2} in ksh */ if (temp && *temp && legal_identifier (temp) == 0) { - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); report_error (_("%s: invalid variable name for name reference"), temp); temp = &expand_param_error; } @@ -7143,7 +7147,7 @@ parameter_brace_expand_error (name, value, check_null) WORD_LIST *l; char *temp; - last_command_exit_value = EXECUTION_FAILURE; /* ensure it's non-zero */ + set_exit_status (EXECUTION_FAILURE); /* ensure it's non-zero */ if (value && *value) { l = expand_string (value, 0); @@ -8769,7 +8773,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta number = parameter_brace_expand_length (name); if (number == INTMAX_MIN && unbound_vars_is_error) { - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); err_unboundvar (name+1); free (name); return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); @@ -8981,7 +8985,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta { if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1]) && all_element_arrayref == 0) { - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); err_unboundvar (name); FREE (value); FREE (temp); @@ -9082,7 +9086,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta default: case '\0': bad_substitution: - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); report_error (_("%s: bad substitution"), string ? string : "??"); FREE (value); FREE (temp); @@ -9103,7 +9107,7 @@ bad_substitution: if (temp1 == &expand_param_error || temp1 == &expand_param_fatal) { free (name); - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); report_error (_("%s: bad substitution"), string ? string : "??"); return (temp1 == &expand_param_error ? &expand_wdesc_error : &expand_wdesc_fatal); } @@ -9191,7 +9195,7 @@ bad_substitution: temp = (char *)NULL; if (c == '=' && var_is_special) { - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); report_error (_("$%s: cannot assign in this way"), name); free (name); free (value); @@ -9288,7 +9292,7 @@ param_expand (string, sindex, quoted, expanded_something, uerror[0] = '$'; uerror[1] = c; uerror[2] = '\0'; - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); err_unboundvar (uerror); return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); } @@ -9336,7 +9340,7 @@ param_expand (string, sindex, quoted, expanded_something, uerror[0] = '$'; uerror[1] = c; uerror[2] = '\0'; - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); err_unboundvar (uerror); return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); } @@ -9363,7 +9367,7 @@ param_expand (string, sindex, quoted, expanded_something, uerror[0] = '$'; uerror[1] = '*'; uerror[2] = '\0'; - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); err_unboundvar (uerror); return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); } @@ -9486,7 +9490,7 @@ param_expand (string, sindex, quoted, expanded_something, uerror[0] = '$'; uerror[1] = '@'; uerror[2] = '\0'; - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); err_unboundvar (uerror); return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); } @@ -9637,7 +9641,7 @@ arithsub: { if (interactive_shell == 0 && posixly_correct) { - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); return (&expand_wdesc_fatal); } else @@ -9753,7 +9757,7 @@ comsub: /* y=2 ; typeset -n x=y; echo $x is not the same as echo $2 in ksh */ if (temp && *temp && legal_identifier (temp) == 0) { - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); report_error (_("%s: invalid variable name for name reference"), temp); return (&expand_wdesc_error); /* XXX */ } @@ -9766,7 +9770,7 @@ comsub: unbound_variable: if (unbound_vars_is_error) { - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); err_unboundvar (temp1); } else @@ -9776,7 +9780,7 @@ unbound_variable: } free (temp1); - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); return ((unbound_vars_is_error && interactive_shell == 0) ? &expand_wdesc_fatal : &expand_wdesc_error); @@ -10171,7 +10175,7 @@ add_string: sindex = t_index; goto add_character; } - last_command_exit_value = EXECUTION_FAILURE; + set_exit_status (EXECUTION_FAILURE); report_error (_("bad substitution: no closing \"`\" in %s") , string+t_index); free (string); free (istring); diff --git a/variables.c b/variables.c index 408f5314f..77a61c4f6 100644 --- a/variables.c +++ b/variables.c @@ -425,7 +425,7 @@ initialize_shell_variables (env, privmode) VSETATTR (temp_var, (att_exported | att_imported | att_invisible)); array_needs_making = 1; } - last_command_exit_value = 1; + last_command_exit_value = EXECUTION_FAILURE; report_error (_("error importing function definition for `%s'"), tname); } @@ -6292,7 +6292,7 @@ sv_locale (name) #if 1 if (r == 0 && posixly_correct) - last_command_exit_value = 1; + set_exit_status (EXECUTION_FAILURE); #endif }