From: Jani Nikula Date: Sun, 1 Oct 2017 20:53:10 +0000 (+0300) Subject: cli: strip trailing "/" from the final maildir path in notmuch insert X-Git-Tag: 0.26_rc0~129 X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=d57da17fcd30a5cbe191ccd42906e489dd2bd6a3;hp=d57da17fcd30a5cbe191ccd42906e489dd2bd6a3;p=notmuch cli: strip trailing "/" from the final maildir path in notmuch insert 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. ---