Changeset 5034:f467353f5657 for bcache.c
Legend:
- Unmodified
- Added
- Removed
-
bcache.c
r5020 r5034 132 132 } 133 133 134 FILE* mutt_bcache_put(body_cache_t *bcache, const char *id )134 FILE* mutt_bcache_put(body_cache_t *bcache, const char *id, int tmp) 135 135 { 136 136 char path[_POSIX_PATH_MAX]; … … 142 142 return NULL; 143 143 144 path[0] = '\0'; 145 safe_strncat (path, sizeof (path), bcache->path, bcache->pathlen); 146 safe_strncat (path, sizeof (path), id, mutt_strlen (id)); 144 snprintf (path, sizeof (path), "%s%s%s", bcache->path, id, 145 tmp ? ".tmp" : ""); 147 146 148 147 s = strchr (path + 1, '/'); … … 162 161 } 163 162 163 int mutt_bcache_commit(body_cache_t* bcache, const char* id) 164 { 165 char tmpid[_POSIX_PATH_MAX]; 166 167 snprintf (tmpid, sizeof (tmpid), "%s.tmp", id); 168 169 return mutt_bcache_move (bcache, tmpid, id); 170 } 171 164 172 int mutt_bcache_move(body_cache_t* bcache, const char* id, const char* newid) 165 173 {
