/[imapfilter]/imapfilter/file.c
ViewVC logotype

Diff of /imapfilter/file.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.43 by lefcha, Fri Jul 26 18:17:28 2002 UTC revision 1.43.2.2 by lefcha, Mon Aug 26 20:18:14 2002 UTC
# Line 131  int parse_config(FILE * fd) Line 131  int parse_config(FILE * fd)
131          "^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(LOGFILE)"          "^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(LOGFILE)"
132          "[[:blank:]]*=[[:blank:]]*([[:print:]]+)\n$",          "[[:blank:]]*=[[:blank:]]*([[:print:]]+)\n$",
133    
134          "^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(EXPUNGE|HEADERS|NAMESPACE|"          "^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(ERRORS|EXPUNGE|HEADERS|"
135          "SUBSCRIBE|WARNING)[[:blank:]]*=[[:blank:]]*(YES|NO)[[:blank:]]*\n$",          "NAMESPACE|SUBSCRIBE|WARNING)[[:blank:]]*=[[:blank:]]*(YES|NO)"
136            "[[:blank:]]*\n$",
137    
138          "^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(DAEMON|TIMEOUT)"          "^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(DAEMON|TIMEOUT)"
139          "[[:blank:]]*=[[:blank:]]*([[:digit:]]+)\n$"          "[[:blank:]]*=[[:blank:]]*([[:digit:]]+)\n$"
# Line 202  void set_options(char *line, regmatch_t Line 203  void set_options(char *line, regmatch_t
203          if (!*logfile)          if (!*logfile)
204              strncat(logfile, line + match[3].rm_so,              strncat(logfile, line + match[3].rm_so,
205                      min((match[3].rm_eo - match[3].rm_so), PATH_MAX - 1));                      min((match[3].rm_eo - match[3].rm_so), PATH_MAX - 1));
206        } else if (!strncasecmp(line + match[2].rm_so, "errors", 6)) {
207            if (!strncasecmp(line + match[3].rm_so, "yes", 3))
208                options |= OPTION_ERRORS;
209            else
210                options &= ~(OPTION_ERRORS);
211      } else if (!strncasecmp(line + match[2].rm_so, "expunge", 7)) {      } else if (!strncasecmp(line + match[2].rm_so, "expunge", 7)) {
212          if (!strncasecmp(line + match[3].rm_so, "yes", 3))          if (!strncasecmp(line + match[3].rm_so, "yes", 3))
213              options |= OPTION_EXPUNGE;              options |= OPTION_EXPUNGE;
# Line 312  int parse_passwords(FILE * fd) Line 318  int parse_passwords(FILE * fd)
318    
319      regcomp(&creg, reg, REG_EXTENDED | REG_ICASE);      regcomp(&creg, reg, REG_EXTENDED | REG_ICASE);
320    
321      while ((line = strsep(&c, "\n")) &&      line = strtok_r(c, "\n", &c);
322             !regexec(&creg, line, 4, match, 0)) {      while (line && !regexec(&creg, line, 4, match, 0)) {
323          user[0] = serv[0] = 0;          user[0] = serv[0] = 0;
324    
325          strncat(serv, line + match[1].rm_so,          strncat(serv, line + match[1].rm_so,
# Line 324  int parse_passwords(FILE * fd) Line 330  int parse_passwords(FILE * fd)
330          if ((pe = (char *)find_password(user, serv)))          if ((pe = (char *)find_password(user, serv)))
331              strncat(pe, line + match[3].rm_so,              strncat(pe, line + match[3].rm_so,
332                      min(match[3].rm_eo - match[3].rm_so, PASSWORD_LEN - 1));                      min(match[3].rm_eo - match[3].rm_so, PASSWORD_LEN - 1));
333    
334            line = strtok_r(NULL, "\n", &c);
335      }      }
336    
337      regfree(&creg);      regfree(&creg);

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.43.2.2

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26