diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-22 10:52:06 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-22 10:52:06 +1000 |
commit | 87994ae30fbb6056ba90e274445b3190feb84f76 (patch) | |
tree | 0264515e537941ee449ce4cfec523947bb6491ca | |
parent | ab18cfce12a269390cabf7cac2673060f0609c46 (diff) | |
parent | 5c4eb803c62b9199eeab3bd2c72bd931eab10960 (diff) | |
download | busybox-w32-87994ae30fbb6056ba90e274445b3190feb84f76.tar.gz busybox-w32-87994ae30fbb6056ba90e274445b3190feb84f76.tar.bz2 busybox-w32-87994ae30fbb6056ba90e274445b3190feb84f76.zip |
Merge branch 'ash'
-rw-r--r-- | libbb/lineedit.c | 9 | ||||
-rw-r--r-- | shell/ash.c | 2 | ||||
-rw-r--r-- | win32/termios.c | 6 |
3 files changed, 15 insertions, 2 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 3af9f4e64..182dfac13 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -1914,10 +1914,16 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li | |||
1914 | 1914 | ||
1915 | INIT_S(); | 1915 | INIT_S(); |
1916 | 1916 | ||
1917 | #if !ENABLE_PLATFORM_MINGW32 | 1917 | #if ENABLE_PLATFORM_MINGW32 |
1918 | memset(initial_settings.c_cc, sizeof(initial_settings.c_cc), 0); | ||
1919 | initial_settings.c_cc[VINTR] = CTRL('C'); | ||
1920 | initial_settings.c_cc[VEOF] = CTRL('D'); | ||
1921 | if (!isatty(0) || !isatty(1)) { | ||
1922 | #else | ||
1918 | if (tcgetattr(STDIN_FILENO, &initial_settings) < 0 | 1923 | if (tcgetattr(STDIN_FILENO, &initial_settings) < 0 |
1919 | || !(initial_settings.c_lflag & ECHO) | 1924 | || !(initial_settings.c_lflag & ECHO) |
1920 | ) { | 1925 | ) { |
1926 | #endif | ||
1921 | /* Happens when e.g. stty -echo was run before */ | 1927 | /* Happens when e.g. stty -echo was run before */ |
1922 | parse_and_put_prompt(prompt); | 1928 | parse_and_put_prompt(prompt); |
1923 | /* fflush_all(); - done by parse_and_put_prompt */ | 1929 | /* fflush_all(); - done by parse_and_put_prompt */ |
@@ -1928,7 +1934,6 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li | |||
1928 | DEINIT_S(); | 1934 | DEINIT_S(); |
1929 | return len; | 1935 | return len; |
1930 | } | 1936 | } |
1931 | #endif | ||
1932 | 1937 | ||
1933 | init_unicode(); | 1938 | init_unicode(); |
1934 | 1939 | ||
diff --git a/shell/ash.c b/shell/ash.c index 0ff5adb04..c3b497938 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -4079,6 +4079,8 @@ waitpid_child(int *status) | |||
4079 | } | 4079 | } |
4080 | 4080 | ||
4081 | LOOP(pid_nr++); | 4081 | LOOP(pid_nr++); |
4082 | if (!pid_nr) | ||
4083 | return -1; | ||
4082 | pidp = pidlist = ckmalloc(sizeof(*pidlist)*pid_nr); | 4084 | pidp = pidlist = ckmalloc(sizeof(*pidlist)*pid_nr); |
4083 | LOOP(*pidp++ = (HANDLE)ps->ps_pid); | 4085 | LOOP(*pidp++ = (HANDLE)ps->ps_pid); |
4084 | #undef LOOP | 4086 | #undef LOOP |
diff --git a/win32/termios.c b/win32/termios.c index e2dc96361..34a17bbfd 100644 --- a/win32/termios.c +++ b/win32/termios.c | |||
@@ -31,6 +31,12 @@ int64_t FAST_FUNC read_key(int fd, char *buf, int timeout UNUSED_PARAM) | |||
31 | continue; | 31 | continue; |
32 | if (!record.Event.KeyEvent.uChar.AsciiChar) { | 32 | if (!record.Event.KeyEvent.uChar.AsciiChar) { |
33 | DWORD state = record.Event.KeyEvent.dwControlKeyState; | 33 | DWORD state = record.Event.KeyEvent.dwControlKeyState; |
34 | |||
35 | if (state & (RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED) && | ||
36 | (record.Event.KeyEvent.wVirtualKeyCode >= 'A' && | ||
37 | record.Event.KeyEvent.wVirtualKeyCode <= 'Z')) | ||
38 | return record.Event.KeyEvent.wVirtualKeyCode & ~0x40; | ||
39 | |||
34 | switch (record.Event.KeyEvent.wVirtualKeyCode) { | 40 | switch (record.Event.KeyEvent.wVirtualKeyCode) { |
35 | case VK_DELETE: return KEYCODE_DELETE; | 41 | case VK_DELETE: return KEYCODE_DELETE; |
36 | case VK_INSERT: return KEYCODE_INSERT; | 42 | case VK_INSERT: return KEYCODE_INSERT; |