]>
Commit | Line | Data |
---|---|---|
e1510a2f | 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 | } |