Changeset 5011:b0172175cc89 for buffy.c
Legend:
- Unmodified
- Added
- Removed
-
buffy.c
r4868 r5011 46 46 static short BuffyNotify = 0; /* # of unnotified new boxes */ 47 47 48 #ifdef BUFFY_SIZE49 50 48 /* Find the last message in the file. 51 49 * upon success return 0. If no message found - return -1 */ … … 168 166 return; 169 167 } 170 #endif171 168 172 169 int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *err) … … 174 171 BUFFY **tmp,*tmp1; 175 172 char buf[_POSIX_PATH_MAX]; 176 #ifdef BUFFY_SIZE177 173 struct stat sb; 178 #endif /* BUFFY_SIZE */179 174 180 175 while (MoreArgs (s)) … … 233 228 (*tmp)->newly_created = 0; 234 229 235 #ifdef BUFFY_SIZE 236 /* for buffy_size, it is important that if the folder is new (tested by 230 /* for check_mbox_size, it is important that if the folder is new (tested by 237 231 * reading it), the size is set to 0 so that later when we check we see 238 * that it increased . without buffy_size we probably don't care.232 * that it increased . without check_mbox_size we probably don't care. 239 233 */ 240 if (stat ((*tmp)->path, &sb) == 0 && !test_new_folder ((*tmp)->path)) 234 if (option(OPTCHECKMBOXSIZE) && 235 stat ((*tmp)->path, &sb) == 0 && !test_new_folder ((*tmp)->path)) 241 236 { 242 237 /* some systems out there don't have an off_t type */ … … 245 240 else 246 241 (*tmp)->size = 0; 247 #endif /* BUFFY_SIZE */248 242 } 249 243 return 0; 250 244 } 251 245 252 #ifdef BUFFY_SIZE 253 /* people use buffy_size on systems where modified time attributes are BADLY 254 * broken. Ignore them. 246 /* people use check_mbox_size on systems where modified time attributes are 247 * BADLY broken. Ignore them. 255 248 */ 256 #define STAT_CHECK (sb.st_size > tmp->size) 257 #else 258 #define STAT_CHECK (sb.st_mtime > sb.st_atime || (tmp->newly_created && sb.st_ctime == sb.st_mtime && sb.st_ctime == sb.st_atime)) 259 #endif /* BUFFY_SIZE */ 249 #define STAT_CHECK_SIZE (sb.st_size > tmp->size) 250 #define STAT_CHECK_TIME (sb.st_mtime > sb.st_atime || (tmp->newly_created && sb.st_ctime == sb.st_mtime && sb.st_ctime == sb.st_atime)) 251 #define STAT_CHECK (option(OPTCHECKMBOXSIZE) ? STAT_CHECK_SIZE : STAT_CHECK_TIME) 260 252 261 253 int mutt_buffy_check (int force) … … 324 316 tmp->newly_created = 1; 325 317 tmp->magic = 0; 326 #ifdef BUFFY_SIZE327 318 tmp->size = 0; 328 #endif329 319 continue; 330 320 } … … 366 356 tmp->new = 1; 367 357 } 368 #ifdef BUFFY_SIZE 369 else 358 else if (option(OPTCHECKMBOXSIZE)) 370 359 { 371 360 /* some other program has deleted mail from the folder */ 372 361 tmp->size = (long) sb.st_size; 373 362 } 374 #endif375 363 if (tmp->newly_created && 376 364 (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime)) … … 408 396 } 409 397 } 410 #ifdef BUFFY_SIZE 411 else if (Context && Context->path) 398 else if (option(OPTCHECKMBOXSIZE) && Context && Context->path) 412 399 tmp->size = (long) sb.st_size; /* update the size */ 413 #endif414 400 415 401 if (!tmp->new)
