]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Hooks weren't called exactly in the order they were intended.
authorTimo Sirainen <tss@iki.fi>
Fri, 1 Nov 2013 14:43:53 +0000 (16:43 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 1 Nov 2013 14:43:53 +0000 (16:43 +0200)
The comparison didn't skip the paths, so the "lib" prefix skipping didn't
work.

src/lib-storage/mail-storage-hooks.c

index c553ca4132421ae51ab1fd43ef94dead81c1f08a..7e642b5b635869e158727557981d433c721ec391 100644 (file)
@@ -121,6 +121,12 @@ mail_storage_module_hooks_cmp(const struct mail_storage_module_hooks *h1,
                              const struct mail_storage_module_hooks *h2)
 {
        const char *s1 = h1->module->path, *s2 = h2->module->path;
+       const char *p;
+
+       p = strrchr(s1, '/');
+       if (p != NULL) s1 = p+1;
+       p = strrchr(s2, '/');
+       if (p != NULL) s2 = p+1;
 
        if (strncmp(s1, "lib", 3) == 0)
                s1 += 3;