projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Nico Golde:
[apps/madmutt.git]
/
mh.c
diff --git
a/mh.c
b/mh.c
index
5d8f036
..
5f3f369
100644
(file)
--- a/
mh.c
+++ b/
mh.c
@@
-1927,14
+1927,10
@@
int mh_check_empty (const char *path)
return r;
}
return r;
}
-int mh_is_magic (const char* path) {
- struct stat st;
+static int mh_is_magic (const char* path, struct stat* st) {
char tmp[_POSIX_PATH_MAX];
char tmp[_POSIX_PATH_MAX];
- if (stat (path, &st) == -1)
- return (-1);
-
- if (S_ISDIR (st.st_mode)) {
+ if (S_ISDIR (st->st_mode)) {
snprintf (tmp, sizeof (tmp), "%s/.mh_sequences", path);
if (access (tmp, F_OK) == 0)
return (M_MH);
snprintf (tmp, sizeof (tmp), "%s/.mh_sequences", path);
if (access (tmp, F_OK) == 0)
return (M_MH);
@@
-1967,15
+1963,13
@@
int mh_is_magic (const char* path) {
return (-1);
}
return (-1);
}
-
int maildir_is_magic (const char* path
) {
- struct stat s
t
;
+
static int maildir_is_magic (const char* path, struct stat* st
) {
+ struct stat s
b
;
char tmp[_POSIX_PATH_MAX];
char tmp[_POSIX_PATH_MAX];
- if (stat (path, &st) == -1)
- return (0);
- if (S_ISDIR (st.st_mode)) {
+ if (S_ISDIR (st->st_mode)) {
snprintf (tmp, sizeof (tmp), "%s/cur", path);
snprintf (tmp, sizeof (tmp), "%s/cur", path);
- if (stat (tmp, &s
t) == 0 && S_ISDIR (st
.st_mode))
+ if (stat (tmp, &s
b) == 0 && S_ISDIR (sb
.st_mode))
return (M_MAILDIR);
}
return (-1);
return (M_MAILDIR);
}
return (-1);