]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Changed userdb +key=value to key+=value
authorTimo Sirainen <tss@iki.fi>
Mon, 27 Jun 2011 23:49:46 +0000 (02:49 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 27 Jun 2011 23:49:46 +0000 (02:49 +0300)
src/lib-storage/mail-storage-service.c

index 9067ea85aa1a73ef67ba2b93c306e2a1c55bdc97..8cfe94380ac6abce415330462292dae6fa956297 100644 (file)
@@ -108,6 +108,7 @@ static int set_line(struct mail_storage_service_ctx *ctx,
        struct setting_parser_context *set_parser = user->set_parser;
        bool mail_debug;
        const char *key, *orig_key, *append_value = NULL;
+       unsigned int len;
        int ret;
 
        mail_debug = mail_user_set_get_mail_debug(user->user_info,
@@ -116,9 +117,11 @@ static int set_line(struct mail_storage_service_ctx *ctx,
                line = t_strconcat(line, "=yes", NULL);
        orig_key = key = t_strcut(line, '=');
 
-       if (*key == '+') {
-               append_value = line + strlen(key) + 1;
-               key++;
+       len = strlen(key);
+       if (len > 0 && key[len-1] == '+') {
+               /* key+=value */
+               append_value = line + len + 1;
+               key = t_strndup(key, len-1);
                line++;
        }