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
b84d0b1
..
c909486
100644
(file)
--- a/
complete.c
+++ b/
complete.c
@@
-21,6
+21,7
@@
#endif
#include "lib/str.h"
#endif
#include "lib/str.h"
+#include "lib/debug.h"
#include <dirent.h>
#include <string.h>
#include <dirent.h>
#include <string.h>
@@
-47,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)) {
@@
-59,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 = s
afe_str
len (filepart)) == 0) {
+ if ((len = s
tr_
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;
@@
-76,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 &&
- s
afe_str
ncmp (data->group, filepart, len) == 0) {
+ s
tr_
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]) {
@@
-112,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
@@
-167,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);
}
@@
-177,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 = s
afe_str
len (filepart)) == 0) {
+ if ((len = s
tr_
len (filepart)) == 0) {
while ((de = readdir (dirp)) != NULL) {
while ((de = readdir (dirp)) != NULL) {
- if (s
afe_str
cmp (".", de->d_name) != 0
- && s
afe_str
cmp ("..", de->d_name) != 0) {
+ if (s
tr_
cmp (".", de->d_name) != 0
+ && s
tr_
cmp ("..", de->d_name) != 0) {
strfcpy (filepart, de->d_name, sizeof (filepart));
init++;
break;
strfcpy (filepart, de->d_name, sizeof (filepart));
init++;
break;
@@
-189,7
+188,7
@@
int mutt_complete (char *s, size_t slen)
}
while ((de = readdir (dirp)) != NULL) {
}
while ((de = readdir (dirp)) != NULL) {
- if (s
afe_str
ncmp (de->d_name, filepart, len) == 0) {
+ if (s
tr_
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]) {
@@
-208,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 + s
afe_strlen (buf), "/", sizeof (buf) - safe_str
len (buf));
+ strfcpy (buf + s
tr_len (buf), "/", sizeof (buf) - str_
len (buf));
}
else
buf[0] = 0;
}
else
buf[0] = 0;
- strfcpy (buf + s
afe_strlen (buf), filepart, sizeof (buf) - safe_str
len (buf));
+ strfcpy (buf + s
tr_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 + s
afe_str
len (filepart), "/",
- sizeof (filepart) - s
afe_str
len (filepart));
+ strfcpy (filepart + s
tr_
len (filepart), "/",
+ sizeof (filepart) - s
tr_
len (filepart));
init = 1;
}
}
init = 1;
}
}
@@
-224,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 (s
afe_str
cmp ("/", dirpart) != 0 && dirpart[0] != '='
+ if (s
tr_
cmp ("/", dirpart) != 0 && dirpart[0] != '='
&& dirpart[0] != '+')
&& dirpart[0] != '+')
- strfcpy (s + s
afe_strlen (s), "/", slen - safe_str
len (s));
- strfcpy (s + s
afe_strlen (s), filepart, slen - safe_str
len (s));
+ strfcpy (s + s
tr_len (s), "/", slen - str_
len (s));
+ strfcpy (s + s
tr_len (s), filepart, slen - str_
len (s));
}
else
strfcpy (s, filepart, slen);
}
else
strfcpy (s, filepart, slen);