diff options
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 0563e6d01..67c5e0baa 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -707,7 +707,11 @@ static int path_parse(char ***p) | |||
707 | tmp = (char*)pth; | 707 | tmp = (char*)pth; |
708 | npth = 1; /* path component count */ | 708 | npth = 1; /* path component count */ |
709 | while (1) { | 709 | while (1) { |
710 | #if ENABLE_PLATFORM_MINGW32 | ||
711 | tmp = next_path_sep(tmp); | ||
712 | #else | ||
710 | tmp = strchr(tmp, ':'); | 713 | tmp = strchr(tmp, ':'); |
714 | #endif | ||
711 | if (!tmp) | 715 | if (!tmp) |
712 | break; | 716 | break; |
713 | tmp++; | 717 | tmp++; |
@@ -720,7 +724,11 @@ static int path_parse(char ***p) | |||
720 | res[0] = tmp = xstrdup(pth); | 724 | res[0] = tmp = xstrdup(pth); |
721 | npth = 1; | 725 | npth = 1; |
722 | while (1) { | 726 | while (1) { |
727 | #if ENABLE_PLATFORM_MINGW32 | ||
728 | tmp = next_path_sep(tmp); | ||
729 | #else | ||
723 | tmp = strchr(tmp, ':'); | 730 | tmp = strchr(tmp, ':'); |
731 | #endif | ||
724 | if (!tmp) | 732 | if (!tmp) |
725 | break; | 733 | break; |
726 | *tmp++ = '\0'; /* ':' -> '\0' */ | 734 | *tmp++ = '\0'; /* ':' -> '\0' */ |
@@ -1964,9 +1972,16 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman | |||
1964 | 1972 | ||
1965 | INIT_S(); | 1973 | INIT_S(); |
1966 | 1974 | ||
1975 | #if ENABLE_PLATFORM_MINGW32 | ||
1976 | memset(initial_settings.c_cc, sizeof(initial_settings.c_cc), 0); | ||
1977 | initial_settings.c_cc[VINTR] = CTRL('C'); | ||
1978 | initial_settings.c_cc[VEOF] = CTRL('D'); | ||
1979 | if (!isatty(0) || !isatty(1)) { | ||
1980 | #else | ||
1967 | if (tcgetattr(STDIN_FILENO, &initial_settings) < 0 | 1981 | if (tcgetattr(STDIN_FILENO, &initial_settings) < 0 |
1968 | || !(initial_settings.c_lflag & ECHO) | 1982 | || !(initial_settings.c_lflag & ECHO) |
1969 | ) { | 1983 | ) { |
1984 | #endif | ||
1970 | /* Happens when e.g. stty -echo was run before */ | 1985 | /* Happens when e.g. stty -echo was run before */ |
1971 | parse_and_put_prompt(prompt); | 1986 | parse_and_put_prompt(prompt); |
1972 | /* fflush_all(); - done by parse_and_put_prompt */ | 1987 | /* fflush_all(); - done by parse_and_put_prompt */ |