support/config.guess,support/config.sub,support/config.rpath
- new versions, imported from gnulib
+
+ 4/5
+ ---
+doc/bashref.texi
+ - update compatibility, posix mode, and bourne shell sections for
+ bash-5.3-alpha release
+
+version.c
+ - update copyright date to 2024
+
+[bash-5.3-alpha frozen]
+
+ 4/6
+ ---
+builtins/cd.def
+ - cd_builtin: a null pathname argument is now an error; POSIX interp
+ 1047
+
+variables.c
+ - makunbound: revert change from 7/10/2023 about preserving the export
+ attribute when unsetting a local variable in light of POSIX interp
+ 1806
+
+ 4/8
+ ---
+bashline.c
+ - command_word_completion_function: we don't need to perform an extra
+ comparison against what rl_filename_completion_function returns if
+ we are searching $PATH for executable completions
+ - command_word_completion_function: if a directory name from $PATH
+ contains characters that need to be quoted, quote them and set
+ rl_completion_found_quote to force rl_filename_completion_function
+ to dequote the entire pathname
+ - command_word_completion_function: since the directory name from $PATH
+ is not quoted, use the dequoted hint to construct the full pathname
+ to pass to rl_filename_completion_function (possibly after quoting it
+ From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=306043
+
+ 4/10
+ ----
+redir.h
+ - RX_EXPANDED: flag set when translating redirects to their final form;
+ indicates the redirection should not be expanded again
+
+redir.c
+ - do_redirection_internal: when translating a redirect into
+ r_err_and_out, set the RX_EXPANDED flag so the filename doesn't
+ get expanded again.
+ Fixes bug reported by squeaky <q7d9y9muja@liamekaens.com>
+
+
lib/glob/collsyms.h f
lib/glob/doc/Makefile f
lib/glob/doc/glob.texi f
-lib/glob/ndir.h f
lib/intl/Makefile.in f
lib/intl/VERSION f
lib/intl/ref-add.sin f
CWRU/misc/bison f
CWRU/misc/errlist.c f
CWRU/misc/hpux10-dlfcn.h f
-CWRU/PLATFORMS f
CWRU/README f
CWRU/changelog f
CWRU/sh-redir-hack f
tests/array30.sub f
tests/array31.sub f
tests/array32.sub f
+tests/array33.sub f
tests/array-at-star f
tests/array2.right f
tests/assoc.tests f
tests/builtins9.sub f
tests/builtins10.sub f
tests/builtins11.sub f
+tests/builtins12.sub f
tests/source1.sub f
tests/source2.sub f
tests/source3.sub f
tests/func2.sub f
tests/func3.sub f
tests/func4.sub f
+tests/func5.sub f
tests/getopts.tests f
tests/getopts.right f
tests/getopts1.sub f
subst.o: make_cmd.h subst.h sig.h pathnames.h externs.h parser.h
subst.o: flags.h jobs.h siglist.h execute_cmd.h ${BASHINCDIR}/filecntl.h trap.h pathexp.h
subst.o: mailcheck.h input.h $(DEFSRC)/getopt.h $(DEFSRC)/common.h
-subst.o: bashline.h bashhist.h ${GLOB_LIBSRC}/strmatch.h
+subst.o: bashline.h bashhist.h ${GLOB_LIBSRC}/strmatch.h redir.h
subst.o: ${BASHINCDIR}/chartypes.h
subst.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h
subst.o: ${DEFDIR}/builtext.h
static int mapping_over, local_index, searching_path, hint_is_dir;
static int old_glob_ignore_case, globpat;
static SHELL_VAR **varlist = (SHELL_VAR **)NULL;
+ static int orig_found_quote;
#if defined (ALIAS)
static alias_t **alias_list = (alias_t **)NULL;
#endif /* ALIAS */
if (rl_completion_found_quote && rl_completion_quote_character == 0)
dequoted_hint = bash_dequote_filename (hint, 0);
-
+
+ orig_found_quote = rl_completion_found_quote;
+
path = path_value ("PATH", 0);
path_index = dot_in_path = 0;
{
char *current_path;
+ rl_completion_found_quote = orig_found_quote;
+
/* Get the next directory from the path. If there is none, then we
are all done. */
if (path == 0 || path[path_index] == 0 ||
free (filename_hint);
fnhint = filename_hint = (char *)NULL;
- filename_hint = sh_makepath (current_path, hint, 0);
+ /* We can have characters that need to be quoted in either the $PATH
+ element or the dequoted filename. Since we only want to call a
+ quoting function on the entire path once, and we've already dequoted
+ the hint text we were passed (dequoted_hint), build the path using
+ the dequoted hint text and quote it if we need to. Readline will only
+ call the dequoting function if rl_completion_found_quote != 0, so
+ we have to force it. */
+
+ filename_hint = sh_makepath (current_path, dequoted_hint, 0);
/* Need a quoted version (though it doesn't matter much in most
cases) because rl_filename_completion_function dequotes the
filename it gets, assuming that it's been quoted as part of
the input line buffer. */
+#if 1
if (strpbrk (filename_hint, "\"'\\"))
- fnhint = sh_backslash_quote (filename_hint, filename_bstab, 0);
+#else
+ if (strpbrk (filename_hint, rl_filename_quote_characters))
+#endif
+ {
+ fnhint = sh_backslash_quote (filename_hint, filename_bstab, 0);
+ rl_completion_found_quote = 4; /* just has to be non-zero */
+ }
else
fnhint = filename_hint;
free (current_path); /* XXX */
if (temp)
{
temp++;
+#if 0
+ /* We're comparing an unquoted filename read from the directory
+ (temp, returned by rl_filename_completion_function) against
+ the possibly-quoted hint text. We should compare against
+ the dequoted hint text. */
if (igncase == 0)
freetemp = match = strncmp (temp, hint, hint_len) == 0;
else
freetemp = match = strncasecmp (temp, hint, hint_len) == 0;
+#else
+ /* Why duplicate the comparison rl_filename_completion_function
+ already performs? */
+ freetemp = match = 1;
+#endif
if (match)
temp = savestring (temp);
}
return (EX_USAGE);
}
#endif
-#if 0
else if (list->word->word[0] == '\0')
{
builtin_error (_("null directory")); /* POSIX cd implementation defined */
return (EXECUTION_FAILURE);
}
-#endif
else if (list->word->word[0] == '-' && list->word->word[1] == '\0')
{
/* This is `cd -', equivalent to `cd $OLDPWD' */
--- /dev/null
+You are a software developer writing a widely-user open source software package. You are discussing a new feature with a user. Write an email declining the user's proposal because it is too complicated.
+
+
sd = redirect->redirector;
rd.filename = make_bare_word (redirectee_word);
new_redirect = make_redirection (sd, r_err_and_out, rd, 0);
+ new_redirect->flags |= RX_EXPANDED; /* we already expanded this */
}
else
{
oflags = redirectee->flags;
redirectee->flags |= W_NOGLOB;
}
- redirectee_word = redirection_expand (redirectee);
+ if ((redirect->flags & RX_EXPANDED) == 0)
+ redirectee_word = redirection_expand (redirectee);
+ else
+ redirectee_word = savestring (redirectee->word);
if (posixly_correct && interactive_shell == 0)
redirectee->flags = oflags;
#define RX_USER 0x10
#define RX_SAVCLEXEC 0x20 /* set close-on-exec off in restored fd even though saved on has it on */
#define RX_SAVEFD 0x40 /* fd used to save another even if < SHELL_FD_BASE */
+#define RX_EXPANDED 0x80 /* this redirection has already been expanded */
extern void redirection_error (REDIRECT *, int, char *);
extern int do_redirections (REDIRECT *, int);
bash(1)
IMPLEMENTATION
- Copyright (C) 2022 Free Software Foundation, Inc.
+ Copyright (C) 2024 Free Software Foundation, Inc.
These shell commands are defined internally. Type `help' to see this list.
Type `help name' to find out more about the function `name'.
{
dispose_variable_value (old_var);
-#if 0
/* Reset the attributes. Preserve the export attribute if the variable
came from a temporary environment. Make sure it stays local, and
make it invisible. */
old_var->attributes = (exported_p (old_var) && tempvar_p (old_var)) ? att_exported : 0;
-#else /* TAG:bash-5.3 look at this again */
- /* Reset the attributes, but preserve the export attribute.
- Make sure it stays local, and make it invisible. */
- old_var->attributes = exported_p (old_var) ? att_exported : 0;
-#endif
VSETATTR (old_var, att_local);
VSETATTR (old_var, att_invisible);
var_setvalue (old_var, (char *)NULL);