projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wibble
[apps/madmutt.git]
/
browser.c
diff --git
a/browser.c
b/browser.c
index
e22e1ea
..
233a7c1
100644
(file)
--- a/
browser.c
+++ b/
browser.c
@@
-78,7
+78,7
@@
static char LastDirBackup[_POSIX_PATH_MAX] = "";
/* Frees up the memory allocated for the local-global variables. */
static void destroy_state (struct browser_state *state)
{
/* Frees up the memory allocated for the local-global variables. */
static void destroy_state (struct browser_state *state)
{
- int c;
+
unsigned
int c;
for (c = 0; c < state->entrylen; c++) {
p_delete(&((state->entry)[c].name));
for (c = 0; c < state->entrylen; c++) {
p_delete(&((state->entry)[c].name));
@@
-423,9
+423,15
@@
static const char *newsgroup_format_str (char *dest, size_t destlen, char op,
}
#endif /* USE_NNTP */
}
#endif /* USE_NNTP */
+#ifdef USE_NNTP
static void add_folder (MUTTMENU * m, struct browser_state *state,
const char *name, const struct stat *s,
void *data, int new)
static void add_folder (MUTTMENU * m, struct browser_state *state,
const char *name, const struct stat *s,
void *data, int new)
+#else
+static void add_folder (MUTTMENU * m, struct browser_state *state,
+ const char *name, const struct stat *s,
+ int new)
+#endif
{
if (state->entrylen == state->entrymax) {
/* need to allocate more space */
{
if (state->entrylen == state->entrymax) {
/* need to allocate more space */
@@
-489,7
+495,11
@@
static int examine_directory (MUTTMENU * menu, struct browser_state *state,
continue;
if (!((regexec (Mask.rx, data->group, 0, NULL, 0) == 0) ^ Mask.not))
continue;
continue;
if (!((regexec (Mask.rx, data->group, 0, NULL, 0) == 0) ^ Mask.not))
continue;
+#ifdef USE_NNTP
add_folder (menu, state, data->group, NULL, data, data->new);
add_folder (menu, state, data->group, NULL, data, data->new);
+#else
+ add_folder (menu, state, data->group, NULL, data->new);
+#endif
}
sidebar_draw (CurrentMenu);
}
}
sidebar_draw (CurrentMenu);
}
@@
-549,7
+559,11
@@
static int examine_directory (MUTTMENU * menu, struct browser_state *state,
continue;
i = buffy_lookup (buffer);
continue;
i = buffy_lookup (buffer);
+#ifdef USE_NNTP
add_folder (menu, state, de->d_name, &s, NULL, i >= 0 ? ((BUFFY*) Incoming->data[i])->new : 0);
add_folder (menu, state, de->d_name, &s, NULL, i >= 0 ? ((BUFFY*) Incoming->data[i])->new : 0);
+#else
+ add_folder (menu, state, de->d_name, &s, i >= 0 ? ((BUFFY*) Incoming->data[i])->new : 0);
+#endif
}
closedir (dp);
}
}
closedir (dp);
}
@@
-586,7
+600,7
@@
static int examine_mailboxes (MUTTMENU * menu, struct browser_state *state)
else
#endif
{
else
#endif
{
- int i = 0;
+
unsigned
int i = 0;
BUFFY* tmp;
if (!Incoming)
BUFFY* tmp;
if (!Incoming)
@@
-600,13
+614,21
@@
static int examine_mailboxes (MUTTMENU * menu, struct browser_state *state)
tmp->magic = mx_get_magic (tmp->path);
#ifdef USE_IMAP
if (tmp->magic == M_IMAP) {
tmp->magic = mx_get_magic (tmp->path);
#ifdef USE_IMAP
if (tmp->magic == M_IMAP) {
+#ifdef USE_NNTP
add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
+#else
+ add_folder (menu, state, tmp->path, NULL, tmp->new);
+#endif
continue;
}
#endif
#ifdef USE_POP
if (tmp->magic == M_POP) {
continue;
}
#endif
#ifdef USE_POP
if (tmp->magic == M_POP) {
+#ifdef USE_NNTP
add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
+#else
+ add_folder (menu, state, tmp->path, NULL, tmp->new);
+#endif
continue;
}
#endif
continue;
}
#endif
@@
-626,7
+648,11
@@
static int examine_mailboxes (MUTTMENU * menu, struct browser_state *state)
m_strcpy(buffer, sizeof(buffer), NONULL(tmp->path));
mutt_pretty_mailbox (buffer);
m_strcpy(buffer, sizeof(buffer), NONULL(tmp->path));
mutt_pretty_mailbox (buffer);
+#ifdef USE_NNTP
add_folder (menu, state, buffer, &s, NULL, tmp->new);
add_folder (menu, state, buffer, &s, NULL, tmp->new);
+#else
+ add_folder (menu, state, buffer, &s, tmp->new);
+#endif
}
}
browser_sort (state);
}
}
browser_sort (state);
@@
-779,7
+805,7
@@
void _mutt_select_file (char *f, size_t flen, int flags, char ***files,
for (i = m_strlen(f) - 1; i > 0 && f[i] != '/'; i--);
if (i > 0) {
if (f[0] == '/') {
for (i = m_strlen(f) - 1; i > 0 && f[i] != '/'; i--);
if (i > 0) {
if (f[0] == '/') {
- i = MIN(sizeof(LastDir) - 1, i);
+ i = MIN(s
s
izeof(LastDir) - 1, i);
m_strcpy(LastDir, sizeof(LastDir), f);
}
else {
m_strcpy(LastDir, sizeof(LastDir), f);
}
else {
@@
-993,12
+1019,13
@@
void _mutt_select_file (char *f, size_t flen, int flags, char ***files,
if (multiple) {
char **tfiles;
if (multiple) {
char **tfiles;
- int i, j;
+ int j;
+ unsigned int h;
if (menu->tagged) {
*numfiles = menu->tagged;
tfiles = p_new(char *, *numfiles);
if (menu->tagged) {
*numfiles = menu->tagged;
tfiles = p_new(char *, *numfiles);
- for (
i = 0, j = 0; i
< state.entrylen; i++) {
+ for (
h = 0, j = 0; h
< state.entrylen; i++) {
struct folder_file ff = state.entry[i];
char full[_POSIX_PATH_MAX];
struct folder_file ff = state.entry[i];
char full[_POSIX_PATH_MAX];
@@
-1128,7
+1155,7
@@
void _mutt_select_file (char *f, size_t flen, int flags, char ***files,
#endif
{
/* add '/' at the end of the directory name if not already there */
#endif
{
/* add '/' at the end of the directory name if not already there */
-
in
t len = m_strlen(LastDir);
+
size_
t len = m_strlen(LastDir);
if (len && LastDir[len - 1] != '/' && sizeof (buf) > len)
buf[len] = '/';
if (len && LastDir[len - 1] != '/' && sizeof (buf) > len)
buf[len] = '/';
@@
-1204,7
+1231,7
@@
void _mutt_select_file (char *f, size_t flen, int flags, char ***files,
mutt_error ("%s", buf);
}
else {
mutt_error ("%s", buf);
}
else {
-
str_replace
(&Mask.pattern, buf);
+
m_strreplace
(&Mask.pattern, buf);
regfree (Mask.rx);
p_delete(&Mask.rx);
Mask.rx = rx;
regfree (Mask.rx);
p_delete(&Mask.rx);
Mask.rx = rx;
@@
-1354,11
+1381,11
@@
void _mutt_select_file (char *f, size_t flen, int flags, char ***files,
}
else {
BODY *b;
}
else {
BODY *b;
- char buf[_POSIX_PATH_MAX];
+ char
n
buf[_POSIX_PATH_MAX];
- mutt_concat_path(
buf, sizeof(
buf), LastDir,
+ mutt_concat_path(
nbuf, sizeof(n
buf), LastDir,
state.entry[menu->current].name);
state.entry[menu->current].name);
- b = mutt_make_file_attach (buf);
+ b = mutt_make_file_attach (
n
buf);
if (b != NULL) {
mutt_view_attachment (NULL, b, M_REGULAR, NULL, NULL, 0);
mutt_free_body (&b);
if (b != NULL) {
mutt_view_attachment (NULL, b, M_REGULAR, NULL, NULL, 0);
mutt_free_body (&b);