-
-/*
- * new.c -- as new, list all folders with unseen messages
+/* new.c -- as new, list all folders with unseen messages
* -- as fnext, move to next folder with unseen messages
* -- as fprev, move to previous folder with unseen messages
* -- as unseen, scan all unseen messages
char *seqfile = NULL;
FILE *fp;
int state;
- char name[NAMESZ], field[BUFSIZ];
+ char name[NAMESZ], field[NMH_BUFSIZ];
char *cp;
char *msgnums = NULL, *this_msgnums, *old_msgnums;
int failed_to_lock = 0;
case BODY:
adios (NULL, "no blank lines are permitted in %s", seqfile);
- /* fall */
+ /* FALLTHRU */
case FILEEOF:
break;
while (vfgets(fp, &line) == OK) {
len = strlen(line) - 1;
line[len] = '\0';
- check_folder(getcpy(line), len, &b);
+ check_folder(mh_xstrdup(line), len, &b);
}
fclose(fp);
}
if (first == NULL) {
/* No folders at all... */
return NULL;
- } else if (first->n_next == NULL) {
+ }
+ if (first->n_next == NULL) {
/* We have only one node; any desired messages in it? */
if (first->n_field == NULL) {
return NULL;
- } else {
- return first;
}
- } else if (cur_node == NULL) {
+ return first;
+ }
+ if (cur_node == NULL) {
/* Current folder is not listed in .folders, return first. */
return first;
}
if (strcmp(node->n_name, cur) == 0) {
puts(" (*: current folder)");
} else {
- puts("");
+ putchar('\n');
}
fflush(stdout);