summaryrefslogtreecommitdiff
path: root/bash/bash-2.05b/rl-inputrc.patch
blob: 9f8ec7e77d124bcc77700d71d086f2cd7d5ac658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
--- readline4-4.2.orig/lib/readline/bind.c	Wed Nov  8 18:39:01 2000
+++ readline4-4.2/lib/readline/bind.c	Tue Feb  6 18:24:42 2001
@@ -593,6 +593,9 @@
 /* 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;
@@ -670,7 +673,7 @@
    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
@@ -681,14 +684,23 @@
   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)
+    _rl_read_init_file (SYSTEM_INPUTRC, 0);
 
 #if defined (__MSDOS__)
   if (_rl_read_init_file (filename, 0) == 0)
--- readline4-4.2.orig/lib/readline/doc/rluser.texinfo	Mon Feb  5 15:38:11 2001
+++ readline4-4.2/lib/readline/doc/rluser.texinfo	Tue Feb  6 18:24:42 2001
@@ -332,7 +332,8 @@
 @ifclear BashFeatures
 file is taken from the value of the environment variable @env{INPUTRC}.  If
 @end ifclear
-that variable is unset, the default is @file{~/.inputrc}.
+that variable is unset, Readline will read both @file{/etc/inputrc} and 
+@file{~/.inputrc}.
 
 When a program which uses the Readline library starts up, the
 init file is read, and the key bindings are set.
--- readline4-4.2.orig/lib/readline/rlconf.h	Thu Aug  5 14:11:14 1999
+++ readline4-4.2/lib/readline/rlconf.h	Tue Feb  6 18:24:42 2001
@@ -39,6 +39,7 @@
 
 /* The final, last-ditch effort file name for an init file. */
 #define DEFAULT_INPUTRC "~/.inputrc"
+#define SYSTEM_INPUTRC "/etc/inputrc"
 
 /* If defined, expand tabs to spaces. */
 #define DISPLAY_TABS