From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:203:b4db::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aJ1dKbYdx2Hn7wAAgWs5BA (envelope-from ) for ; Sat, 25 Dec 2021 14:33:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id SHymJrYdx2E5AwEA9RJhRA (envelope-from ) for ; Sat, 25 Dec 2021 14:33:42 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6077C23CA8 for ; Sat, 25 Dec 2021 14:33:42 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 9327E5F728; Sat, 25 Dec 2021 13:33:33 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 2659E5F71A for ; Sat, 25 Dec 2021 13:33:30 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 7170C5FC48; Sat, 25 Dec 2021 08:33:29 -0500 (EST) Received: (nullmailer pid 3014295 invoked by uid 1000); Sat, 25 Dec 2021 13:33:27 -0000 From: David Bremner To: David Bremner , notmuch@notmuchmail.org Subject: [PATCH 5/6] lib/config: make sure the config map exists when loading defaults Date: Sat, 25 Dec 2021 09:33:04 -0400 Message-Id: <20211225133305.3014272-3-david@tethera.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211225133305.3014272-1-david@tethera.net> References: <20211211124912.1823559-2-david@tethera.net> <20211225133305.3014272-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: HR5POVZMNID37GVYNPHYPQKLKFSJBX5H X-Message-ID-Hash: HR5POVZMNID37GVYNPHYPQKLKFSJBX5H X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640439222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=1wBtBMDomKcdzsuMwR3f1IqRJPxSxkwvHta5l/kVZSo=; b=oyrKyGRRBfs7rjuFTz6fEJeIfROMRnFGMQRVNzvoVGlDa7QAzrb828Wyn0vDfDbAr3OAHW wveXfsDpkQRVkUVBpvHU5AhM16F3eqFoCoekzszhJZF3eCu+fc9LrZXHkkUnMluFgepCRR 5gYLNWzFwpOltr1eOkzHyg0BgoG1oZw0HVLjH5gQw0SCHFsBP5efgHYhFeXW5wQoXlGEwI hekTWUNuSzton5rdbGDNeAJmm3T1yLABfLehuqL14G0A7TzW9OJQXbT+5VTtS0+b9GYp77 OxkvyBWtmG7SnU6fx3li3DB61guxIDVpsnHirbDWhqrIKihSaDozpusT/tVh4g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640439222; a=rsa-sha256; cv=none; b=mwVUX6UHt6hg1FMVCDQe5yXpThJUqj2Y2nnQt8Iq3dVLgklkLz60MjY8FmQhp4vyQGpCUk 116CjeuA2ROPeLMlmHFJINzf4XusBJQbiLSxmiOGREDSmZOjjrg5cw+Mxqkg1xtT8vrLta f+5J2LCjdsm+La8q2FMaGt3EwAuoHGqZPsFlfvafT1T6szKeHK42Hfdy9zkfa+R+DEfD7w GELpKFVfyQFXm4ppMIJbc4FT/pdVeZT8T4RfpgmQmZtSk0sLlZtaSBpO4dwSjwDkZw5+b6 NSAo/f6BOeyDaWtVBLNJ18M8ZgctGmwNbMO40PDI6c7decun3Ga0nwAeU7cSKQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.74 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 6077C23CA8 X-Spam-Score: -1.74 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0BhBW+OSJ9yp We should not rely on one of the other "_notmuch_config_load_*" functions being called before this one. --- lib/config.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/config.cc b/lib/config.cc index 7a2882de..8f6ef110 100644 --- a/lib/config.cc +++ b/lib/config.cc @@ -658,6 +658,9 @@ _notmuch_config_load_defaults (notmuch_database_t *notmuch) { notmuch_config_key_t key; + if (notmuch->config == NULL) + notmuch->config = _notmuch_string_map_create (notmuch); + for (key = NOTMUCH_CONFIG_FIRST; key < NOTMUCH_CONFIG_LAST; key = notmuch_config_key_t (key + 1)) { -- 2.34.1