mirror of https://github.com/djcb/mu.git
mu-maildir: don't allow empty path for new maildir
be a bit stricter.
This commit is contained in:
parent
493549a896
commit
dbd15cf704
|
@ -67,6 +67,9 @@ slowpath:
|
|||
static Mu::Result<void>
|
||||
create_maildir(const std::string& path, mode_t mode)
|
||||
{
|
||||
if (path.empty())
|
||||
return Err(Error{Error::Code::File, "path must not be empty"});
|
||||
|
||||
std::array<std::string,3> subdirs = {"new", "cur", "tmp"};
|
||||
for (auto&& subdir: subdirs) {
|
||||
|
||||
|
@ -523,10 +526,10 @@ determine_dst_filename(const std::string& file, Flags flags,
|
|||
* sanity checks
|
||||
*/
|
||||
static Mu::Result<void>
|
||||
check_determine_target_params (const std::string& old_path,
|
||||
const std::string& root_maildir_path,
|
||||
const std::string& target_maildir,
|
||||
Flags newflags)
|
||||
check_determine_target_params (const std::string& old_path,
|
||||
const std::string& root_maildir_path,
|
||||
const std::string& target_maildir,
|
||||
Flags newflags)
|
||||
{
|
||||
if (!g_path_is_absolute(old_path.c_str()))
|
||||
return Err(Error{Error::Code::File,
|
||||
|
|
|
@ -39,7 +39,8 @@ namespace Mu {
|
|||
* *not* try to remove the parts the were created. it *will* create any parent
|
||||
* dirs that are not yet existent.
|
||||
*
|
||||
* @param path the path (missing components will be created, as in 'mkdir -p')
|
||||
* @param path the path (missing components will be created, as in 'mkdir -p').
|
||||
* must be non-empty
|
||||
* @param mode the file mode (e.g., 0755)
|
||||
* @param noindex add a .noindex file to the maildir, so it will be excluded
|
||||
* from indexing by 'mu index'
|
||||
|
|
Loading…
Reference in New Issue