minor fix to readline:unix-filename-rubout

This commit is contained in:
Chet Ramey
2021-08-30 11:40:26 -04:00
parent ea32b611f7
commit 61782ca16b
6 changed files with 38 additions and 6 deletions
+8
View File
@@ -1776,3 +1776,11 @@ subst.c
doc/{bash.1,bashref.texi}
- document new '@k' parameter transformation operator
8/27
----
lib/readline/kill.c
- rl_unix_filename_rubout: handle pathnames that consist only of one
or more slashes. The old code went too far and deleted the previous
word as well. From dabe@dabe.com
+24
View File
@@ -351,6 +351,30 @@ rl_unix_filename_rubout (int count, int key)
while (count--)
{
c = rl_line_buffer[rl_point - 1];
/* First move backwards through whitespace */
while (rl_point && whitespace (c))
{
rl_point--;
c = rl_line_buffer[rl_point - 1];
}
/* Consume one or more slashes. */
if (c == '/')
{
int i;
i = rl_point - 1;
while (i > 0 && c == '/')
c = rl_line_buffer[--i];
if (i == 0 || whitespace (c))
{
rl_point = i + whitespace (c);
continue; /* slashes only */
}
c = '/';
}
while (rl_point && (whitespace (c) || c == '/'))
{
rl_point--;
BIN
View File
Binary file not shown.
+3 -3
View File
@@ -22,7 +22,7 @@ msgstr ""
#: arrayfunc.c:66
msgid "bad array subscript"
msgstr "subscrito de array incorreto"
msgstr "subscript de array incorreto"
#: arrayfunc.c:421 builtins/declare.def:638 variables.c:2274 variables.c:2300
#: variables.c:3133
@@ -48,7 +48,7 @@ msgstr "%s: impossível atribuir a índice não numérico"
#: arrayfunc.c:747
#, c-format
msgid "%s: %s: must use subscript when assigning associative array"
msgstr "%s: %s: deve usar subscrito ao atribuir um array associativo"
msgstr "%s: %s: deve-se usar subscript ao atribuir um array associativo"
#: bashhist.c:452
#, c-format
@@ -4049,7 +4049,7 @@ msgstr ""
" -t Sai após a leitura e execução de um comando.\n"
" -u Trata limpeza (unset) de variáveis como um erro quando substituindo.\n"
" -v Mostra linhas de entrada do shell na medida em que forem lidas.\n"
" -x Mostra comandos e seus argumentos na medida em que forme executados.\n"
" -x Mostra comandos e seus argumentos na medida em que forem executados.\n"
" -B o shell vai realizar expansão de chaves\n"
" -C Se definido, não permite arquivos normais existentes serem\n"
" sobrescritos por redirecionamento da saída.\n"
+2 -2
View File
@@ -8332,7 +8332,7 @@ parameter_brace_substring (varname, value, ind, substr, quoted, pflags, flags)
/* */
/****************************************************************/
#if 0 /* TAG: bash-5.2? */
#if 0 /* TAG: bash-5.2 */
static int
shouldexp_replacement (s)
char *s;
@@ -8374,7 +8374,7 @@ pat_subst (string, pat, rep, mflags)
mtype = mflags & MATCH_TYPEMASK;
#if 0 /* TAG: bash-5.2? */
#if 0 /* TAG: bash-5.2 */
rxpand = (rep && *rep) ? shouldexp_replacement (rep) : 0;
#else
rxpand = 0;
+1 -1
View File
@@ -1,4 +1,4 @@
BUILD_DIR=/usr/local/build/bash/bash-current
BUILD_DIR=/usr/local/build/chet/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR