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

Diff of /imapfilter/connect.c

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

revision 1.2 by lefcha, Sun Aug 12 16:06:45 2001 UTC revision 1.3 by lefcha, Mon Aug 20 21:40:57 2001 UTC
# Line 139  int clear_stream(void) Line 139  int clear_stream(void)
139   */   */
140  int search_response(char *results)  int search_response(char *results)
141  {  {
142      int s;      int s, len;
143      char buf[RESPONSE_BUFFER_MAX];      char buf[RESPONSE_BUFFER_MAX];
144      regex_t compexp;      regex_t compexp;
145      regmatch_t match[2];      regmatch_t match[2];
146      const char *reg = "\\* SEARCH ([[:digit:] ]*)";      const char *reg = "\\* SEARCH([[:digit:] ]*)";
147    
148        len = strlen(results);
149    
150      get_response(buf);      get_response(buf);
151    
# Line 151  int search_response(char *results) Line 153  int search_response(char *results)
153    
154      if (!regexec(&compexp, buf, 2, match, 0)) {      if (!regexec(&compexp, buf, 2, match, 0)) {
155          s = min(match[1].rm_eo - match[1].rm_so, SEARCH_RESULTS_MAX - 1);          s = min(match[1].rm_eo - match[1].rm_so, SEARCH_RESULTS_MAX - 1);
156          strncpy(results, buf + match[1].rm_so, s);          strncpy(results + len, buf + match[1].rm_so, s);
157          results[s] = 0;          results[s + len] = 0;
158          return SUCCESS;          return SUCCESS;
159      } else      } else
160          return FAILURE;          return FAILURE;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26