commit bash-20151211 snapshot

This commit is contained in:
Chet Ramey
2015-12-21 10:40:25 -05:00
parent 967625cd5b
commit 3f2135aaac
12 changed files with 1652 additions and 599 deletions
+35
View File
@@ -10118,3 +10118,38 @@ subst.c
process should not have access to any temporary environment the
parent has. Call flush_tempenv() in the child process to get rid
of it. Fix for bug reported by Clint Hepner <clint.hepner@gmail.com>
12/9
----
jobs.c
- waitchld: if in posix mode and attempting to let SIGCHLD interrupt the
wait builtin, make sure wait_intr_flag is non-zero before trying to
longjmp to wait_intr_buf. Fixes bug reported by Aharon Robbins
<arnold@skeeve.com>
12/10
-----
lib/readline/display.c
- update_line: if a prompt containing invisible characters changes,
and the change is within the prompt string, we need to redraw the
entire prompt. After that redraw, if the cursor position is after
the first index where the old and new lines differ, we can short-
circuit the update if the line length stays the same
- update_line: if we redraw the entire prompt string because the prompt
contains invisible characters and the first difference is in the
middle of the prompt, we possibly need to adjust our idea of the
first differing character in the old and new lines. We punt and do
a dumb update in this case. Fixes bug with dynamic vi-mode mode
strings containing invisible characters reported by Dylan Cali
<calid1984@gmail.com>
12/11
-----
lib/readline/display.c
- update_line: if we move up to a new screen line, we need to recompute
the number of invisible characters on the new current line
(visible_wrap_offset). Fixes bug reported to bug-readline by
Per Bothner <per@bothner.com>
- update_line: update code that attempts to compute where we are in
the new line buffer. Fixes `vt100' bug reported to bug-readline by
Per Bothner <per@bothner.com>
+1
View File
@@ -1281,6 +1281,7 @@ tests/varenv4.sub f
tests/varenv5.sub f
tests/varenv6.sub f
tests/varenv7.sub f
tests/varenv8.sub f
tests/version f
tests/version.mini f
tests/vredir.tests f
BIN
View File
Binary file not shown.
+39 -11
View File
@@ -1,9 +1,10 @@
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/MacPorts 2015_7) (preloaded format=etex 2015.7.15) 3 DEC 2015 13:54
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/MacPorts 2015_7) (preloaded format=pdfetex 2015.7.15) 6 DEC 2015 17:57
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**\input /usr/homes/chet/src/bash/src/doc/bashref.texi
**\catcode126=12 \def\normaltilde{~}\catcode126=13 \let~\normaltilde \input /u
sr/homes/chet/src/bash/src/doc/bashref.texi
(/usr/homes/chet/src/bash/src/doc/bashref.texi
(/opt/local/share/texmf/tex/texinfo/texinfo.tex
Loading texinfo [version 2015-06-24.23]:
@@ -181,11 +182,13 @@ texinfo.tex: doing @include of version.texi
\openout9 = `bashref.rw'.
] [2] (./bashref.toc [-1] [-2] [-3])
[-4] Chapter 1
{/opt/local/var/db/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] (./bashref.to
c [-1] [-2] [-3]) [-4] (./bashref.toc)
(./bashref.toc) Chapter 1
\openout0 = `bashref.toc'.
Chapter 2 [1] [2] [3] Chapter 3 [4] [5] [6] [7] [8] [9] [10]
Chapter 2 [1] [2] [3] Chapter 3 [4] [5] [6] [7]
[8] [9] [10]
Overfull \hbox (38.26587pt too wide) in paragraph at lines 872--872
[]@texttt case @textttsl word @texttt in [ [(] @textttsl pat-tern @texttt [| @
textttsl pattern@texttt ][]) @textttsl command-list @texttt ;;][] esac[]
@@ -401,16 +404,41 @@ Overfull \vbox (3.80977pt too high) has occurred while \output is active
..\smalltt e
..\smalltt p
..etc.
.\mark{\gdef \thischaptername {Indexes}\gdef \thischapternum {D}\gdef \thischap
ter \ETC.}
.\mark{\gdef \thischaptername {Indexes}\gdef \thischapternum {D}\gdef \thischap
ter \ETC.}
[166] [167]) (./bashref.cps [168] [169]) [170] )
Here is how much of TeX's memory you used:
3039 strings out of 497120
36111 string characters out of 6207257
88244 words of memory out of 5000000
4187 multiletter control sequences out of 15000+600000
3577 strings out of 497110
43094 string characters out of 6206872
157665 words of memory out of 5000000
4352 multiletter control sequences out of 15000+600000
32896 words of font info for 113 fonts, out of 8000000 for 9000
51 hyphenation exceptions out of 8191
16i,6n,16p,326b,871s stack positions out of 5000i,500n,10000p,200000b,80000s
16i,6n,16p,394b,970s stack positions out of 5000i,500n,10000p,200000b,80000s
{/opt/local/share/texmf-texlive
/fonts/enc/dvips/cm-super/cm-super-t1.enc}</opt/local/share/texmf-texlive/fonts
/type1/public/amsfonts/cm/cmbx12.pfb></opt/local/share/texmf-texlive/fonts/type
1/public/amsfonts/cm/cmcsc10.pfb></opt/local/share/texmf-texlive/fonts/type1/pu
blic/amsfonts/cm/cmmi10.pfb></opt/local/share/texmf-texlive/fonts/type1/public/
amsfonts/cm/cmmi12.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfo
nts/cm/cmmi9.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm
/cmr10.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr9.
pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsl10.pfb><
/opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsltt10.pfb></op
t/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsy10.pfb></opt/loc
al/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmti10.pfb></opt/local/sh
are/texmf-texlive/fonts/type1/public/amsfonts/cm/cmtt10.pfb></opt/local/share/t
exmf-texlive/fonts/type1/public/amsfonts/cm/cmtt12.pfb></opt/local/share/texmf-
texlive/fonts/type1/public/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texliv
e/fonts/type1/public/cm-super/sfrm1095.pfb>
Output written on bashref.pdf (176 pages, 728717 bytes).
PDF statistics:
2563 PDF objects out of 2984 (max. 8388607)
2343 compressed objects within 24 object streams
302 named destinations out of 1000 (max. 500000)
1125 words of extra memory for PDF output out of 10000 (max. 10000000)
Output written on bashref.dvi (176 pages, 739900 bytes).
BIN
View File
Binary file not shown.
+1483 -583
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -2460,7 +2460,7 @@ wait_sigint_handler (sig)
{
trap_handler (SIGINT); /* set pending_traps[SIGINT] */
wait_signal_received = SIGINT;
if (interrupt_immediately)
if (interrupt_immediately && wait_intr_flag)
{
interrupt_immediately = 0;
sh_longjmp (wait_intr_buf, 1);
@@ -3565,6 +3565,7 @@ itrace("waitchld: waitpid returns %d block = %d children_exited = %d", pid, bloc
{
if (posixly_correct && this_shell_builtin && this_shell_builtin == wait_builtin)
{
itrace("waitchld: this_shell_builtin == wait_builtin got %d children wait_intr_flag = %d", children_exited, wait_intr_flag);
interrupt_immediately = 0;
/* This was trap_handler (SIGCHLD) but that can lose traps if
children_exited > 1 */
@@ -3572,7 +3573,7 @@ itrace("waitchld: waitpid returns %d block = %d children_exited = %d", pid, bloc
wait_signal_received = SIGCHLD;
/* If we're in a signal handler, let CHECK_WAIT_INTR pick it up;
run_pending_traps will call run_sigchld_trap later */
if (sigchld == 0)
if (sigchld == 0 && wait_intr_flag)
sh_longjmp (wait_intr_buf, 1);
}
/* If not in posix mode and not executing the wait builtin, queue the
+63 -2
View File
@@ -1637,6 +1637,11 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
if (_rl_last_v_pos != current_line)
{
_rl_move_vert (current_line);
/* We have moved up to a new screen line. This line may or may not have
invisible characters on it, but we do our best to recalculate
visible_wrap_offset based on what we know. */
if (current_line == 0)
visible_wrap_offset = prompt_invis_chars_first_line; /* XXX */
if ((MB_CUR_MAX == 1 || rl_byte_oriented) && current_line == 0 && visible_wrap_offset)
_rl_last_c_pos += visible_wrap_offset;
}
@@ -1648,16 +1653,31 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
string, then redraw the entire prompt string. We can only do this
reliably if the terminal supports a `cr' capability.
This can also happen if the prompt string has changed, and the first
difference in the line is in the middle of the prompt string, after a
sequence of invisible characters (worst case) and before the end of
the prompt. In this case, we have to redraw the entire prompt string
so that the entire sequence of invisible characters is drawn. We need
to handle the worst case, when the difference is after (or in the middle
of) a sequence of invisible characters that changes the text color and
before the sequence that restores the text color to normal. Then we have
to make sure that the lines still differ -- if they don't, we can
return immediately.
This is not an efficiency hack -- there is a problem with redrawing
portions of the prompt string if they contain terminal escape
sequences (like drawing the `unbold' sequence without a corresponding
`bold') that manifests itself on certain terminals. */
lendiff = local_prompt_len;
if (lendiff > nmax)
lendiff = nmax;
od = ofd - old; /* index of first difference in visible line */
nd = nfd - new;
if (current_line == 0 && !_rl_horizontal_scroll_mode &&
_rl_term_cr && lendiff > prompt_visible_length && _rl_last_c_pos > 0 &&
od >= lendiff && _rl_last_c_pos < PROMPT_ENDING_INDEX)
(((od > 0 || nd > 0) && (od < PROMPT_ENDING_INDEX || nd < PROMPT_ENDING_INDEX)) ||
((od >= lendiff) && _rl_last_c_pos < PROMPT_ENDING_INDEX)))
{
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
@@ -1676,6 +1696,43 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
}
else
_rl_last_c_pos = lendiff + modmark;
/* Now if we have printed the prompt string because the first difference
was within the prompt, see if we need to recompute where the lines
differ. Check whether where we are now is past the last place where
the old and new lines are the same and short-circuit now if we are. */
if ((od < PROMPT_ENDING_INDEX || nd < PROMPT_ENDING_INDEX) &&
omax == nmax &&
lendiff > (ols-old) && lendiff > (nls-new))
return;
/* XXX - we need to fix up our calculations if we are now past the
old ofd/nfd and the prompt length (or line length) has changed.
We punt on the problem and do a dumb update. We'd like to be able
to just output the prompt from the beginning of the line up to the
first difference, but you don't know the number of invisible
characters in that case.
This needs a lot of work to be efficient. */
if ((od < PROMPT_ENDING_INDEX || nd < PROMPT_ENDING_INDEX))
{
nfd = new + lendiff; /* number of characters we output above */
nd = lendiff;
/* Do a dumb update and return */
temp = ne - nfd;
if (temp > 0)
{
_rl_output_some_chars (nfd, temp);
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
_rl_last_c_pos += _rl_col_width (new, nd, ne - new, 1);
else
_rl_last_c_pos += temp;
}
if (nmax < omax)
goto clear_rest_of_line; /* XXX */
else
return;
}
}
o_cpos = _rl_last_c_pos;
@@ -1837,11 +1894,15 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
char in the current line (which implies we just output some invisible
characters) we need to adjust _rl_last_c_pos, since it represents
a physical character position. */
/* The current_line*rl_screenwidth+prompt_invis_chars_first_line is a
crude attempt to compute how far into the new line buffer we are.
It doesn't work well in the face of multibyte characters and needs
to be rethought. XXX */
if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) &&
current_line == prompt_last_screen_line && wrap_offset &&
displaying_prompt_first_line &&
wrap_offset != prompt_invis_chars_first_line &&
((nfd-new) < (prompt_last_invisible-(current_line*_rl_screenwidth))))
((nfd-new) < (prompt_last_invisible-(current_line*_rl_screenwidth+prompt_invis_chars_first_line))))
{
_rl_last_c_pos -= wrap_offset - prompt_invis_chars_first_line;
cpos_adjusted = 1;
+8
View File
@@ -83,6 +83,14 @@ outside: outside
local: unset1 unset2
abc
abc
:1
:2
after: ----
global:1
global:2
after: --global--
after: ----
x = :1:2
a=z
a=b
a=z
+4
View File
@@ -217,5 +217,9 @@ ${THIS_SH} ./varenv6.sub
# variable declaration problems with arrays and readonly local variables
${THIS_SH} ./varenv7.sub
# variable visibility problems with process substitution subshells in
# redirections
${THIS_SH} ./varenv8.sub
# make sure variable scoping is done right
tt() { typeset a=b;echo a=$a; };a=z;echo a=$a;tt;echo a=$a
+14
View File
@@ -0,0 +1,14 @@
FOO=bar cat < <(echo $FOO:1; echo $FOO:2)
echo after: --${FOO}--
unset FOO
FOO=global
FOO=bar cat < <(echo $FOO:1; echo $FOO:2)
echo after: --${FOO}--
unset FOO
FOO=bar read x < <(echo -n $FOO:1; echo $FOO:2)
echo after: --${FOO}--
echo x = $x
+2 -1
View File
@@ -96,6 +96,7 @@ extern volatile int from_return_trap;
extern char *this_command_name;
extern sh_builtin_func_t *this_shell_builtin;
extern procenv_t wait_intr_buf;
extern int wait_intr_flag;
extern int return_catch_flag, return_catch_value;
extern int subshell_level;
extern WORD_LIST *subst_assign_varlist;
@@ -457,7 +458,7 @@ trap_handler (sig)
if (this_shell_builtin && (this_shell_builtin == wait_builtin))
{
wait_signal_received = sig;
if (interrupt_immediately)
if (interrupt_immediately && wait_intr_flag)
sh_longjmp (wait_intr_buf, 1);
}