X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=complete.c;h=2fd849af573c66ac24782f5f5f52eda48b1ce8ce;hp=bd2bb052be5a5f2a568b17bab598ba30b94ab237;hb=2c56b665394c80195b976537e608b690947fcb14;hpb=238b70e39b78f585c586bd51aef41988b3cc73d1 diff --git a/complete.c b/complete.c index bd2bb05..2fd849a 100644 --- a/complete.c +++ b/complete.c @@ -11,49 +11,42 @@ # include "config.h" #endif -#include "mutt.h" -#ifdef USE_IMAP -#include "mx.h" -#include "imap.h" -#endif -#ifdef USE_NNTP -#include "nntp.h" -#endif - -#include -#include -#include "lib/debug.h" - #include #include #include #include #include +#include +#include + +#include "mutt.h" +#include "mx.h" +#include +#ifdef USE_NNTP +#include "nntp.h" +#endif + /* given a partial pathname, this routine fills in as much of the rest of the * path as is unique. * * return 0 if ok, -1 if no matches */ -int mutt_complete (char *s, size_t slen) +int mutt_complete (char *s, ssize_t slen) { char *p; DIR *dirp = NULL; struct dirent *de; int i, init = 0; - size_t len; + ssize_t len; char dirpart[_POSIX_PATH_MAX], exp_dirpart[_POSIX_PATH_MAX]; char filepart[_POSIX_PATH_MAX]; -#ifdef USE_IMAP char imap_path[LONG_STRING]; -#endif - - debug_print (2, ("completing %s\n", s)); #ifdef USE_NNTP if (option (OPTNEWS)) { - LIST *l = CurrentNewsSrv->list; + string_list_t *l = CurrentNewsSrv->list; m_strcpy(filepart, sizeof(filepart), s); @@ -101,7 +94,6 @@ int mutt_complete (char *s, size_t slen) } #endif -#ifdef USE_IMAP /* we can use '/' as a delimiter, imap_complete rewrites it */ if (*s == '=' || *s == '+' || *s == '!') { const char *q = NONULL(*s == '!' ? Spoolfile : Maildir); @@ -112,7 +104,6 @@ int mutt_complete (char *s, size_t slen) if (mx_get_magic (imap_path) == M_IMAP) return imap_complete (s, slen, imap_path); -#endif if (*s == '=' || *s == '+' || *s == '!') { dirpart[0] = *s; @@ -146,7 +137,7 @@ int mutt_complete (char *s, size_t slen) } else { *p = 0; - len = (size_t) (p - s); + len = p - s; memcpy(dirpart, s, len); dirpart[len] = 0; p++; @@ -165,7 +156,6 @@ int mutt_complete (char *s, size_t slen) } if (dirp == NULL) { - debug_print (1, ("%s: %s (errno %d).\n", exp_dirpart, strerror (errno), errno)); return (-1); }