]> git.pld-linux.org Git - packages/etswitch.git/blob - etswitch-home_etc.patch
22021e7164b8ac7ab1a88a0450c22e6e46c47b31
[packages/etswitch.git] / etswitch-home_etc.patch
1 --- etswitch-0.1.8/src/conf.c~  2005-11-03 17:56:30.000000000 +0100
2 +++ etswitch-0.1.8/src/conf.c   2006-03-09 20:48:40.865172500 +0100
3 @@ -95,7 +95,9 @@
4      
5      file = calloc(max,1);
6      bin = calloc(78,1);
7 -    home = (char *)getenv("HOME");
8 +    home = getenv("HOME_ETC");
9 +    if ( home == NULL)
10 +           home = (char *)getenv("HOME");
11      snprintf((char *)file, (size_t)max, "%s/.etswitch/etswitch.rc", (char *)home);
12      if (!(fp = open((char *)file,O_RDONLY))){
13         fprintf(stderr, "fopen read failed: %s, at line: %d\n", strerror(errno),__LINE__);
14 @@ -121,6 +123,10 @@
15      int r;
16      int special;
17  
18 +    char * home = getenv("HOME_ETC");
19 +    if (home == NULL)
20 +           home = getenv("HOME");
21 +
22      dir = calloc(PATH_MAX+1,1);
23  /*    home = calloc(PATH_MAX+1,1); */
24      file = calloc(PATH_MAX+NAME_MAX+1,1);
25 @@ -130,7 +136,7 @@
26         exit(EXIT_FAILURE);
27      }
28      /* change to get pw*/
29 -    snprintf((char *)dir, PATH_MAX, "%s/.etswitch", getenv("HOME"));
30 +    snprintf((char *)dir, PATH_MAX, "%s/.etswitch", home);
31      snprintf((char *)file, PATH_MAX+NAME_MAX, "%s/etswitch.rc", dir);
32      if (stat((char *)dir, &dir_stat)!=-1){
33         if (!S_ISDIR (dir_stat.st_mode)){    /* the name is a directory, and it exists  */
This page took 0.072225 seconds and 2 git commands to generate.