return p ? p + 1 : f;
}
+ssize_t m_dirname(char *dst, ssize_t dlen, const char *path)
+{
+ int plen = m_strlen(path);
+
+ while (plen > 0 && path[plen - 1] == '/')
+ plen--;
+
+ while (plen > 0 && path[plen - 1] != '/')
+ plen--;
+
+ while (plen > 0 && path[plen - 1] == '/')
+ plen--;
+
+ if (plen)
+ return m_strncpy(dst, dlen, path, plen);
+
+ if (*path == '/')
+ return m_strcpy(dst, dlen, "/");
+ return m_strcpy(dst, dlen, ".");
+}
char *
mutt_concat_path(char *d, ssize_t n, const char *dir, const char *fname)
/****************************************************************************/
const char *mutt_basename(const char *);
+ssize_t m_dirname(char *, ssize_t, const char *);
+
char *mutt_concat_path(char *, ssize_t, const char *, const char *);
void mutt_sanitize_filename(char *, short);