]> git.pld-linux.org Git - packages/bvi.git/blob - bvi-etc_dir.patch
- s/home_etc/etc_dir/
[packages/bvi.git] / bvi-etc_dir.patch
1 diff -Nru bvi-1.3.1/io.c bvi-1.3.1.new/io.c
2 --- bvi-1.3.1/io.c      Tue Dec 25 13:37:38 2001
3 +++ bvi-1.3.1.new/io.c  Sun Mar 23 19:07:37 2003
4 @@ -264,7 +264,8 @@
5  {
6         char    *initstr;
7         char    rcpath[MAXCMD];
8 -
9 +       char    *etc_dir = getenv("ETC_DIR");
10 +       
11         terminal = getenv("TERM");
12         shell = getenv("SHELL");
13         if (shell == NULL || *shell == '\0')
14 @@ -275,9 +276,15 @@
15                 return;
16         }
17         
18 -       strncpy(rcpath, getenv("HOME"), MAXCMD - 8);
19 -       rcpath[MAXCMD - 8] = '\0';
20 -       strcat(rcpath, "/.bvirc");
21 +       if (etc_dir) {
22 +               strncpy(rcpath, etc_dir, MAXCMD - 7);
23 +               rcpath[MAXCMD - 7] = '\0';
24 +               strcat(rcpath, "/bvirc");
25 +       } else {
26 +               strncpy(rcpath, getenv("HOME"), MAXCMD - 8);
27 +               rcpath[MAXCMD - 8] = '\0';
28 +               strcat(rcpath, "/.bvirc");
29 +       }
30         if (stat(rcpath, &buf) == 0) {
31                 if (buf.st_uid == getuid()) read_rc(rcpath);
32         }
This page took 0.060476 seconds and 3 git commands to generate.