diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-12 13:57:46 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-14 16:17:01 -0800 |
commit | f533861f868afc167aae06968db5bc138729189f (patch) | |
tree | eff8b5e0ce0b88c2ab470a1bfd841668f26a005d /lib/readline/bind.c | |
parent | fc7695ee76400ee9833301f98a3fe483d64591b5 (diff) | |
download | vyatta-bash-f533861f868afc167aae06968db5bc138729189f.tar.gz vyatta-bash-f533861f868afc167aae06968db5bc138729189f.zip |
patched with "debian_patches" in bash_3.1dfsg-8.diff.gz
Diffstat (limited to 'lib/readline/bind.c')
-rw-r--r-- | lib/readline/bind.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/lib/readline/bind.c b/lib/readline/bind.c index 7559d32..1a804b5 100644 --- a/lib/readline/bind.c +++ b/lib/readline/bind.c @@ -723,6 +723,9 @@ rl_function_of_keyseq (keyseq, map, type) /* The last key bindings file read. */ static char *last_readline_init_file = (char *)NULL; +/* Flag to read system init file */ +static int read_system_init_file = 0; + /* The file we're currently reading key bindings from. */ static const char *current_readline_init_file; static int current_readline_init_include_level; @@ -790,7 +793,7 @@ rl_re_read_init_file (count, ignore) to the first non-null filename from this list: 1. the filename used for the previous call 2. the value of the shell variable `INPUTRC' - 3. ~/.inputrc + 3. /etc/inputrc and ~/.inputrc If the file existed and could be opened and read, 0 is returned, otherwise errno is returned. */ int @@ -801,14 +804,31 @@ rl_read_init_file (filename) if (filename == 0) { filename = last_readline_init_file; - if (filename == 0) + if (filename == 0) { filename = sh_get_env_value ("INPUTRC"); - if (filename == 0) + read_system_init_file = 0; + } + if (filename == 0) { filename = DEFAULT_INPUTRC; + read_system_init_file = 1; + } } - if (*filename == 0) + if (*filename == 0) { filename = DEFAULT_INPUTRC; + read_system_init_file = 1; + } + + if (read_system_init_file) + if (filename == last_readline_init_file) + { + filename = savestring (filename); + _rl_read_init_file (SYSTEM_INPUTRC, 0); + free (last_readline_init_file); + last_readline_init_file = filename; + } + else + _rl_read_init_file (SYSTEM_INPUTRC, 0); #if defined (__MSDOS__) if (_rl_read_init_file (filename, 0) == 0) |