diff options
author | Eli Zaretskii <eliz@gnu.org> | 2016-09-17 11:50:37 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2016-09-17 11:50:37 +0300 |
commit | 7f3c5ec870943f7f32c946ff9459dfd04fcb8e07 (patch) | |
tree | c1249a2049135698e852cf637d29c70fd39ce537 /readline/complete.c | |
parent | a3fa21cadc29421553d2c956056f0a777dafd3d2 (diff) | |
download | gdb-7f3c5ec870943f7f32c946ff9459dfd04fcb8e07.zip gdb-7f3c5ec870943f7f32c946ff9459dfd04fcb8e07.tar.gz gdb-7f3c5ec870943f7f32c946ff9459dfd04fcb8e07.tar.bz2 |
Improve MinGW support in Readline
These changes were already accepted upstream in Readline,
but GDB did not yet import a newer Readline version.
readline/Changelog.gdb:
* util.c: Include rlshell.h.
(_rl_tropen) [_WIN32 && !__CYGWIN__]: Open the trace file in the
user's temporary directory.
* tcap.h [HAVE_NCURSES_TERMCAP_H]: Include ncurses/termcap.h.
* input.c (w32_isatty) [_WIN32 && !__CYGWIN__]: New function, to
replace isatty that is not reliable enough on MS-Windows.
(isatty) [_WIN32 && !__CYGWIN__]: Redirect to w32_isatty.
(rl_getc): Call _getch, not getch, which could be an ncurses
function when linked with ncurses, in which case getch will return
EOF for any keystroke, because there's no curses window.
* tilde.c (tilde_expand_word) [_WIN32]:
* histfile.c (history_filename) [_WIN32]: Windows-specific
environment variable to replace HOME if that is undefined.
* funmap.c (default_funmap): Compile rl_paste_from_clipboard on
all Windows platforms, not just Cygwin.
* readline.h (rl_paste_from_clipboard): Include declaration for
all Windows platforms.
* display.c (insert_some_chars, delete_chars): Don't use the
MinGW-specific code if linked with ncurses.
* configure.in:
* config.h.in: Support ncurses/termcap.h. The configure script
was updated accordingly.
* complete.c [_WIN32 && !__CYGWIN__]: Initialize
_rl_completion_case_fold to 1.
(printable_part, rl_filename_completion_function)
[_WIN32 && !__CYGWIN__]: Handle the drive letter.
Diffstat (limited to 'readline/complete.c')
-rw-r--r-- | readline/complete.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/readline/complete.c b/readline/complete.c index a5ce803..5733d4e 100644 --- a/readline/complete.c +++ b/readline/complete.c @@ -156,7 +156,8 @@ int _rl_complete_mark_symlink_dirs = 0; int _rl_print_completions_horizontally; /* Non-zero means that case is not significant in filename completion. */ -#if defined (__MSDOS__) && !defined (__DJGPP__) +#if defined (__MSDOS__) && !defined (__DJGPP__) \ + || (defined (_WIN32) && !defined (__CYGWIN__)) int _rl_completion_case_fold = 1; #else int _rl_completion_case_fold = 0; @@ -636,7 +637,7 @@ printable_part (pathname) return (pathname); temp = strrchr (pathname, '/'); -#if defined (__MSDOS__) +#if defined (__MSDOS__) || defined (_WIN32) if (temp == 0 && ISALPHA ((unsigned char)pathname[0]) && pathname[1] == ':') temp = pathname + 1; #endif @@ -2186,7 +2187,7 @@ rl_filename_completion_function (text, state) temp = strrchr (dirname, '/'); -#if defined (__MSDOS__) +#if defined (__MSDOS__) || defined (_WIN32) /* special hack for //X/... */ if (dirname[0] == '/' && dirname[1] == '/' && ISALPHA ((unsigned char)dirname[2]) && dirname[3] == '/') temp = strrchr (dirname + 3, '/'); @@ -2197,7 +2198,7 @@ rl_filename_completion_function (text, state) strcpy (filename, ++temp); *temp = '\0'; } -#if defined (__MSDOS__) +#if defined (__MSDOS__) || (defined (_WIN32) && !defined (__CYGWIN__)) /* searches from current directory on the drive */ else if (ISALPHA ((unsigned char)dirname[0]) && dirname[1] == ':') { |