+ for (i = 0, len = NAMESTRLEN - 1;
+ *c && *c != '\"' && *c != '\n' && i < len;
+ c++)
+ name[i++] = *c;
+
+ if (rmparen && name[(i - 1)] == ')')
+ --i; /* get rid of "(name-comment)" parens */
+
+ comment_fnd = 1;
+ } else if (hm_strchr(line, '(')) {
+ c = hm_strchr(line, '(') + 1;
+ if (*c == '"') /* is there a comment in the comment ? */
+ c++;
+ } else if (*c == '<') { /* Comment may be on the end */
+ /* From: <bill@celestial.com> Bill Campbell */
+ c = strchr(line, '>') + 1;
+ for (i = 0, len = NAMESTRLEN - 1;
+ *c && *c != '\n' && i < len; c++)
+ name[i++] = *c;
+
+ comment_fnd = 1;
+ }
+ } else if (strchr(line, '(')) {
+ c = strchr(line, '(');
+ c++;
+ if (*c == '"') /* is there a comment in the comment ? */
+ c++;
+ while (*c == ' ' || *c == '\t')
+ c++;
+ } else if (strchr(line, '[')) {
+ c = strchr(line, ':') + 1;
+ while (*c == ' ' || *c == '\t')
+ c++;
+
+ for (i = 0, len = NAMESTRLEN - 1;
+ *c && *c != '\"' && *c != '[' && *c != '\n'
+ && i < len; c++)
+ name[i++] = *c;
+
+ name[--i] = '\0';
+ comment_fnd = 1;
+ } else {
+ /*
+ * Is there an email address available
+ * that we can use for the name ?
+ */
+ if (!strcmp(email, NOEMAIL)) /* No */
+ strcpymax(name, NONAME, NAMESTRLEN);
+ else {
+ c = email + strlen(email) - 1;
+ while (isspace((unsigned char) *c))
+ *c-- = '\0';
+ strcpymax(name, email, NAMESTRLEN); /* Yes */
+ }
+ *namep = strsav(name);
+ *emailp = strsav(email);
+ return;
+ }
+
+ if (!comment_fnd) {
+ /*int in_ascii = TRUE, esclen = 0; */
+ for (i = 0, len = NAMESTRLEN - 1;
+ *c && *c != '<' && *c != '\"' && *c != ')'
+ && *c != '(' && *c != '\n' && i < len; c++) {
+ /*if (set_iso2022jp) {
+ iso2022_state(c, &in_ascii, &esclen);
+ if (esclen) {
+ for (; esclen; esclen--, c++) name[i++] = *c;
+ for (; in_ascii == FALSE && i < len;
+ c++, iso2022_state(c, &in_ascii, &esclen)) {
+ name[i++] = *c;
+ }
+ c--;
+ } else {
+ name[i++] = *c;
+ }
+ } else { */