Sophie

Sophie

distrib > Altlinux > 4.1 > i586 > media > core-src > by-pkgid > 4ab8ee97b2f86f0de7ab33ede3d384ea > files > 5

readline4.3-4.3-alt8.src.rpm

diff -uprk.orig readline-4.3.orig/bind.c readline-4.3/bind.c
--- readline-4.3.orig/bind.c	2002-01-24 19:15:52 +0300
+++ readline-4.3/bind.c	2002-09-29 14:13:15 +0400
@@ -625,6 +625,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;
@@ -692,7 +695,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
@@ -703,14 +706,19 @@ 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)
-	filename = DEFAULT_INPUTRC;
+        read_system_init_file = 0;
+      }
     }
 
-  if (*filename == 0)
+  if (filename == 0 || *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)
diff -uprk.orig readline-4.3.orig/doc/readline.3 readline-4.3/doc/readline.3
--- readline-4.3.orig/doc/readline.3	2002-04-17 01:10:30 +0400
+++ readline-4.3/doc/readline.3	2002-09-29 14:11:03 +0400
@@ -114,8 +114,8 @@ Readline is customized by putting comman
 file (the \fIinputrc\fP file).
 The name of this file is taken from the value of the
 .B INPUTRC
-environment variable.  If that variable is unset, the default is
-.IR ~/.inputrc .
+environment variable.  If that variable is unset, readline will read both
+.IR /etc/inputrc " and " ~/.inputrc .
 When a program which uses the readline library starts up, the
 init file is read, and the key bindings and variables are set.
 There are only a few basic constructs allowed in the
@@ -1238,6 +1238,9 @@ VI Command Mode functions
 .TP
 .FN ~/.inputrc
 Individual \fBreadline\fP initialization file
+.TP
+.FN /etc/inputrc
+System \fBreadline\fP initialization file
 .PD
 .SH AUTHORS
 Brian Fox, Free Software Foundation
diff -uprk.orig readline-4.3.orig/doc/rluser.texinfo readline-4.3/doc/rluser.texinfo
--- readline-4.3.orig/doc/rluser.texinfo	2002-03-05 21:20:44 +0300
+++ readline-4.3/doc/rluser.texinfo	2002-09-29 14:11:03 +0400
@@ -336,7 +336,8 @@ file is taken from the value of the shel
 @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.
diff -uprk.orig readline-4.3.orig/rlconf.h readline-4.3/rlconf.h
--- readline-4.3.orig/rlconf.h	2002-01-22 20:54:23 +0300
+++ readline-4.3/rlconf.h	2002-09-29 14:11:03 +0400
@@ -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