]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Fixed using -n "" parameter
authorTimo Sirainen <tss@iki.fi>
Mon, 7 Apr 2014 21:08:21 +0000 (00:08 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 7 Apr 2014 21:08:21 +0000 (00:08 +0300)
src/doveadm/dsync/dsync-brain.c

index c061d0ebec3a3eb0d0c0fd65f97fc6ca00534f91..67acc861ef5228a891d7287338506bb08c911eb5 100644 (file)
@@ -410,6 +410,12 @@ static bool dsync_brain_slave_recv_handshake(struct dsync_brain *brain)
        if (ibc_set->sync_ns_prefixes != NULL) {
                p_array_init(&brain->sync_namespaces, brain->pool, 4);
                prefixes = t_strsplit(ibc_set->sync_ns_prefixes, "\n");
+               if (prefixes[0] == NULL) {
+                       /* ugly workaround for strsplit API: there was one
+                          prefix="" entry */
+                       static const char *empty_prefix[] = { "", NULL };
+                       prefixes = empty_prefix;
+               }
                for (; *prefixes != NULL; prefixes++) {
                        ns = mail_namespace_find(brain->user->namespaces,
                                                 *prefixes);