@@ -1042,7 +1042,7 @@ static int imap_expunge(struct imap_session *imap, int silent)
10421042 return -1 ;
10431043 }
10441044 while (fno < files && (entry = entries [fno ++ ])) {
1045- if (entry -> d_type != DT_REG || ! strcmp (entry -> d_name , "." ) || ! strcmp ( entry -> d_name , ".." )) {
1045+ if (! IS_MAILDIR_FILE (entry )) {
10461046 goto next ;
10471047 }
10481048
@@ -1186,7 +1186,7 @@ static void do_qresync(struct imap_session *imap, unsigned long lastmodseq, cons
11861186 */
11871187 int i = 0 ;
11881188 while (fno < files && (entry = entries [fno ++ ])) {
1189- if (entry -> d_type != DT_REG || ! strcmp (entry -> d_name , "." ) || ! strcmp ( entry -> d_name , ".." )) {
1189+ if (! IS_MAILDIR_FILE (entry )) {
11901190 continue ;
11911191 }
11921192 seqno ++ ;
@@ -1222,7 +1222,7 @@ static void do_qresync(struct imap_session *imap, unsigned long lastmodseq, cons
12221222 free_if (expunged );
12231223
12241224 while (fno < files && (entry = entries [fno ++ ])) {
1225- if (entry -> d_type != DT_REG || ! strcmp (entry -> d_name , "." ) || ! strcmp ( entry -> d_name , ".." )) {
1225+ if (! IS_MAILDIR_FILE (entry )) {
12261226 goto next ;
12271227 }
12281228 seqno ++ ;
@@ -2098,7 +2098,7 @@ static int handle_copy(struct imap_session *imap, const char *sequences, const c
20982098 unsigned int msguid ;
20992099 struct stat st ;
21002100
2101- if (entry -> d_type != DT_REG || ! strcmp (entry -> d_name , "." ) || ! strcmp ( entry -> d_name , ".." )) {
2101+ if (! IS_MAILDIR_FILE (entry )) {
21022102 continue ;
21032103 }
21042104 msguid = imap_msg_in_range (imap , ++ seqno , entry -> d_name , sequences , usinguid , & error );
@@ -2194,7 +2194,7 @@ static int handle_move(struct imap_session *imap, const char *sequences, const c
21942194 unsigned int msguid ;
21952195 unsigned long modseq ;
21962196
2197- if (entry -> d_type != DT_REG || ! strcmp (entry -> d_name , "." ) || ! strcmp ( entry -> d_name , ".." )) {
2197+ if (! IS_MAILDIR_FILE (entry )) {
21982198 goto cleanup ;
21992199 }
22002200 ++ seqno ;
@@ -3306,7 +3306,7 @@ static int process_flags(struct imap_session *imap, char *s, int usinguid, const
33063306 unsigned int msguid ;
33073307 unsigned long modseq ;
33083308
3309- if (entry -> d_type != DT_REG || ! strcmp (entry -> d_name , "." ) || ! strcmp ( entry -> d_name , ".." )) {
3309+ if (! IS_MAILDIR_FILE (entry )) {
33103310 continue ;
33113311 }
33123312 msguid = imap_msg_in_range (imap , ++ seqno , entry -> d_name , sequences , usinguid , & error );
@@ -3346,7 +3346,7 @@ static int process_flags(struct imap_session *imap, char *s, int usinguid, const
33463346 int i ;
33473347 int newflags , changes = 0 ;
33483348
3349- if (entry -> d_type != DT_REG || ! strcmp (entry -> d_name , "." ) || ! strcmp ( entry -> d_name , ".." )) {
3349+ if (! IS_MAILDIR_FILE (entry )) {
33503350 continue ;
33513351 }
33523352 msguid = imap_msg_in_range (imap , ++ seqno , entry -> d_name , sequences , usinguid , & error );
@@ -3759,7 +3759,7 @@ static int sub_rename(const char *path, const char *prefix, const char *newprefi
37593759 return -1 ;
37603760 }
37613761 while (fno < files && (entry = entries [fno ++ ])) {
3762- if (!strcmp (entry -> d_name , "." ) || ! strcmp ( entry -> d_name , ".." )) {
3762+ if (!IS_MAILDIR_DIR (entry )) {
37633763 continue ;
37643764 } else if (entry -> d_type == DT_DIR ) { /* We only care about directories, not files. */
37653765 if (!strncmp (entry -> d_name , prefix , prefixlen )) {
0 commit comments