vim: Update from 8.0.1241 to 8.0.1300
[termux-packages] / packages / fish / 5dc78dd858c28dcfd564ee50e56ccd33fc0b39dc.patch
1 https://github.com/fish-shell/fish-shell/commit/5dc78dd858c28dcfd564ee50e56ccd33fc0b39dc
2
3 fix regression involving `read` from scripts
4
5 diff --git a/src/input.cpp b/src/input.cpp
6 index 1cdb151b3..d4dc16698 100644
7 --- a/src/input.cpp
8 +++ b/src/input.cpp
9 @@ -189,7 +189,7 @@ static std::vector<terminfo_mapping_t> terminfo_mappings;
10 /// List of all terminfo mappings.
11 static std::vector<terminfo_mapping_t> mappings;
12
13 -/// Set to true when the input subsytem has been initialized.
14 +/// Set to true when the input subsystem has been initialized.
15 bool input_initialized = false;
16
17 /// Initialize terminfo.
18 @@ -307,7 +307,6 @@ void init_input() {
19 }
20
21 input_initialized = true;
22 - return;
23 }
24
25 void input_destroy() {
26 diff --git a/src/reader.cpp b/src/reader.cpp
27 index bd278ad6a..1e0e05698 100644
28 --- a/src/reader.cpp
29 +++ b/src/reader.cpp
30 @@ -1563,10 +1563,10 @@ static bool check_for_orphaned_process(unsigned long loop_count, pid_t shell_pgi
31
32 /// Initialize data for interactive use.
33 static void reader_interactive_init() {
34 - assert(input_initialized);
35 // See if we are running interactively.
36 pid_t shell_pgid;
37
38 + if (!input_initialized) init_input();
39 kill_init();
40 shell_pgid = getpgrp();
41
42 diff --git a/tests/read.in b/tests/read.in
43 index febc2968f..0fe31ec01 100644
44 --- a/tests/read.in
45 +++ b/tests/read.in
46 @@ -191,3 +191,6 @@ end
47 if test (string length "$x") -ne $FISH_READ_BYTE_LIMIT
48 echo reading the max amount of data with --nchars failed the length test
49 end
50 +
51 +echo '# Confirm reading non-interactively works (#4206 regression)'
52 +echo abc\ndef | ../test/root/bin/fish -i -c 'read a; read b; show $a; show $b'
53 diff --git a/tests/read.out b/tests/read.out
54 index d35a9146a..88b445a40 100644
55 --- a/tests/read.out
56 +++ b/tests/read.out
57 @@ -58,3 +58,8 @@ newline
58
59 # chunked read tests
60 Chunked reads test pass
61 +# Confirm reading non-interactively works (#4206 regression)
62 +count=1
63 +|abc|
64 +count=1
65 +|def|