----
doc/{bash.1,bashref.texi}
- document that the shell uses $TMPDIR when creating temporary files
+
+ 7/20
+ ----
+[bash-3.1-alpha1 frozen]
+
+ 7/29
+ ----
+builtins/evalstring.c
+ - make sure that parse_and_execute saves and restores the value of
+ loop_level, so loops in sourced scripts and eval'd strings don't
+ mess up the shell's parser state
+
+bashline.c
+ - change command_subst_completion_function to suppress appending
+ any character to a unique completion, instead of a space, unless
+ the last word in the quoted command substitution completes to a
+ directory name. In that case we append the expected slash
to use it - rudimentary support for supporting the existing
recursion using a stack of contexts, each with a reference to the
previous
- - fix so that ^G works when in callback mode
+ - fix so that ^G works when in callback mode
lib/readline/callback.c
- call the appropriate multiple-key sequence callback if the state is
----
doc/{bash.1,bashref.texi}
- document that the shell uses $TMPDIR when creating temporary files
+
+ 7/20
+ ----
+[bash-3.1-alpha1 frozen]
+
+ 7/29
+ ----
+builtins/evalstring.c
+ - make sure that parse_and_execute saves and restores the value of
+ loop_level, so loops in sourced scripts and eval'd strings don't
+ mess up the shell's parser state
+
+bashline.c
+ - change command_subst_completion_function to suppress appending
+ any character to a unique completion, instead of a space, which
+ can be misleading when the last word in the quoted command
+ substitution completes to a directory name
/* bashline.c -- Bash's interface to the readline library. */
-/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
/* If there is more than one match, rl_completion_matches has already
put the lcd in matches[0]. Skip over it. */
cmd_index = matches && matches[0] && matches[1];
+
+ /* If there's a single match and it's a directory, set the append char
+ to the expected `/'. Otherwise, don't append anything. */
+ if (matches && matches[0] && matches[1] == 0 && test_for_directory (matches[0]))
+ rl_completion_append_character = '/';
+ else
+ rl_completion_suppress_append = 1;
}
if (!matches || !matches[cmd_index])
/* bashline.c -- Bash's interface to the readline library. */
-/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
#endif
/* Helper functions for Readline. */
-static int bash_directory_expansion __P((char **));
+static void bash_directory_expansion __P((char **));
static int bash_directory_completion_hook __P((char **));
static int filename_completion_ignore __P((char **));
static int bash_push_line __P((void));
s = find_cmd_start (start);
e = find_cmd_end (end);
n = find_cmd_name (s);
- if (e > s)
+ if (e > s && assignment (n, 0) == 0)
prog_complete_matches = programmable_completions (n, text, s, e, &foundcs);
else
foundcs = 0;
/* If there is more than one match, rl_completion_matches has already
put the lcd in matches[0]. Skip over it. */
cmd_index = matches && matches[0] && matches[1];
+
+ if (matches && matches[0] && matches[1] == 0 && test_for_directory (matches[0]))
+ rl_completion_append_character = '/';
+ else
+ rl_completion_suppress_append = 1;
}
if (!matches || !matches[cmd_index])
else
return (1);
}
-#endif
+#endif /* BANG_HISTORY */
/* History and alias expand the line. */
static int
{
char *new_line;
+ new_line = 0;
+#if defined (BANG_HISTORY)
new_line = history_expand_line_internal (rl_line_buffer);
+#endif
#if defined (ALIAS)
if (new_line)
char *new_line;
WORD_LIST *expanded_string;
+ new_line = 0;
+#if defined (BANG_HISTORY)
new_line = history_expand_line_internal (rl_line_buffer);
+#endif
#if defined (ALIAS)
if (new_line)
/* Simulate the expansions that will be performed by
rl_filename_completion_function. This must be called with the address of
a pointer to malloc'd memory. */
-static int
+static void
bash_directory_expansion (dirname)
char **dirname;
{
if (temp1[len1 - 1] == '/')
{
len2 = strlen (temp2);
- temp2 = (char *)xrealloc (temp2, len2 + 2);
- temp2[len2] = '/';
- temp2[len2 + 1] = '\0';
+ if (len2 > 2) /* don't append `/' to `/' or `//' */
+ {
+ temp2 = (char *)xrealloc (temp2, len2 + 2);
+ temp2[len2] = '/';
+ temp2[len2 + 1] = '\0';
+ }
}
free (local_dirname);
*dirname = temp2;
extern int line_number;
extern int last_command_exit_value;
extern int running_trap;
+extern int loop_level;
extern int posixly_correct;
int parse_and_execute_level = 0;
unwind_protect_jmp_buf (top_level);
unwind_protect_int (indirection_level);
unwind_protect_int (line_number);
+ unwind_protect_int (loop_level);
if (flags & (SEVAL_NONINT|SEVAL_INTERACT))
unwind_protect_int (interactive);
* parse_and_execute has not been called recursively AND
* we have parsed the full command (string == '\0') AND
* we have a simple command without redirections AND
- * the command is not being timed
+ * the command is not being timed AND
+ * the command's return status is not being inverted
* THEN
* tell the execution code that we don't need to fork
*/
if (temp_handler == trap_handler && signal_is_trapped (SIGINT) == 0)
temp_handler = trap_to_sighandler (SIGINT);
restore_sigint_handler ();
- if (temp_handler == SIG_DFL)
- termination_unwind_protect (SIGINT);
- else if (temp_handler != SIG_IGN)
- (*temp_handler) (SIGINT);
+ if (temp_handler == SIG_DFL)
+ termination_unwind_protect (SIGINT);
+ else if (temp_handler != SIG_IGN)
+ (*temp_handler) (SIGINT);
}
}
}