]> git.notmuchmail.org Git - notmuch/commitdiff
cli: strip trailing "/" from the final maildir path in notmuch insert
authorJani Nikula <jani@nikula.org>
Sun, 1 Oct 2017 20:53:10 +0000 (23:53 +0300)
committerDavid Bremner <david@tethera.net>
Thu, 5 Oct 2017 01:00:19 +0000 (22:00 -0300)
Several subtle interconnected changes here:

- If the folder name passed as argument is the empty string "" or
  slash "/", the final maildir path would end up having "//" in it. We
  should strip the final maildir path, not folder.

- The folder variable should really be const char *, another reason
  not to modify it.

- The maildir variable is only const to let us point it at db_path
  directly.

To be able to strip the maildir variable, always allocate it. Default
folder to the empty string "", and don't treat folder not being
present on the command line as anything special.

As a side effect, we also create the cur/new/tmp in the top level
directory if they're not there and --create-folder is given.


No differences found