]> git.pld-linux.org Git - packages/cvs.git/blob - cvs-home_etc.patch
- updated cvs-acl.patch
[packages/cvs.git] / cvs-home_etc.patch
1 --- cvs-1.11.4/src/filesubr.c.orig      Tue Sep 24 22:47:09 2002
2 +++ cvs-1.11.4/src/filesubr.c   Fri Jan 17 20:59:20 2003
3 @@ -18,6 +18,7 @@
4     file system semantics.  */
5  
6  #include <assert.h>
7 +#include <sys/stat.h>
8  #include "cvs.h"
9  
10  static int deep_remove_dir PROTO((const char *path));
11 @@ -969,8 +970,24 @@
12      const char *dir;
13      const char *file;
14  {
15 -    char *path = xmalloc (strlen (dir) + 1 + strlen(file) + 1);
16 -    sprintf (path, "%s/%s", dir, file);
17 +    char *path,*cfgdir;
18 +    struct stat st;
19 +    int isdot = (*file == '.');
20 +
21 +    if ( (path = getenv("CONFIG_DIR")) && path[0] ) {
22 +       cfgdir = xmalloc(strlen(dir) + 1 + strlen(path) + 1);
23 +       sprintf(cfgdir, "%s/%s", dir, path);
24 +    } else
25 +       cfgdir = NULL;
26 +    if ( cfgdir && (stat(cfgdir, &st) != -1) && S_ISDIR(st.st_mode) ) {
27 +       path = xmalloc(strlen(cfgdir) + 1 + strlen(file)-isdot + 1);
28 +       sprintf (path, "%s/%s", cfgdir, file+isdot);
29 +    } else {
30 +        path = xmalloc (strlen (dir) + 1 + strlen(file) + 1);
31 +       sprintf (path, "%s/%s", dir, file);
32 +    }
33 +    if (cfgdir)
34 +       free(cfgdir);
35      return path;
36  }
37  
This page took 0.034953 seconds and 3 git commands to generate.