From: fredrik Date: Tue, 14 Nov 2006 03:56:02 +0000 (+0000) Subject: Use findfile instead of findconfig file. X-Git-Tag: 0.3~191 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=cc03465029bc3d92e2fd85230ae0efc5d03b8f62;p=doldaconnect.git Use findfile instead of findconfig file. Add filldef to findfile. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@732 959494ce-11ee-0310-bf91-de5d638817bd --- diff --git a/daemon/conf.c b/daemon/conf.c index ea3229e..6fd317b 100644 --- a/daemon/conf.c +++ b/daemon/conf.c @@ -271,36 +271,6 @@ int runconfcmd(int argc, wchar_t **argv) return(ret); } -char *findconfigfile(void) -{ - static char pathbuf[128]; - char *p, *p2; - - if(getenv("HOME") != NULL) - { - snprintf(pathbuf, sizeof(pathbuf), "%s/.doldacond", getenv("HOME")); - if(!access(pathbuf, R_OK)) - return(pathbuf); - } - p = CONFIG_PATH; - do - { - p2 = strchr(p, ':'); - if(p2 != NULL) - { - memcpy(pathbuf, p, p2 - p); - pathbuf[p2 - p] = 0; - if(!access(pathbuf, R_OK)) - return(pathbuf); - } else { - if(!access(p, R_OK)) - return(p); - } - p = p2 + 1; - } while(p2 != NULL); - return(NULL); -} - void readconfig(FILE *stream) { int state;