X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=complete.c;h=2fd849af573c66ac24782f5f5f52eda48b1ce8ce;hp=5e66da81290cac0f9fe34348a45405169674e206;hb=7c6a042ca1bccde0ed39d2499e9272f963025e75;hpb=b8c71f93b0296f815a6538182343ba67e88c0012 diff --git a/complete.c b/complete.c index 5e66da8..2fd849a 100644 --- a/complete.c +++ b/complete.c @@ -11,6 +11,15 @@ # include "config.h" #endif +#include +#include +#include +#include +#include + +#include +#include + #include "mutt.h" #include "mx.h" #include @@ -18,38 +27,26 @@ #include "nntp.h" #endif -#include -#include -#include "lib/debug.h" - -#include -#include -#include -#include -#include - /* 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]; char imap_path[LONG_STRING]; - 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); @@ -140,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++; @@ -159,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); }