X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=complete.c;h=55df9065cd951bdb9babfd42b8fa84ad48ee70ee;hp=a385af4cb6ede49c1a05465f620ab23107ce487e;hb=b07d69b15852a06183f7b2298436e18150c36958;hpb=7f7a0be369840b290248e5b0302beb447fa1b3cd diff --git a/complete.c b/complete.c index a385af4..55df906 100644 --- a/complete.c +++ b/complete.c @@ -21,6 +21,7 @@ #endif #include +#include #include "lib/debug.h" #include @@ -104,7 +105,7 @@ int mutt_complete (char *s, size_t slen) /* we can use '/' as a delimiter, imap_complete rewrites it */ if (*s == '=' || *s == '+' || *s == '!') { const char *q = NONULL(*s == '!' ? Spoolfile : Maildir); - mutt_concat_path (imap_path, q, s + 1, sizeof (imap_path)); + mutt_concat_path(imap_path, sizeof(imap_path), q, s + 1); } else strfcpy (imap_path, s, sizeof (imap_path)); @@ -124,7 +125,7 @@ int mutt_complete (char *s, size_t slen) char buf[_POSIX_PATH_MAX]; *p++ = 0; - mutt_concat_path (buf, exp_dirpart, s + 1, sizeof (buf)); + mutt_concat_path(buf, sizeof(buf), exp_dirpart, s + 1); strfcpy (exp_dirpart, buf, sizeof (exp_dirpart)); snprintf (buf, sizeof (buf), "%s%s/", dirpart, s + 1); strfcpy (dirpart, buf, sizeof (dirpart)); @@ -146,7 +147,7 @@ int mutt_complete (char *s, size_t slen) else { *p = 0; len = (size_t) (p - s); - strncpy (dirpart, s, len); + memcpy(dirpart, s, len); dirpart[len] = 0; p++; strfcpy (filepart, p, sizeof (filepart)); @@ -174,8 +175,8 @@ int mutt_complete (char *s, size_t slen) */ if ((len = m_strlen(filepart)) == 0) { while ((de = readdir (dirp)) != NULL) { - if (str_cmp (".", de->d_name) != 0 - && str_cmp ("..", de->d_name) != 0) { + if (m_strcmp(".", de->d_name) != 0 + && m_strcmp("..", de->d_name) != 0) { strfcpy (filepart, de->d_name, sizeof (filepart)); init++; break; @@ -219,7 +220,7 @@ int mutt_complete (char *s, size_t slen) if (dirpart[0]) { strfcpy (s, dirpart, slen); - if (str_cmp ("/", dirpart) != 0 && dirpart[0] != '=' + if (m_strcmp("/", dirpart) != 0 && dirpart[0] != '=' && dirpart[0] != '+') strfcpy (s + m_strlen(s), "/", slen - m_strlen(s)); strfcpy (s + m_strlen(s), filepart, slen - m_strlen(s));