]> git.notmuchmail.org Git - notmuch/commit
fix notmuch-new bug when database path ends with a trailing /
authorBart Trojanowski <bart@jukie.net>
Sun, 22 Nov 2009 16:19:31 +0000 (11:19 -0500)
committerCarl Worth <cworth@cworth.org>
Mon, 23 Nov 2009 03:37:01 +0000 (04:37 +0100)
commitceee152fca2be5cec9dd5873748539ff2642c91b
tree8c94e54f2ffb00626dafed114a518aecbf66a89a
parent369b44103d5fb5db6c3915dc45de83588395c1b9
fix notmuch-new bug when database path ends with a trailing /

I configured my database.path with a trailing /, and after running notmuch
new every notmuch search would fail with error messages like this:

  Error opening /inbox/cur/1258565257.000211.mbox:2,S: No such file or directory

The actual bug was in the filename normalization for storage in the
database.  The database.path was removed from the full filename, but if
the database.path from the config file contained a trailing /, the
relative file name would retain an extra leading /... which made it look
like an absolute path after it was read out from the DB.

Signed-off-by: Bart Trojanowski <bart@jukie.net>
lib/message.cc