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]
/
complete.c
diff --git
a/complete.c
b/complete.c
index
f21d9e8
..
c909486
100644
(file)
--- a/
complete.c
+++ b/
complete.c
@@
-13,13
+13,16
@@
#include "mutt.h"
#ifdef USE_IMAP
#include "mutt.h"
#ifdef USE_IMAP
-#include "m
ailbo
x.h"
+#include "mx.h"
#include "imap.h"
#endif
#ifdef USE_NNTP
#include "nntp.h"
#endif
#include "imap.h"
#endif
#ifdef USE_NNTP
#include "nntp.h"
#endif
+#include "lib/str.h"
+#include "lib/debug.h"
+
#include <dirent.h>
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
#include <sys/types.h>
@@
-45,7
+48,7
@@
int mutt_complete (char *s, size_t slen)
char imap_path[LONG_STRING];
#endif
char imap_path[LONG_STRING];
#endif
- d
print (2, (debugfile, "mutt_complete:
completing %s\n", s));
+ d
ebug_print (2, ("
completing %s\n", s));
#ifdef USE_NNTP
if (option (OPTNEWS)) {
#ifdef USE_NNTP
if (option (OPTNEWS)) {
@@
-57,7
+60,7
@@
int mutt_complete (char *s, size_t slen)
* special case to handle when there is no filepart yet.
* find the first subscribed newsgroup
*/
* special case to handle when there is no filepart yet.
* find the first subscribed newsgroup
*/
- if ((len =
mutt_str
len (filepart)) == 0) {
+ if ((len =
str_
len (filepart)) == 0) {
for (; l; l = l->next) {
NNTP_DATA *data = (NNTP_DATA *) l->data;
for (; l; l = l->next) {
NNTP_DATA *data = (NNTP_DATA *) l->data;
@@
-74,7
+77,7
@@
int mutt_complete (char *s, size_t slen)
NNTP_DATA *data = (NNTP_DATA *) l->data;
if (data && data->subscribed &&
NNTP_DATA *data = (NNTP_DATA *) l->data;
if (data && data->subscribed &&
-
mutt_str
ncmp (data->group, filepart, len) == 0) {
+
str_
ncmp (data->group, filepart, len) == 0) {
if (init) {
for (i = 0; filepart[i] && data->group[i]; i++) {
if (filepart[i] != data->group[i]) {
if (init) {
for (i = 0; filepart[i] && data->group[i]; i++) {
if (filepart[i] != data->group[i]) {
@@
-110,7
+113,7
@@
int mutt_complete (char *s, size_t slen)
else
strfcpy (imap_path, s, sizeof (imap_path));
else
strfcpy (imap_path, s, sizeof (imap_path));
- if (mx_
is_imap (imap_path)
)
+ if (mx_
get_magic (imap_path) == M_IMAP
)
return imap_complete (s, slen, imap_path);
#endif
return imap_complete (s, slen, imap_path);
#endif
@@
-165,9
+168,7
@@
int mutt_complete (char *s, size_t slen)
}
if (dirp == NULL) {
}
if (dirp == NULL) {
- dprint (1,
- (debugfile, "mutt_complete(): %s: %s (errno %d).\n", exp_dirpart,
- strerror (errno), errno));
+ debug_print (1, ("%s: %s (errno %d).\n", exp_dirpart, strerror (errno), errno));
return (-1);
}
return (-1);
}
@@
-175,10
+176,10
@@
int mutt_complete (char *s, size_t slen)
* special case to handle when there is no filepart yet. find the first
* file/directory which is not ``.'' or ``..''
*/
* special case to handle when there is no filepart yet. find the first
* file/directory which is not ``.'' or ``..''
*/
- if ((len =
mutt_str
len (filepart)) == 0) {
+ if ((len =
str_
len (filepart)) == 0) {
while ((de = readdir (dirp)) != NULL) {
while ((de = readdir (dirp)) != NULL) {
- if (
mutt_str
cmp (".", de->d_name) != 0
- &&
mutt_str
cmp ("..", de->d_name) != 0) {
+ if (
str_
cmp (".", de->d_name) != 0
+ &&
str_
cmp ("..", de->d_name) != 0) {
strfcpy (filepart, de->d_name, sizeof (filepart));
init++;
break;
strfcpy (filepart, de->d_name, sizeof (filepart));
init++;
break;
@@
-187,7
+188,7
@@
int mutt_complete (char *s, size_t slen)
}
while ((de = readdir (dirp)) != NULL) {
}
while ((de = readdir (dirp)) != NULL) {
- if (
mutt_str
ncmp (de->d_name, filepart, len) == 0) {
+ if (
str_
ncmp (de->d_name, filepart, len) == 0) {
if (init) {
for (i = 0; filepart[i] && de->d_name[i]; i++) {
if (filepart[i] != de->d_name[i]) {
if (init) {
for (i = 0; filepart[i] && de->d_name[i]; i++) {
if (filepart[i] != de->d_name[i]) {
@@
-206,14
+207,14
@@
int mutt_complete (char *s, size_t slen)
/* check to see if it is a directory */
if (dirpart[0]) {
strfcpy (buf, exp_dirpart, sizeof (buf));
/* check to see if it is a directory */
if (dirpart[0]) {
strfcpy (buf, exp_dirpart, sizeof (buf));
- strfcpy (buf +
mutt_strlen (buf), "/", sizeof (buf) - mutt_str
len (buf));
+ strfcpy (buf +
str_len (buf), "/", sizeof (buf) - str_
len (buf));
}
else
buf[0] = 0;
}
else
buf[0] = 0;
- strfcpy (buf +
mutt_strlen (buf), filepart, sizeof (buf) - mutt_str
len (buf));
+ strfcpy (buf +
str_len (buf), filepart, sizeof (buf) - str_
len (buf));
if (stat (buf, &st) != -1 && (st.st_mode & S_IFDIR))
if (stat (buf, &st) != -1 && (st.st_mode & S_IFDIR))
- strfcpy (filepart +
mutt_str
len (filepart), "/",
- sizeof (filepart) -
mutt_str
len (filepart));
+ strfcpy (filepart +
str_
len (filepart), "/",
+ sizeof (filepart) -
str_
len (filepart));
init = 1;
}
}
init = 1;
}
}
@@
-222,10
+223,10
@@
int mutt_complete (char *s, size_t slen)
if (dirpart[0]) {
strfcpy (s, dirpart, slen);
if (dirpart[0]) {
strfcpy (s, dirpart, slen);
- if (
mutt_str
cmp ("/", dirpart) != 0 && dirpart[0] != '='
+ if (
str_
cmp ("/", dirpart) != 0 && dirpart[0] != '='
&& dirpart[0] != '+')
&& dirpart[0] != '+')
- strfcpy (s +
mutt_strlen (s), "/", slen - mutt_str
len (s));
- strfcpy (s +
mutt_strlen (s), filepart, slen - mutt_str
len (s));
+ strfcpy (s +
str_len (s), "/", slen - str_
len (s));
+ strfcpy (s +
str_len (s), filepart, slen - str_
len (s));
}
else
strfcpy (s, filepart, slen);
}
else
strfcpy (s, filepart, slen);