}
if ((thisfolder = (struct folder *)malloc(sizeof(struct folder))) == NULL) {
- perror("malloc");
- exit(1);
+ perror ("malloc");
+ exit (1);
}
if ((cp = index(path, '=')) != NULL) {
*cp++ = '\0';
if ((thisfolder->prefix = (char *)strdup(cp)) == NULL) {
- perror("strdup");
- exit(1);
+ perror ("strdup");
+ exit (1);
}
strcpy(thisfolder->prefix, cp);
} else {
if ((cp = rindex(path, '/')) != NULL) {
cp++;
if ((thisfolder->prefix = (char *)strdup(cp)) == NULL) {
- perror("strdup");
- exit(1);
+ perror ("strdup");
+ exit (1);
}
} else {
if ((thisfolder->prefix = (char *)strdup(path)) == NULL) {
- perror("strdup");
- exit(1);
+ perror ("strdup");
+ exit (1);
}
}
} else
}
if ((thisfolder->path = (char *)strdup(path)) == NULL) {
- perror("strdup");
- exit(1);
+ perror ("strdup");
+ exit (1);
}
sh = stat(path, &st);
if ((env = getenv("MAIL")) == NULL) {
uid = getuid();
if ((pw = getpwuid(uid)) == NULL) {
- perror("getpwuid");
- exit(1);
+ perror ("getpwuid");
+ exit (1);
}
- snprintf(path, sizeof(path), "%s/%s", _PATH_MAILDIR, pw->pw_name);
+ snprintf (path, sizeof(path), "%s/%s", _PATH_MAILDIR, pw->pw_name);
} else {
- snprintf(path, sizeof(path), env);
+ snprintf (path, sizeof(path), env);
}
add_folder(path);
if ((cp = rindex(folders[0]->path, '/')) != NULL) {
cp++;
if ((folders[0]->prefix = (char *)strdup(cp)) == NULL) {
- perror("strdup");
- exit(1);
+ perror ("strdup");
+ exit (1);
}
} else {
if ((folders[0]->prefix = (char *)strdup(folders[0]->path)) == NULL) {
- perror("strdup");
- exit(1);
+ perror ("strdup");
+ exit (1);
}
}
}
for (i=0; i < numfolders; i++)
newmail |= watch_mbox(folders[i]->path, folders[i]->prefix, &folders[i]->size, opt_flags);
- if (newmail && (opt_flags & OPT_BELL)) {
- putchar('\007');
- fflush(stdout);
+ if (newmail) {
+ if (!(opt_flags & OPT_WINDOW)) {
+ if (opt_flags & OPT_BELL)
+ putchar ('\007');
+ putchar ('\n');
+ }
+ fflush (stdout);
}
}