472a473,543 > > /* > * Check for sig delims > */ > > int > pan_is_signature_delimitor (const char * line, const int line_len) > { > switch (line_len) > { > case 2: if (!strncmp (line,"--" ,2)) return SIG_NON_STANDARD; > break; > > case 3: if (!strncmp (line,"--\r" ,3)) return SIG_NON_STANDARD; > if (!strncmp (line,"-- " ,3)) return SIG_STANDARD; > break; > > case 4: if (!strncmp (line,"-- \r",4)) return SIG_STANDARD; > > default: > return SIG_NONE; > } > return SIG_NONE; > } > > gboolean > pan_remove_signature (char * body) > { > const char * march = body; > char * line = NULL; > char * sig_point = NULL; > int sig_type = SIG_NONE; > int lines_below = 0; > int line_len = 0; > > /*iterate through the text, line by line*/ > while (get_next_token_run (march, '\n', &march, &line, &line_len)) > { > int st; > st = pan_is_signature_delimitor (line, line_len); > if (st == SIG_STANDARD || st == SIG_NON_STANDARD) > { > sig_type = st; > sig_point = line; > lines_below = 0; > > } else > { > if (sig_point) > lines_below++; > } > } > if (sig_type == SIG_NONE) return FALSE; > if (sig_point == NULL) return FALSE; > if (sig_type == SIG_STANDARD) > { > *sig_point = '\0'; > return TRUE; > } > > > /*if we have a non-standard sig, make sure it's the last one and that > * there are less than SIG_THRESHOLD lines > */ > if (sig_type == SIG_NON_STANDARD && lines_below <= SIG_THRESHOLD ) > { > *sig_point = '\0'; > return TRUE; > } > > }