Back to index

courier  0.68.2
maildirflags.c
Go to the documentation of this file.
00001 /*
00002 ** Copyright 2000-2002 Double Precision, Inc.
00003 ** See COPYING for distribution information.
00004 */
00005 
00006 #include      "config.h"
00007 #include      <sys/types.h>
00008 #include      <string.h>
00009 
00010 
00011 int maildir_hasflag(const char *filename, char flag)
00012 {
00013        const char *p=strrchr(filename, '/');
00014 
00015        if (p)
00016               filename=p+1;
00017 
00018        p=strrchr(filename, MDIRSEP[0]);
00019        if (p && strncmp(p, MDIRSEP "2,", 3) == 0 &&
00020            strchr(p+3, flag))
00021               return (1);
00022        return (0);
00023 }