mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-27 07:43:07 +02:00
commit bash-20090924 snapshot
This commit is contained in:
@@ -8889,3 +8889,33 @@ execute_cmd.c
|
||||
|
||||
doc/{bash.1,bashref.texi}
|
||||
- documented [[ command new locale-sensitive treatment of < and >
|
||||
|
||||
9/24
|
||||
----
|
||||
configure.in
|
||||
- add "darwin10" cases like darwin8 and darwin9 to handle linking with
|
||||
included readline and history libraries
|
||||
|
||||
9/26
|
||||
----
|
||||
lib/readline/display.c
|
||||
- modify change of 7/24 to use prompt_physical_chars instead of
|
||||
prompt_visible_length to account for visible multibyte characters in
|
||||
the line (usually in the prompt). Fixes debian bug #547264
|
||||
reported by Pietro Battiston <toobaz@email.it>
|
||||
- add flags argument to _rl_col_width; changed callers. flags > 0
|
||||
means that it's ok to use the already-computed prompt information;
|
||||
flags == 0 means that we're expanding the prompt and we should not
|
||||
short-circuit
|
||||
|
||||
parse.y
|
||||
- in decode_prompt_string, when expanding \w and \W on Mac OS X,
|
||||
use fnx_fromfs to convert from "filesystem" form to "input" form.
|
||||
This makes $PWD with multibyte characters work in the prompt
|
||||
string on Mac OS X
|
||||
|
||||
lib/sh/fnxform.c
|
||||
- in fnx_fromfs and fnx_tofs, use templen instead of outlen as last
|
||||
argument in calls to iconv, since outlen is used to keep track of
|
||||
the size of the buffer, and iconv potentially modifies its
|
||||
`outbytesleft' argument
|
||||
|
||||
@@ -8886,3 +8886,36 @@ execute_cmd.c
|
||||
- execute_cond_node sets TEST_LOCALE so [[ str1 < str2 ]] (and >)
|
||||
obey the locale. Fixes bug/incompatibility reported by Greg
|
||||
Wooledge <wooledg@eeg.ccf.org>
|
||||
|
||||
doc/{bash.1,bashref.texi}
|
||||
- documented [[ command new locale-sensitive treatment of < and >
|
||||
|
||||
9/24
|
||||
----
|
||||
configure.in
|
||||
- add "darwin10" cases like darwin8 and darwin9 to handle linking with
|
||||
included readline and history libraries
|
||||
|
||||
9/25
|
||||
----
|
||||
lib/readline/display.c
|
||||
- modify change of 7/24 to use prompt_physical_chars instead of
|
||||
prompt_visible_length to account for visible multibyte characters in
|
||||
the line (usually in the prompt). Fixes debian bug #547264
|
||||
reported by Pietro Battiston <toobaz@email.it>
|
||||
- add flags argument to _rl_col_width; changed callers. flags > 0
|
||||
means that it's ok to use the already-computed prompt information;
|
||||
flags == 0 means that we're expanding the prompt and we should not
|
||||
short-circuit
|
||||
|
||||
parse.y
|
||||
- in decode_prompt_string, when expanding \w and \W on Mac OS X,
|
||||
use fnx_fromfs to convert from "filesystem" form to "input" form.
|
||||
This makes $PWD with multibyte characters work in the prompt
|
||||
string on Mac OS X
|
||||
|
||||
lib/sh/fnxform.c
|
||||
- in fnx_fromfs and fnx_tofs, use templen instead of outlen as last
|
||||
argument in calls to iconv, since outlen is used to keep track of
|
||||
the size of the buffer, and iconv potentially modifies its
|
||||
`outbytesleft' argument
|
||||
|
||||
@@ -1034,6 +1034,7 @@ tests/set-e1.sub f
|
||||
tests/set-e2.sub f
|
||||
tests/set-e.right f
|
||||
tests/set-x.tests f
|
||||
tests/set-x1.tests f
|
||||
tests/set-x.right f
|
||||
tests/shopt.tests f
|
||||
tests/shopt.right f
|
||||
|
||||
@@ -5827,7 +5827,7 @@ _ACEOF
|
||||
# static version specified as -llibname to override the
|
||||
# dynamic version
|
||||
case "${host_os}" in
|
||||
darwin[89]*) READLINE_LIB='${READLINE_LIBRARY}' ;;
|
||||
darwin[89]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;;
|
||||
*) READLINE_LIB=-lreadline ;;
|
||||
esac
|
||||
fi
|
||||
@@ -5868,7 +5868,7 @@ _ACEOF
|
||||
# static version specified as -llibname to override the
|
||||
# dynamic version
|
||||
case "${host_os}" in
|
||||
darwin[89]*) HISTORY_LIB='${HISTORY_LIBRARY}' ;;
|
||||
darwin[89]*|darwin10*) HISTORY_LIB='${HISTORY_LIBRARY}' ;;
|
||||
*) HISTORY_LIB=-lhistory ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
+11
-11
@@ -15,25 +15,25 @@
|
||||
'configure.in'
|
||||
],
|
||||
{
|
||||
'_LT_AC_TAGCONFIG' => 1,
|
||||
'AM_PROG_F77_C_O' => 1,
|
||||
'AC_INIT' => 1,
|
||||
'_LT_AC_TAGCONFIG' => 1,
|
||||
'm4_pattern_forbid' => 1,
|
||||
'_AM_COND_IF' => 1,
|
||||
'AC_INIT' => 1,
|
||||
'AC_CANONICAL_TARGET' => 1,
|
||||
'AC_SUBST' => 1,
|
||||
'_AM_COND_IF' => 1,
|
||||
'AC_CONFIG_LIBOBJ_DIR' => 1,
|
||||
'AC_FC_SRCEXT' => 1,
|
||||
'AC_SUBST' => 1,
|
||||
'AC_CANONICAL_HOST' => 1,
|
||||
'AC_FC_SRCEXT' => 1,
|
||||
'AC_PROG_LIBTOOL' => 1,
|
||||
'AM_INIT_AUTOMAKE' => 1,
|
||||
'AC_CONFIG_SUBDIRS' => 1,
|
||||
'AM_AUTOMAKE_VERSION' => 1,
|
||||
'LT_CONFIG_LTDL_DIR' => 1,
|
||||
'AC_REQUIRE_AUX_FILE' => 1,
|
||||
'AC_CONFIG_LINKS' => 1,
|
||||
'm4_sinclude' => 1,
|
||||
'AC_REQUIRE_AUX_FILE' => 1,
|
||||
'LT_SUPPORTED_TAG' => 1,
|
||||
'm4_sinclude' => 1,
|
||||
'AM_MAINTAINER_MODE' => 1,
|
||||
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
|
||||
'_m4_warn' => 1,
|
||||
@@ -49,13 +49,13 @@
|
||||
'AC_CANONICAL_BUILD' => 1,
|
||||
'AC_FC_FREEFORM' => 1,
|
||||
'AH_OUTPUT' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'AC_CONFIG_AUX_DIR' => 1,
|
||||
'sinclude' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'AM_PROG_CC_C_O' => 1,
|
||||
'AC_CANONICAL_SYSTEM' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'sinclude' => 1,
|
||||
'AM_CONDITIONAL' => 1,
|
||||
'AC_CANONICAL_SYSTEM' => 1,
|
||||
'AC_CONFIG_HEADERS' => 1,
|
||||
'AC_DEFINE_TRACE_LITERAL' => 1,
|
||||
'm4_include' => 1,
|
||||
|
||||
@@ -5827,7 +5827,7 @@ _ACEOF
|
||||
# static version specified as -llibname to override the
|
||||
# dynamic version
|
||||
case "${host_os}" in
|
||||
darwin[89]*) READLINE_LIB='${READLINE_LIBRARY}' ;;
|
||||
darwin[89]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;;
|
||||
*) READLINE_LIB=-lreadline ;;
|
||||
esac
|
||||
fi
|
||||
@@ -5868,7 +5868,7 @@ _ACEOF
|
||||
# static version specified as -llibname to override the
|
||||
# dynamic version
|
||||
case "${host_os}" in
|
||||
darwin[89]*) HISTORY_LIB='${HISTORY_LIBRARY}' ;;
|
||||
darwin[89]*|darwin10*) HISTORY_LIB='${HISTORY_LIBRARY}' ;;
|
||||
*) HISTORY_LIB=-lhistory ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
+2
-2
@@ -540,7 +540,7 @@ if test $opt_readline = yes; then
|
||||
# static version specified as -llibname to override the
|
||||
# dynamic version
|
||||
case "${host_os}" in
|
||||
darwin[[89]]*) READLINE_LIB='${READLINE_LIBRARY}' ;;
|
||||
darwin[[89]]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;;
|
||||
*) READLINE_LIB=-lreadline ;;
|
||||
esac
|
||||
fi
|
||||
@@ -575,7 +575,7 @@ if test $opt_history = yes || test $opt_bang_history = yes; then
|
||||
# static version specified as -llibname to override the
|
||||
# dynamic version
|
||||
case "${host_os}" in
|
||||
darwin[[89]]*) HISTORY_LIB='${HISTORY_LIBRARY}' ;;
|
||||
darwin[[89]]*|darwin10*) HISTORY_LIB='${HISTORY_LIBRARY}' ;;
|
||||
*) HISTORY_LIB=-lhistory ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
+25
-25
@@ -94,9 +94,9 @@ static int line_structures_initialized = 0;
|
||||
#define invisible_line (line_state_invisible->line)
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
static int _rl_col_width PARAMS((const char *, int, int));
|
||||
static int _rl_col_width PARAMS((const char *, int, int, int));
|
||||
#else
|
||||
# define _rl_col_width(l, s, e) (((e) <= (s)) ? 0 : (e) - (s))
|
||||
# define _rl_col_width(l, s, e, f) (((e) <= (s)) ? 0 : (e) - (s))
|
||||
#endif
|
||||
|
||||
/* Heuristic used to decide whether it is faster to move from CUR to NEW
|
||||
@@ -312,7 +312,7 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
|
||||
not be the same as the number of physical characters
|
||||
on the screen in the presence of multibyte characters */
|
||||
rl += ind - pind;
|
||||
physchars += _rl_col_width (pmt, pind, ind);
|
||||
physchars += _rl_col_width (pmt, pind, ind, 0);
|
||||
}
|
||||
else
|
||||
ninvis += ind - pind;
|
||||
@@ -688,7 +688,7 @@ rl_redisplay ()
|
||||
temp = local_prompt_len;
|
||||
while (num < temp)
|
||||
{
|
||||
z = _rl_col_width (local_prompt, n0, num);
|
||||
z = _rl_col_width (local_prompt, n0, num, 1);
|
||||
if (z > _rl_screenwidth)
|
||||
{
|
||||
num = _rl_find_prev_mbchar (local_prompt, num, MB_FIND_ANY);
|
||||
@@ -714,7 +714,7 @@ rl_redisplay ()
|
||||
inv_lbreaks[++newlines] = temp;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0)
|
||||
lpos -= _rl_col_width (local_prompt, n0, num);
|
||||
lpos -= _rl_col_width (local_prompt, n0, num, 1);
|
||||
else
|
||||
#endif
|
||||
lpos -= _rl_screenwidth;
|
||||
@@ -1087,7 +1087,7 @@ rl_redisplay ()
|
||||
|
||||
_rl_output_some_chars (local_prompt, nleft);
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
_rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft) - wrap_offset + modmark;
|
||||
_rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft, 1) - wrap_offset + modmark;
|
||||
else
|
||||
_rl_last_c_pos = nleft + modmark;
|
||||
}
|
||||
@@ -1111,7 +1111,7 @@ rl_redisplay ()
|
||||
{
|
||||
/* TX == new physical cursor position in multibyte locale. */
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
tx = _rl_col_width (&visible_line[pos], 0, nleft) - visible_wrap_offset;
|
||||
tx = _rl_col_width (&visible_line[pos], 0, nleft, 1) - visible_wrap_offset;
|
||||
else
|
||||
tx = nleft;
|
||||
if (tx >= 0 && _rl_last_c_pos > tx)
|
||||
@@ -1530,7 +1530,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
{
|
||||
/* We take wrap_offset into account here so we can pass correct
|
||||
information to _rl_move_cursor_relative. */
|
||||
_rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff) - wrap_offset + modmark;
|
||||
_rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff, 1) - wrap_offset + modmark;
|
||||
cpos_adjusted = 1;
|
||||
}
|
||||
else
|
||||
@@ -1561,7 +1561,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
When not using multibyte characters, these are equal */
|
||||
lendiff = (nls - nfd) - (ols - ofd);
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
col_lendiff = _rl_col_width (new, nfd - new, nls - new) - _rl_col_width (old, ofd - old, ols - old);
|
||||
col_lendiff = _rl_col_width (new, nfd - new, nls - new, 1) - _rl_col_width (old, ofd - old, ols - old, 1);
|
||||
else
|
||||
col_lendiff = lendiff;
|
||||
|
||||
@@ -1586,7 +1586,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
/* Insert (diff (len (old), len (new)) ch. */
|
||||
temp = ne - nfd;
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
col_temp = _rl_col_width (new, nfd - new, ne - new);
|
||||
col_temp = _rl_col_width (new, nfd - new, ne - new, 1);
|
||||
else
|
||||
col_temp = temp;
|
||||
|
||||
@@ -1603,7 +1603,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
if (lendiff < 0)
|
||||
{
|
||||
_rl_output_some_chars (nfd, temp);
|
||||
_rl_last_c_pos += _rl_col_width (nfd, 0, temp);
|
||||
_rl_last_c_pos += _rl_col_width (nfd, 0, temp, 1);
|
||||
/* If nfd begins before any invisible characters in the prompt,
|
||||
adjust _rl_last_c_pos to account for wrap_offset and set
|
||||
cpos_adjusted to let the caller know. */
|
||||
@@ -1681,7 +1681,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
multibyte characters and prompt strings with invisible
|
||||
characters, but was previously disabled. */
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
twidth = _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
|
||||
twidth = _rl_col_width (nfd+lendiff, 0, temp-col_lendiff, 1);
|
||||
else
|
||||
twidth = temp - lendiff;
|
||||
_rl_last_c_pos += twidth;
|
||||
@@ -1740,7 +1740,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
_rl_output_some_chars (nfd, temp);
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
{
|
||||
_rl_last_c_pos += _rl_col_width (nfd, 0, temp);
|
||||
_rl_last_c_pos += _rl_col_width (nfd, 0, temp, 1);
|
||||
if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
|
||||
{
|
||||
_rl_last_c_pos -= wrap_offset;
|
||||
@@ -1773,7 +1773,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
}
|
||||
lendiff = (oe - old) - (ne - new);
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
col_lendiff = _rl_col_width (old, 0, oe - old) - _rl_col_width (new, 0, ne - new);
|
||||
col_lendiff = _rl_col_width (old, 0, oe - old, 1) - _rl_col_width (new, 0, ne - new, 1);
|
||||
else
|
||||
col_lendiff = lendiff;
|
||||
|
||||
@@ -1840,7 +1840,7 @@ rl_on_new_line_with_prompt ()
|
||||
|
||||
l = strlen (prompt_last_line);
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
_rl_last_c_pos = _rl_col_width (prompt_last_line, 0, l); /* XXX */
|
||||
_rl_last_c_pos = _rl_col_width (prompt_last_line, 0, l, 1); /* XXX */
|
||||
else
|
||||
_rl_last_c_pos = l;
|
||||
|
||||
@@ -1924,19 +1924,19 @@ _rl_move_cursor_relative (new, data)
|
||||
/* 1. prompt string */
|
||||
if (new == local_prompt_len && memcmp (data, local_prompt, new) == 0)
|
||||
{
|
||||
dpos = prompt_visible_length;
|
||||
dpos = prompt_physical_chars;
|
||||
cpos_adjusted = 1;
|
||||
adjust = 0;
|
||||
}
|
||||
/* 2. prompt_string + line contents */
|
||||
else if (new > local_prompt_len && local_prompt && memcmp (data, local_prompt, local_prompt_len) == 0)
|
||||
{
|
||||
dpos = prompt_visible_length + _rl_col_width (data, local_prompt_len, new);
|
||||
dpos = prompt_physical_chars + _rl_col_width (data, local_prompt_len, new, 1);
|
||||
cpos_adjusted = 1;
|
||||
adjust = 0;
|
||||
}
|
||||
else
|
||||
dpos = _rl_col_width (data, 0, new);
|
||||
dpos = _rl_col_width (data, 0, new, 1);
|
||||
|
||||
/* Use NEW when comparing against the last invisible character in the
|
||||
prompt string, since they're both buffer indices and DPOS is a
|
||||
@@ -2588,9 +2588,9 @@ _rl_current_display_line ()
|
||||
In the case of multibyte characters with stateful encoding, we have to
|
||||
scan from the beginning of the string to take the state into account. */
|
||||
static int
|
||||
_rl_col_width (str, start, end)
|
||||
_rl_col_width (str, start, end, flags)
|
||||
const char *str;
|
||||
int start, end;
|
||||
int start, end, flags;
|
||||
{
|
||||
wchar_t wc;
|
||||
mbstate_t ps;
|
||||
@@ -2612,14 +2612,14 @@ _rl_ttymsg ("_rl_col_width: called with MB_CUR_MAX == 1");
|
||||
/* Try to short-circuit common cases. The adjustment to remove wrap_offset
|
||||
is done by the caller. */
|
||||
/* 1. prompt string */
|
||||
if (start == 0 && end == local_prompt_len && memcmp (str, local_prompt, local_prompt_len) == 0)
|
||||
return (prompt_visible_length + wrap_offset);
|
||||
if (flags && start == 0 && end == local_prompt_len && memcmp (str, local_prompt, local_prompt_len) == 0)
|
||||
return (prompt_physical_chars + wrap_offset);
|
||||
/* 2. prompt string + line contents */
|
||||
else if (start == 0 && end > local_prompt_len && local_prompt && memcmp (str, local_prompt, local_prompt_len) == 0)
|
||||
else if (flags && start == 0 && local_prompt_len > 0 && end > local_prompt_len && local_prompt && memcmp (str, local_prompt, local_prompt_len) == 0)
|
||||
{
|
||||
tmp = prompt_visible_length + wrap_offset;
|
||||
tmp = prompt_physical_chars + wrap_offset;
|
||||
/* XXX - try to call ourselves recursively with non-prompt portion */
|
||||
tmp += _rl_col_width (str, local_prompt_len, end);
|
||||
tmp += _rl_col_width (str, local_prompt_len, end, flags);
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+22
-24
@@ -94,9 +94,9 @@ static int line_structures_initialized = 0;
|
||||
#define invisible_line (line_state_invisible->line)
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
static int _rl_col_width PARAMS((const char *, int, int));
|
||||
static int _rl_col_width PARAMS((const char *, int, int, int));
|
||||
#else
|
||||
# define _rl_col_width(l, s, e) (((e) <= (s)) ? 0 : (e) - (s))
|
||||
# define _rl_col_width(l, s, e, f) (((e) <= (s)) ? 0 : (e) - (s))
|
||||
#endif
|
||||
|
||||
/* Heuristic used to decide whether it is faster to move from CUR to NEW
|
||||
@@ -312,7 +312,7 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
|
||||
not be the same as the number of physical characters
|
||||
on the screen in the presence of multibyte characters */
|
||||
rl += ind - pind;
|
||||
physchars += _rl_col_width (pmt, pind, ind);
|
||||
physchars += _rl_col_width (pmt, pind, ind, 0);
|
||||
}
|
||||
else
|
||||
ninvis += ind - pind;
|
||||
@@ -688,7 +688,7 @@ rl_redisplay ()
|
||||
temp = local_prompt_len;
|
||||
while (num < temp)
|
||||
{
|
||||
z = _rl_col_width (local_prompt, n0, num);
|
||||
z = _rl_col_width (local_prompt, n0, num, 1);
|
||||
if (z > _rl_screenwidth)
|
||||
{
|
||||
num = _rl_find_prev_mbchar (local_prompt, num, MB_FIND_ANY);
|
||||
@@ -714,7 +714,7 @@ rl_redisplay ()
|
||||
inv_lbreaks[++newlines] = temp;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0)
|
||||
lpos -= _rl_col_width (local_prompt, n0, num);
|
||||
lpos -= _rl_col_width (local_prompt, n0, num, 1);
|
||||
else
|
||||
#endif
|
||||
lpos -= _rl_screenwidth;
|
||||
@@ -1087,7 +1087,7 @@ rl_redisplay ()
|
||||
|
||||
_rl_output_some_chars (local_prompt, nleft);
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
_rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft) - wrap_offset + modmark;
|
||||
_rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft, 1) - wrap_offset + modmark;
|
||||
else
|
||||
_rl_last_c_pos = nleft + modmark;
|
||||
}
|
||||
@@ -1111,7 +1111,7 @@ rl_redisplay ()
|
||||
{
|
||||
/* TX == new physical cursor position in multibyte locale. */
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
tx = _rl_col_width (&visible_line[pos], 0, nleft) - visible_wrap_offset;
|
||||
tx = _rl_col_width (&visible_line[pos], 0, nleft, 1) - visible_wrap_offset;
|
||||
else
|
||||
tx = nleft;
|
||||
if (tx >= 0 && _rl_last_c_pos > tx)
|
||||
@@ -1333,12 +1333,10 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
ret = 1;
|
||||
memmove (old+bytes, old+ret, strlen (old+ret));
|
||||
memcpy (old, new, bytes);
|
||||
#if 0
|
||||
/* Fix up indices if we copy data from one line to another */
|
||||
omax += bytes - ret;
|
||||
for (i = current_line+1; i < inv_botlin+1; i++)
|
||||
vis_lbreaks[i] += bytes - ret;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1532,7 +1530,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
{
|
||||
/* We take wrap_offset into account here so we can pass correct
|
||||
information to _rl_move_cursor_relative. */
|
||||
_rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff) - wrap_offset + modmark;
|
||||
_rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff, 1) - wrap_offset + modmark;
|
||||
cpos_adjusted = 1;
|
||||
}
|
||||
else
|
||||
@@ -1563,7 +1561,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
When not using multibyte characters, these are equal */
|
||||
lendiff = (nls - nfd) - (ols - ofd);
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
col_lendiff = _rl_col_width (new, nfd - new, nls - new) - _rl_col_width (old, ofd - old, ols - old);
|
||||
col_lendiff = _rl_col_width (new, nfd - new, nls - new, 1) - _rl_col_width (old, ofd - old, ols - old, 1);
|
||||
else
|
||||
col_lendiff = lendiff;
|
||||
|
||||
@@ -1588,7 +1586,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
/* Insert (diff (len (old), len (new)) ch. */
|
||||
temp = ne - nfd;
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
col_temp = _rl_col_width (new, nfd - new, ne - new);
|
||||
col_temp = _rl_col_width (new, nfd - new, ne - new, 1);
|
||||
else
|
||||
col_temp = temp;
|
||||
|
||||
@@ -1605,7 +1603,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
if (lendiff < 0)
|
||||
{
|
||||
_rl_output_some_chars (nfd, temp);
|
||||
_rl_last_c_pos += _rl_col_width (nfd, 0, temp);
|
||||
_rl_last_c_pos += _rl_col_width (nfd, 0, temp, 1);
|
||||
/* If nfd begins before any invisible characters in the prompt,
|
||||
adjust _rl_last_c_pos to account for wrap_offset and set
|
||||
cpos_adjusted to let the caller know. */
|
||||
@@ -1683,7 +1681,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
multibyte characters and prompt strings with invisible
|
||||
characters, but was previously disabled. */
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
twidth = _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
|
||||
twidth = _rl_col_width (nfd+lendiff, 0, temp-col_lendiff, 1);
|
||||
else
|
||||
twidth = temp - lendiff;
|
||||
_rl_last_c_pos += twidth;
|
||||
@@ -1742,7 +1740,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
_rl_output_some_chars (nfd, temp);
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
{
|
||||
_rl_last_c_pos += _rl_col_width (nfd, 0, temp);
|
||||
_rl_last_c_pos += _rl_col_width (nfd, 0, temp, 1);
|
||||
if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
|
||||
{
|
||||
_rl_last_c_pos -= wrap_offset;
|
||||
@@ -1775,7 +1773,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
}
|
||||
lendiff = (oe - old) - (ne - new);
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
col_lendiff = _rl_col_width (old, 0, oe - old) - _rl_col_width (new, 0, ne - new);
|
||||
col_lendiff = _rl_col_width (old, 0, oe - old, 1) - _rl_col_width (new, 0, ne - new, 1);
|
||||
else
|
||||
col_lendiff = lendiff;
|
||||
|
||||
@@ -1842,7 +1840,7 @@ rl_on_new_line_with_prompt ()
|
||||
|
||||
l = strlen (prompt_last_line);
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
_rl_last_c_pos = _rl_col_width (prompt_last_line, 0, l); /* XXX */
|
||||
_rl_last_c_pos = _rl_col_width (prompt_last_line, 0, l, 1); /* XXX */
|
||||
else
|
||||
_rl_last_c_pos = l;
|
||||
|
||||
@@ -1933,12 +1931,12 @@ _rl_move_cursor_relative (new, data)
|
||||
/* 2. prompt_string + line contents */
|
||||
else if (new > local_prompt_len && local_prompt && memcmp (data, local_prompt, local_prompt_len) == 0)
|
||||
{
|
||||
dpos = prompt_visible_length + _rl_col_width (data, local_prompt_len, new);
|
||||
dpos = prompt_visible_length + _rl_col_width (data, local_prompt_len, new, 1);
|
||||
cpos_adjusted = 1;
|
||||
adjust = 0;
|
||||
}
|
||||
else
|
||||
dpos = _rl_col_width (data, 0, new);
|
||||
dpos = _rl_col_width (data, 0, new, 1);
|
||||
|
||||
/* Use NEW when comparing against the last invisible character in the
|
||||
prompt string, since they're both buffer indices and DPOS is a
|
||||
@@ -2590,9 +2588,9 @@ _rl_current_display_line ()
|
||||
In the case of multibyte characters with stateful encoding, we have to
|
||||
scan from the beginning of the string to take the state into account. */
|
||||
static int
|
||||
_rl_col_width (str, start, end)
|
||||
_rl_col_width (str, start, end, flags)
|
||||
const char *str;
|
||||
int start, end;
|
||||
int start, end, flags;
|
||||
{
|
||||
wchar_t wc;
|
||||
mbstate_t ps;
|
||||
@@ -2614,14 +2612,14 @@ _rl_ttymsg ("_rl_col_width: called with MB_CUR_MAX == 1");
|
||||
/* Try to short-circuit common cases. The adjustment to remove wrap_offset
|
||||
is done by the caller. */
|
||||
/* 1. prompt string */
|
||||
if (start == 0 && end == local_prompt_len && memcmp (str, local_prompt, local_prompt_len) == 0)
|
||||
if (flags && start == 0 && end == local_prompt_len && memcmp (str, local_prompt, local_prompt_len) == 0)
|
||||
return (prompt_visible_length + wrap_offset);
|
||||
/* 2. prompt string + line contents */
|
||||
else if (start == 0 && end > local_prompt_len && local_prompt && memcmp (str, local_prompt, local_prompt_len) == 0)
|
||||
else if (flags && start == 0 && local_prompt_len > 0 && end > local_prompt_len && local_prompt && memcmp (str, local_prompt, local_prompt_len) == 0)
|
||||
{
|
||||
tmp = prompt_visible_length + wrap_offset;
|
||||
/* XXX - try to call ourselves recursively with non-prompt portion */
|
||||
tmp += _rl_col_width (str, local_prompt_len, end);
|
||||
tmp += _rl_col_width (str, local_prompt_len, end, flags);
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
|
||||
+8
-3
@@ -100,6 +100,7 @@ fnx_tofs (string, len)
|
||||
#ifdef MACOSX
|
||||
ICONV_CONST char *inbuf;
|
||||
char *tempbuf;
|
||||
size_t templen;
|
||||
|
||||
if (conv_tofs == (iconv_t)-1)
|
||||
init_tofs ();
|
||||
@@ -121,10 +122,11 @@ fnx_tofs (string, len)
|
||||
outbuf = outbuf ? xrealloc (outbuf, outlen + 1) : xmalloc (outlen + 1);
|
||||
}
|
||||
tempbuf = outbuf;
|
||||
templen = outlen;
|
||||
|
||||
iconv (conv_tofs, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (iconv (conv_tofs, &inbuf, &len, &tempbuf, &outlen) == (size_t)-1)
|
||||
if (iconv (conv_tofs, &inbuf, &len, &tempbuf, &templen) == (size_t)-1)
|
||||
return string;
|
||||
|
||||
*tempbuf = '\0';
|
||||
@@ -142,6 +144,7 @@ fnx_fromfs (string, len)
|
||||
#ifdef MACOSX
|
||||
ICONV_CONST char *inbuf;
|
||||
char *tempbuf;
|
||||
size_t templen;
|
||||
|
||||
if (conv_fromfs == (iconv_t)-1)
|
||||
init_fromfs ();
|
||||
@@ -157,16 +160,17 @@ fnx_fromfs (string, len)
|
||||
}
|
||||
|
||||
inbuf = string;
|
||||
if (outbuf == 0 || outlen < len + 8)
|
||||
if (outbuf == 0 || outlen < (len + 8))
|
||||
{
|
||||
outlen = len + 8;
|
||||
outbuf = outbuf ? xrealloc (outbuf, outlen + 1) : xmalloc (outlen + 1);
|
||||
}
|
||||
tempbuf = outbuf;
|
||||
templen = outlen;
|
||||
|
||||
iconv (conv_fromfs, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (iconv (conv_fromfs, &inbuf, &len, &tempbuf, &outlen) == (size_t)-1)
|
||||
if (iconv (conv_fromfs, &inbuf, &len, &tempbuf, &templen) == (size_t)-1)
|
||||
return string;
|
||||
|
||||
*tempbuf = '\0';
|
||||
@@ -181,6 +185,7 @@ char *
|
||||
fnx_tofs (string)
|
||||
char *string;
|
||||
{
|
||||
bar
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
+28
-3
@@ -42,6 +42,8 @@ extern const char *locale_charset __P((void));
|
||||
static iconv_t conv_fromfs = (iconv_t)-1;
|
||||
static iconv_t conv_tofs = (iconv_t)-1;
|
||||
|
||||
#define OUTLEN_MAX 4096
|
||||
|
||||
static char *outbuf = 0;
|
||||
static size_t outlen = 0;
|
||||
|
||||
@@ -98,12 +100,21 @@ fnx_tofs (string, len)
|
||||
#ifdef MACOSX
|
||||
ICONV_CONST char *inbuf;
|
||||
char *tempbuf;
|
||||
size_t templen;
|
||||
|
||||
if (conv_tofs == (iconv_t)-1)
|
||||
init_tofs ();
|
||||
if (conv_tofs == (iconv_t)-1)
|
||||
return string;
|
||||
|
||||
/* Free and reallocate outbuf if it's *too* big */
|
||||
if (outlen >= OUTLEN_MAX && len < OUTLEN_MAX - 8)
|
||||
{
|
||||
free (outbuf);
|
||||
outbuf = 0;
|
||||
outlen = 0;
|
||||
}
|
||||
|
||||
inbuf = string;
|
||||
if (outbuf == 0 || outlen < len + 8)
|
||||
{
|
||||
@@ -111,10 +122,11 @@ fnx_tofs (string, len)
|
||||
outbuf = outbuf ? xrealloc (outbuf, outlen + 1) : xmalloc (outlen + 1);
|
||||
}
|
||||
tempbuf = outbuf;
|
||||
templen = outlen;
|
||||
|
||||
iconv (conv_tofs, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (iconv (conv_tofs, &inbuf, &len, &tempbuf, &outlen) == (size_t)-1)
|
||||
if (iconv (conv_tofs, &inbuf, &len, &tempbuf, &templen) == (size_t)-1)
|
||||
return string;
|
||||
|
||||
*tempbuf = '\0';
|
||||
@@ -132,23 +144,35 @@ fnx_fromfs (string, len)
|
||||
#ifdef MACOSX
|
||||
ICONV_CONST char *inbuf;
|
||||
char *tempbuf;
|
||||
size_t templen;
|
||||
|
||||
if (conv_fromfs == (iconv_t)-1)
|
||||
init_fromfs ();
|
||||
if (conv_fromfs == (iconv_t)-1)
|
||||
return string;
|
||||
|
||||
itrace("fnx_fromfs: outlen = %d after init_fromfs", outlen);
|
||||
/* Free and reallocate outbuf if it's *too* big */
|
||||
if (outlen >= OUTLEN_MAX && len < OUTLEN_MAX - 8)
|
||||
{
|
||||
free (outbuf);
|
||||
outbuf = 0;
|
||||
outlen = 0;
|
||||
}
|
||||
|
||||
inbuf = string;
|
||||
if (outbuf == 0 || outlen < len + 8)
|
||||
if (outbuf == 0 || outlen < (len + 8))
|
||||
{
|
||||
outlen = len + 8;
|
||||
outbuf = outbuf ? xrealloc (outbuf, outlen + 1) : xmalloc (outlen + 1);
|
||||
itrace("fnx_fromfs: increased outlen to %d", outlen);
|
||||
}
|
||||
tempbuf = outbuf;
|
||||
templen = outlen;
|
||||
|
||||
iconv (conv_fromfs, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (iconv (conv_fromfs, &inbuf, &len, &tempbuf, &outlen) == (size_t)-1)
|
||||
if (iconv (conv_fromfs, &inbuf, &len, &tempbuf, &templen) == (size_t)-1)
|
||||
return string;
|
||||
|
||||
*tempbuf = '\0';
|
||||
@@ -163,6 +187,7 @@ char *
|
||||
fnx_tofs (string)
|
||||
char *string;
|
||||
{
|
||||
bar
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -61,7 +61,8 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG)
|
||||
/* GCC 4.2 on Snow Leopard doesn't like the snprintf prototype */
|
||||
#if defined(DEBUG) && !defined (MACOSX)
|
||||
# undef HAVE_SNPRINTF
|
||||
# undef HAVE_ASPRINTF
|
||||
#endif
|
||||
|
||||
+2163
File diff suppressed because it is too large
Load Diff
@@ -5083,6 +5083,13 @@ decode_prompt_string (string)
|
||||
}
|
||||
t_string[tlen] = '\0';
|
||||
|
||||
#if defined (MACOSX)
|
||||
/* Convert from "fs" format to "input" format */
|
||||
temp = fnx_fromfs (t_string, strlen (t_string));
|
||||
if (temp != t_string)
|
||||
strcpy (t_string, temp);
|
||||
#endif
|
||||
|
||||
#define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0)
|
||||
#define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0)
|
||||
/* Abbreviate \W as ~ if $PWD == $HOME */
|
||||
|
||||
@@ -333,7 +333,7 @@ static REDIRECTEE redir;
|
||||
%token IN BANG TIME TIMEOPT
|
||||
|
||||
/* More general tokens. yylex () knows how to make these. */
|
||||
%token <word> WORD ASSIGNMENT_WORD
|
||||
%token <word> WORD ASSIGNMENT_WORD REDIR_WORD
|
||||
%token <number> NUMBER
|
||||
%token <word_list> ARITH_CMD ARITH_FOR_EXPRS
|
||||
%token <command> COND_CMD
|
||||
@@ -442,6 +442,18 @@ redirection: '>' WORD
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_input_direction, redir, 0);
|
||||
}
|
||||
| REDIR_WORD '>' WORD
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_output_direction, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| REDIR_WORD '<' WORD
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_input_direction, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| GREATER_GREATER WORD
|
||||
{
|
||||
source.dest = 1;
|
||||
@@ -454,6 +466,48 @@ redirection: '>' WORD
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_appending_to, redir, 0);
|
||||
}
|
||||
| REDIR_WORD GREATER_GREATER WORD
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_appending_to, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| GREATER_BAR WORD
|
||||
{
|
||||
source.dest = 1;
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_output_force, redir, 0);
|
||||
}
|
||||
| NUMBER GREATER_BAR WORD
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_output_force, redir, 0);
|
||||
}
|
||||
| REDIR_WORD GREATER_BAR WORD
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_output_force, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| LESS_GREATER WORD
|
||||
{
|
||||
source.dest = 0;
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_input_output, redir, 0);
|
||||
}
|
||||
| NUMBER LESS_GREATER WORD
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_input_output, redir, 0);
|
||||
}
|
||||
| REDIR_WORD LESS_GREATER WORD
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_input_output, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| LESS_LESS WORD
|
||||
{
|
||||
source.dest = 0;
|
||||
@@ -468,65 +522,12 @@ redirection: '>' WORD
|
||||
$$ = make_redirection (source, r_reading_until, redir, 0);
|
||||
redir_stack[need_here_doc++] = $$;
|
||||
}
|
||||
| LESS_LESS_LESS WORD
|
||||
| REDIR_WORD LESS_LESS WORD
|
||||
{
|
||||
source.dest = 0;
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_reading_string, redir, 0);
|
||||
}
|
||||
| NUMBER LESS_LESS_LESS WORD
|
||||
{
|
||||
source.dest = $1;
|
||||
source.filename = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_reading_string, redir, 0);
|
||||
}
|
||||
| LESS_AND NUMBER
|
||||
{
|
||||
source.dest = 0;
|
||||
redir.dest = $2;
|
||||
$$ = make_redirection (source, r_duplicating_input, redir, 0);
|
||||
}
|
||||
| NUMBER LESS_AND NUMBER
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.dest = $3;
|
||||
$$ = make_redirection (source, r_duplicating_input, redir, 0);
|
||||
}
|
||||
| GREATER_AND NUMBER
|
||||
{
|
||||
source.dest = 1;
|
||||
redir.dest = $2;
|
||||
$$ = make_redirection (source, r_duplicating_output, redir, 0);
|
||||
}
|
||||
| NUMBER GREATER_AND NUMBER
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.dest = $3;
|
||||
$$ = make_redirection (source, r_duplicating_output, redir, 0);
|
||||
}
|
||||
| LESS_AND WORD
|
||||
{
|
||||
source.dest = 0;
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_duplicating_input_word, redir, 0);
|
||||
}
|
||||
| NUMBER LESS_AND WORD
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_duplicating_input_word, redir, 0);
|
||||
}
|
||||
| GREATER_AND WORD
|
||||
{
|
||||
source.dest = 1;
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_duplicating_output_word, redir, 0);
|
||||
}
|
||||
| NUMBER GREATER_AND WORD
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_duplicating_output_word, redir, 0);
|
||||
$$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
|
||||
redir_stack[need_here_doc++] = $$;
|
||||
}
|
||||
| LESS_LESS_MINUS WORD
|
||||
{
|
||||
@@ -542,6 +543,103 @@ redirection: '>' WORD
|
||||
$$ = make_redirection (source, r_deblank_reading_until, redir, 0);
|
||||
redir_stack[need_here_doc++] = $$;
|
||||
}
|
||||
| REDIR_WORD LESS_LESS_MINUS WORD
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
|
||||
redir_stack[need_here_doc++] = $$;
|
||||
}
|
||||
| LESS_LESS_LESS WORD
|
||||
{
|
||||
source.dest = 0;
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_reading_string, redir, 0);
|
||||
}
|
||||
| NUMBER LESS_LESS_LESS WORD
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_reading_string, redir, 0);
|
||||
}
|
||||
| REDIR_WORD LESS_LESS_LESS WORD
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_reading_string, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| LESS_AND NUMBER
|
||||
{
|
||||
source.dest = 0;
|
||||
redir.dest = $2;
|
||||
$$ = make_redirection (source, r_duplicating_input, redir, 0);
|
||||
}
|
||||
| NUMBER LESS_AND NUMBER
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.dest = $3;
|
||||
$$ = make_redirection (source, r_duplicating_input, redir, 0);
|
||||
}
|
||||
| REDIR_WORD LESS_AND NUMBER
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.dest = $3;
|
||||
$$ = make_redirection (source, r_duplicating_input, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| GREATER_AND NUMBER
|
||||
{
|
||||
source.dest = 1;
|
||||
redir.dest = $2;
|
||||
$$ = make_redirection (source, r_duplicating_output, redir, 0);
|
||||
}
|
||||
| NUMBER GREATER_AND NUMBER
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.dest = $3;
|
||||
$$ = make_redirection (source, r_duplicating_output, redir, 0);
|
||||
}
|
||||
| REDIR_WORD GREATER_AND NUMBER
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.dest = $3;
|
||||
$$ = make_redirection (source, r_duplicating_output, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| LESS_AND WORD
|
||||
{
|
||||
source.dest = 0;
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_duplicating_input_word, redir, 0);
|
||||
}
|
||||
| NUMBER LESS_AND WORD
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_duplicating_input_word, redir, 0);
|
||||
}
|
||||
| REDIR_WORD LESS_AND WORD
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_duplicating_input_word, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| GREATER_AND WORD
|
||||
{
|
||||
source.dest = 1;
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_duplicating_output_word, redir, 0);
|
||||
}
|
||||
| NUMBER GREATER_AND WORD
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_duplicating_output_word, redir, 0);
|
||||
}
|
||||
| REDIR_WORD GREATER_AND WORD
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_duplicating_output_word, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| GREATER_AND '-'
|
||||
{
|
||||
source.dest = 1;
|
||||
@@ -554,6 +652,12 @@ redirection: '>' WORD
|
||||
redir.dest = 0;
|
||||
$$ = make_redirection (source, r_close_this, redir, 0);
|
||||
}
|
||||
| REDIR_WORD GREATER_AND '-'
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.dest = 0;
|
||||
$$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| LESS_AND '-'
|
||||
{
|
||||
source.dest = 0;
|
||||
@@ -566,6 +670,12 @@ redirection: '>' WORD
|
||||
redir.dest = 0;
|
||||
$$ = make_redirection (source, r_close_this, redir, 0);
|
||||
}
|
||||
| REDIR_WORD LESS_AND '-'
|
||||
{
|
||||
source.filename = $1;
|
||||
redir.dest = 0;
|
||||
$$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN);
|
||||
}
|
||||
| AND_GREATER WORD
|
||||
{
|
||||
source.dest = 1;
|
||||
@@ -578,30 +688,6 @@ redirection: '>' WORD
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_append_err_and_out, redir, 0);
|
||||
}
|
||||
| NUMBER LESS_GREATER WORD
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_input_output, redir, 0);
|
||||
}
|
||||
| LESS_GREATER WORD
|
||||
{
|
||||
source.dest = 0;
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_input_output, redir, 0);
|
||||
}
|
||||
| GREATER_BAR WORD
|
||||
{
|
||||
source.dest = 1;
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_output_force, redir, 0);
|
||||
}
|
||||
| NUMBER GREATER_BAR WORD
|
||||
{
|
||||
source.dest = $1;
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_output_force, redir, 0);
|
||||
}
|
||||
;
|
||||
|
||||
simple_command_element: WORD
|
||||
@@ -4511,6 +4597,19 @@ got_token:
|
||||
|
||||
yylval.word = the_word;
|
||||
|
||||
if (token[0] == '{' && token[token_index-1] == '}' &&
|
||||
(character == '<' || character == '>'))
|
||||
{
|
||||
/* can use token; already copied to the_word */
|
||||
token[token_index-1] = '\0';
|
||||
if (legal_identifier (token+1))
|
||||
{
|
||||
strcpy (the_word->word, token+1);
|
||||
/*itrace("read_token_word: returning REDIR_WORD for %s", the_word->word);*/
|
||||
return (REDIR_WORD);
|
||||
}
|
||||
}
|
||||
|
||||
result = ((the_word->flags & (W_ASSIGNMENT|W_NOSPLIT)) == (W_ASSIGNMENT|W_NOSPLIT))
|
||||
? ASSIGNMENT_WORD : WORD;
|
||||
|
||||
@@ -4984,6 +5083,11 @@ decode_prompt_string (string)
|
||||
}
|
||||
t_string[tlen] = '\0';
|
||||
|
||||
#if defined (MACOSX)
|
||||
temp = fnx_fromfs (t_string, tlen);
|
||||
if (temp != t_string)
|
||||
strcpy (t_string, temp);
|
||||
#endif
|
||||
#define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0)
|
||||
#define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0)
|
||||
/* Abbreviate \W as ~ if $PWD == $HOME */
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
# Set of available languages.
|
||||
en@quot en@boldquot af bg ca cs de eo es et fi fr hu id ja lt nl pl pt_BR ro ru sk sv tr vi zh_TW
|
||||
en@quot en@boldquot af bg ca cs de eo es et fi fr ga hu id ja lt nl pl pt_BR ro ru sk sv tr vi zh_TW
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
# Set of available languages.
|
||||
en@quot en@boldquot af bg ca cs de eo es et fr hu id ja lt nl pl pt_BR ro ru sk sv tr vi zh_TW
|
||||
en@quot en@boldquot af bg ca cs de eo es et fi fr hu id ja lt nl pl pt_BR ro ru sk sv tr vi zh_TW
|
||||
|
||||
@@ -13,7 +13,7 @@ msgstr ""
|
||||
"Project-Id-Version: bash 4.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2009-02-19 14:53-0500\n"
|
||||
"PO-Revision-Date: 2009-03-19 09:21+0100\n"
|
||||
"PO-Revision-Date: 2009-09-23 14:23+0200\n"
|
||||
"Last-Translator: Petr Pisar <petr.pisar@atlas.cz>\n"
|
||||
"Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -1028,19 +1028,20 @@ msgstr "describe_pid: %ld: žádný takový PID"
|
||||
msgid "Signal %d"
|
||||
msgstr "Signál %d"
|
||||
|
||||
# FIXME: rod a zkontrolovat následující
|
||||
# XXX: (úloha) dokončna. Používat ženský rod i unásledujících. Jedná se
|
||||
# o výpis úloh.
|
||||
#: jobs.c:1430 jobs.c:1455
|
||||
msgid "Done"
|
||||
msgstr "Dokonán"
|
||||
msgstr "Dokončena"
|
||||
|
||||
#: jobs.c:1435 siglist.c:122
|
||||
msgid "Stopped"
|
||||
msgstr "Pozastaven"
|
||||
msgstr "Pozastavena"
|
||||
|
||||
#: jobs.c:1439
|
||||
#, c-format
|
||||
msgid "Stopped(%s)"
|
||||
msgstr "Pozastaven (%s)"
|
||||
msgstr "Pozastavena (%s)"
|
||||
|
||||
#: jobs.c:1443
|
||||
msgid "Running"
|
||||
@@ -1049,12 +1050,12 @@ msgstr "Běží"
|
||||
#: jobs.c:1457
|
||||
#, c-format
|
||||
msgid "Done(%d)"
|
||||
msgstr "Dokonán (%d)"
|
||||
msgstr "Dokončena (%d)"
|
||||
|
||||
#: jobs.c:1459
|
||||
#, c-format
|
||||
msgid "Exit %d"
|
||||
msgstr "Ukončen %d"
|
||||
msgstr "Ukončena %d"
|
||||
|
||||
#: jobs.c:1462
|
||||
msgid "Unknown status"
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
@@ -26,3 +26,31 @@
|
||||
+ x=i
|
||||
+ case x in
|
||||
+ x=i
|
||||
+ set +x
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
+ for f in a b c d e
|
||||
+ echo a
|
||||
a
|
||||
+ for f in a b c d e
|
||||
+ echo b
|
||||
b
|
||||
+ for f in a b c d e
|
||||
+ echo c
|
||||
c
|
||||
+ for f in a b c d e
|
||||
+ echo d
|
||||
d
|
||||
+ for f in a b c d e
|
||||
+ echo e
|
||||
e
|
||||
+ set +x
|
||||
TRACEFILE:
|
||||
+ echo 1
|
||||
+ echo 2
|
||||
+ echo 3
|
||||
+ echo 4
|
||||
+ unset BASH_XTRACEFD
|
||||
=====
|
||||
|
||||
+3
-4
@@ -14,8 +14,7 @@ case x in
|
||||
0) x=i ;;
|
||||
*) x=i ;;
|
||||
esac
|
||||
set +x
|
||||
|
||||
#;;; Local Variables: ***
|
||||
#;;; mode:shell-script ***
|
||||
#;;; eval: (sh-set-shell "bash") ***
|
||||
#;;; End: ***
|
||||
# test BASH_XTRACEFD
|
||||
${THIS_SH} ./set-x1.sub
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
: ${TMPDIR:=/var/tmp}
|
||||
TRACEFILE=$TMPDIR/bash-trace-$$
|
||||
trap 'rm -f $TRACEFILE' 0 1 2 3 6 15
|
||||
|
||||
exec 4>$TRACEFILE
|
||||
BASH_XTRACEFD=4
|
||||
|
||||
set -x
|
||||
|
||||
echo 1
|
||||
echo 2
|
||||
echo 3
|
||||
echo 4
|
||||
|
||||
unset BASH_XTRACEFD
|
||||
|
||||
for f in a b c d e; do echo $f ; done
|
||||
|
||||
set +x
|
||||
|
||||
echo TRACEFILE:
|
||||
cat $TRACEFILE
|
||||
echo =====
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user