diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-16 01:07:11 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-16 01:07:11 +0800 |
commit | 65ff9f98b70203b08ed8238c6ed389f21c61f289 (patch) | |
tree | d583dd7a375eb0b66c751119d88d6ecd009c935f /mbbsd/cache.c | |
parent | 08666c93cbcadc1787ed05093992630b891ff498 (diff) | |
download | pttbbs-65ff9f98b70203b08ed8238c6ed389f21c61f289.tar pttbbs-65ff9f98b70203b08ed8238c6ed389f21c61f289.tar.gz pttbbs-65ff9f98b70203b08ed8238c6ed389f21c61f289.tar.bz2 pttbbs-65ff9f98b70203b08ed8238c6ed389f21c61f289.tar.lz pttbbs-65ff9f98b70203b08ed8238c6ed389f21c61f289.tar.xz pttbbs-65ff9f98b70203b08ed8238c6ed389f21c61f289.tar.zst pttbbs-65ff9f98b70203b08ed8238c6ed389f21c61f289.zip |
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@105 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/cache.c')
-rw-r--r-- | mbbsd/cache.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 8fceef65..054bd16b 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -1,4 +1,4 @@ -/* $Id: cache.c,v 1.9 2002/04/15 12:05:52 in2 Exp $ */ +/* $Id: cache.c,v 1.10 2002/04/15 17:07:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1026,9 +1026,8 @@ int hbflcheck(int bid, int uid) } #ifdef MDCACHE -char *cachepath(const char *fpath) +int cachepath(char *cpath, const char *fpath) { - static char cpath[128]; char *ptr; snprintf(cpath, sizeof(cpath), "cache/%s", fpath); for( ptr = &cpath[6] ; *ptr != 0 ; ++ptr ) @@ -1045,7 +1044,13 @@ int updatemdcache(const char *CPATH, const char *fpath) */ int len, sourcefd, targetfd; char buf[1024], *cpath; - cpath = (CPATH == NULL) ? cachepath(fpath) : CPATH; + if(CPATH==NULL) + { + cpath=buf; + cachepath(buf, fpath); + } + else + cpath = CPATH; if( (sourcefd = open(fpath, O_RDONLY)) < 0 ) return -1; if( (targetfd = open(cpath, O_RDWR | O_CREAT, 0600)) < 0 ) |