X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdatabase.cc;h=b8486f7d5271771648ef0ff1ec71c8887a43b391;hp=3b342f136a5397b32096987d0ad3592c43e4fc63;hb=a352d9ceaa7e08b7c9de294419ec4c323b81ca15;hpb=0f6b399d5b2f925a75a69d7cda38dda5c67db7a1 diff --git a/lib/database.cc b/lib/database.cc index 3b342f13..b8486f7d 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1781,7 +1781,7 @@ _notmuch_database_split_path (void *ctx, /* Finally, skip multiple slashes. */ while (slash != path) { - if (*slash != '/') + if (*(slash - 1) != '/') break; --slash; @@ -1794,7 +1794,7 @@ _notmuch_database_split_path (void *ctx, *basename = path; } else { if (directory) - *directory = talloc_strndup (ctx, path, slash - path + 1); + *directory = talloc_strndup (ctx, path, slash - path); } return NOTMUCH_STATUS_SUCCESS;