]> git.pld-linux.org Git - packages/bash.git/commitdiff
- CONFIG_DIR support
authorjuandon <witekfl@pld-linux.org>
Sun, 23 Mar 2003 17:12:41 +0000 (17:12 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bash-home_etc.patch -> 1.1

bash-home_etc.patch [new file with mode: 0644]

diff --git a/bash-home_etc.patch b/bash-home_etc.patch
new file mode 100644 (file)
index 0000000..6e94c02
--- /dev/null
@@ -0,0 +1,42 @@
+diff -Nru bash-2.05b/builtins/evalfile.c bash-2.05b.new/builtins/evalfile.c
+--- bash-2.05b/builtins/evalfile.c     Thu Feb 21 20:08:52 2002
++++ bash-2.05b.new/builtins/evalfile.c Sun Mar 23 14:59:23 2003
+@@ -208,6 +208,23 @@
+   return ((flags & FEVAL_BUILTIN) ? result : 1);
+ }
++static char *
++config_dir_tilde_expand (s, config_dir)
++     const char *s;
++     const char *config_dir;
++{
++  int old_immed, r;
++  char *ret;
++
++  if (*s == '~' && *(s+1) == '/')
++    {
++      ret = xmalloc(strlen(config_dir) + strlen(s) - 1);
++      sprintf(ret, "%s/%s", config_dir, s+3);
++    }
++  else return bash_tilde_expand(s, 0);
++  return (ret);
++}
++
+ int
+ maybe_execute_file (fname, force_noninteractive)
+      const char *fname;
+@@ -215,8 +232,12 @@
+ {
+   char *filename;
+   int result, flags;
+-
+-  filename = bash_tilde_expand (fname, 0);
++  char *config_dir = getenv("CONFIG_DIR");
++  
++  if (config_dir)
++    filename = config_dir_tilde_expand(fname, config_dir);
++  else
++    filename = bash_tilde_expand (fname, 0);
+   flags = FEVAL_ENOENTOK;
+   if (force_noninteractive)
+     flags |= FEVAL_NONINT;
This page took 0.166035 seconds and 4 git commands to generate.