]> git.notmuchmail.org Git - notmuch/blobdiff - lib/database.cc
database: move striping of trailing '/' into helper function
[notmuch] / lib / database.cc
index 8f0e22a834eeb3e851577c2a97b3de4ddebf7202..79eb3d6977343e50e15e12746ac33ac01f505c28 100644 (file)
@@ -858,8 +858,7 @@ notmuch_database_open_verbose (const char *path,
     notmuch->status_string = NULL;
     notmuch->path = talloc_strdup (notmuch, path);
 
-    if (notmuch->path[strlen (notmuch->path) - 1] == '/')
-       notmuch->path[strlen (notmuch->path) - 1] = '\0';
+    strip_trailing(notmuch->path, '/');
 
     notmuch->mode = mode;
     notmuch->atomic_nesting = 0;