commit bash-20100108 snapshot

This commit is contained in:
Chet Ramey
2011-12-12 21:52:17 -05:00
parent 9c7f20c7c6
commit 1665e22a82
11 changed files with 16543 additions and 2385 deletions
+36
View File
@@ -9324,3 +9324,39 @@ doc/bash.1
<doko@debian.org>
[bash-4.1 frozen]
12/31
-----
[bash-4.1 released]
1/5/2010
--------
doc/bashref.texi
- document compat32 and compat40 shopt options. Omission pointed out
by Dilyan Palauzov <Dilyan.Palauzov@aegee.org>
1/6
---
lib/readline/complete.c
- use `convfn' (converted filename) instead of entry->d_name (filename
read from file system) when adding partial or full completions to
the command line. Bug and fix from Guillaume Outters
<guillaume.outters@free.fr>
1/7
---
builtins/printf.def
- fix prototype in extern declaration for vsnprintf. Fix for bug
reported by Yann Rouillard <yann@pleiades.fr.eu.org>
1/9
---
parse.y
- fix shell_getc to handle alias expansions containing quoted
newlines. Problems in bash-4.1 with aliases containing quoted
newlines in the middle of and at the end of their expansion.
Fix for bug reported by Jonathan Claggett
<jonathan@claggett.org>
- change mk_alexpansion to not append a space to an alias
expansion ending with a newline. Works with shell_getc
+9346
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -162,7 +162,7 @@ resetpwd (caller)
#define LCD_DOVARS 0x001
#define LCD_DOSPELL 0x002
#define LCD_PRINTPATH 0x004
#define LCD_FREEDIRNAME 0x010
#define LCD_FREEDIRNAME 0x008
/* This builtin is ultimately the way that all user-visible commands should
change the current working directory. It is called by cd_to_string (),
+1 -1
View File
@@ -172,7 +172,7 @@ extern int asprintf __P((char **, const char *, ...)) __attribute__((__format__
#endif
#if !HAVE_VSNPRINTF
extern int vsnprintf __P((char *, size_t, const char *, ...)) __attribute__((__format__ (printf, 3, 4)));
extern int vsnprintf __P((char *, size_t, const char *, va_list)) __attribute__((__format__ (printf, 3, 0)));
#endif
static void printf_erange __P((char *));
+11
View File
@@ -4363,6 +4363,17 @@ If set, Bash
changes its behavior to that of version 3.1 with respect to quoted
arguments to the conditional command's =~ operator.
@item compat32
If set, Bash
changes its behavior to that of version 3.2 with respect to locale-specific
string comparison when using the conditional command's < and > operators.
@item compat40
If set, Bash
changes its behavior to that of version 4.0 with respect to locale-specific
string comparison when using the conditional command's < and > operators
and the effect of interrupting a command list.
@item dirspell
If set, Bash
attempts spelling correction on directory names during word completion
+2 -2
View File
@@ -2138,7 +2138,7 @@ rl_filename_completion_function (text, state)
All other entries except "." and ".." match. */
if (filename_len == 0)
{
if (_rl_match_hidden_files == 0 && HIDDEN_FILE (entry->d_name))
if (_rl_match_hidden_files == 0 && HIDDEN_FILE (convfn))
continue;
if (convfn[0] != '.' ||
@@ -2219,7 +2219,7 @@ rl_filename_completion_function (text, state)
temp[dirlen++] = '/';
}
strcpy (temp + dirlen, entry->d_name);
strcpy (temp + dirlen, convfn);
}
else
temp = savestring (convfn);
+21 -15
View File
@@ -2278,7 +2278,7 @@ shell_getc (remove_quoted_newline)
shell_input_line = expansions;
shell_input_line_len = shell_input_line ?
strlen (shell_input_line) : 0;
if (!shell_input_line_len)
if (shell_input_line_len == 0)
current_command_line_count--;
/* We have to force the xrealloc below because we don't know
@@ -2343,6 +2343,7 @@ shell_getc (remove_quoted_newline)
}
}
next_alias_char:
uc = shell_input_line[shell_input_line_index];
if (uc)
@@ -2355,7 +2356,7 @@ shell_getc (remove_quoted_newline)
Do it transparently; just return the next character of the string popped
to. */
pop_alias:
if (!uc && (pushed_string_list != (STRING_SAVER *)NULL))
if (uc == 0 && (pushed_string_list != (STRING_SAVER *)NULL))
{
pop_string ();
uc = shell_input_line[shell_input_line_index];
@@ -2369,21 +2370,28 @@ pop_alias:
if (SHOULD_PROMPT ())
prompt_again ();
line_number++;
/* XXX - what do we do here if we're expanding an alias whose definition
ends with a newline? Recall that we inhibit the appending of a
space in mk_alexpansion() if newline is the last character. */
#if 0 /* XXX - bash-4.2 (jonathan@claggett.org) */
/* What do we do here if we're expanding an alias whose definition
includes an escaped newline? If that's the last character in the
alias expansion, we just pop the pushed string list (recall that
we inhibit the appending of a space in mk_alexpansion() if newline
is the last character). If it's not the last character, we need
to consume the quoted newline and move to the next character in
the expansion. */
if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0')
{
uc = 0;
goto pop_alias;
}
#endif
goto restart_read;
else if (expanding_alias () && shell_input_line[shell_input_line_index+1] != '\0')
{
shell_input_line_index++; /* skip newline */
goto next_alias_char; /* and get next character */
}
else
goto restart_read;
}
if (!uc && shell_input_line_terminator == EOF)
if (uc == 0 && shell_input_line_terminator == EOF)
return ((shell_input_line_index != 0) ? '\n' : EOF);
return (uc);
@@ -2590,11 +2598,9 @@ mk_alexpansion (s)
l = strlen (s);
r = xmalloc (l + 2);
strcpy (r, s);
#if 0 /* XXX - bash-4.2 */
if (r[l -1] != ' ' && r[l -1] != '\n')
#else
if (r[l -1] != ' ')
#endif
/* If the last character in the alias is a newline, don't add a trailing
space to the expansion. Works with shell_getc above. */
if (r[l - 1] != ' ' && r[l - 1] != '\n')
r[l++] = ' ';
r[l] = '\0';
return r;
+5922
View File
File diff suppressed because it is too large Load Diff
+642 -1334
View File
File diff suppressed because it is too large Load Diff
+289 -526
View File
File diff suppressed because it is too large Load Diff
+272 -506
View File
File diff suppressed because it is too large Load Diff