1 Return-Path: <jani@nikula.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id 60B996DE0318
\r
6 for <notmuch@notmuchmail.org>; Sun, 10 Apr 2016 12:44:55 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=-0.558 tagged_above=-999 required=5 tests=[AWL=0.162,
\r
12 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,
\r
13 RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled
\r
14 Received: from arlo.cworth.org ([127.0.0.1])
\r
15 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id 8oAW6XbvSnxj for <notmuch@notmuchmail.org>;
\r
17 Sun, 10 Apr 2016 12:44:47 -0700 (PDT)
\r
18 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com
\r
19 [74.125.82.66]) by arlo.cworth.org (Postfix) with ESMTPS id 0B3AC6DE02C6 for
\r
20 <notmuch@notmuchmail.org>; Sun, 10 Apr 2016 12:44:41 -0700 (PDT)
\r
21 Received: by mail-wm0-f66.google.com with SMTP id a140so16811877wma.2
\r
22 for <notmuch@notmuchmail.org>; Sun, 10 Apr 2016 12:44:41 -0700 (PDT)
\r
23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
24 d=nikula-org.20150623.gappssmtp.com; s=20150623;
\r
25 h=from:to:cc:subject:date:message-id:in-reply-to:references;
\r
26 bh=86TDUTEbDlV8CGHHO1dqy+YaduKPRR0cn6tN5KNFINk=;
\r
27 b=1jMKvYBbAtqCdt2xNtCoh2do7nbBNPawWNYl+RLFW87o5VBZW99QLbKwqkMCVOfuka
\r
28 IIamqMJOG7l+KWWrlRb1emt/Q3wKyFjGnuPcwPZ1OhYPd+Icbs/PmLGZ/f0iQ6nSWBfo
\r
29 PV7assZYyDH4fmN6Gri3iMkHzCpTgQCJu44pKMcKtQP2Wbp1XNq9tTHNBgrkvF9NlFxn
\r
30 r/UzzpIrw+eTZvnL7KjBaLKPTFIqqfRpoBHMDKnBT1/EezTUWjS13RTZv2HQyQq/f9gQ
\r
31 OLqR9xKOvOnr4Kd5Ir7anbkkpG+6PI+Up5Yd6BIXpKCh9DzKJHic2S5cjt+oCSuPNHji
\r
33 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
34 d=1e100.net; s=20130820;
\r
35 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
\r
37 bh=86TDUTEbDlV8CGHHO1dqy+YaduKPRR0cn6tN5KNFINk=;
\r
38 b=GczvSy4sDCDWBql/puVaTzAk8XIKfm3CFgFGlgdTbWrzvTksn1O4oRfhgFsAcTM6bE
\r
39 RIcxHImHQLdP7AFD/UYe5ov93N8WQj3Lhjsb8QotjlDJWn2uPK+XsLdyBlWCJFCFns3M
\r
40 7V/ljIhPSNlWgdMXwMJ39YzQxqsV+1GAQOAew/AfUZkzZjI956cR5AwZykZMaDQl763g
\r
41 Lnt0uRxZnIk/HBWdUglIjJliHElXErH4avagMbuHHx88xhblqumLpuvrCoZsgUJJY7s/
\r
42 NCWjniQWsVFhn5E6cBzhzgBXxt327Z461S9zRp5lMu6ECbhnRACZDubh48UQpaX/pmfN
\r
45 AD7BkJLEmTGFtnsdAtLI0ADgZxsUe/MlHs+vysbY4iRtox3BpzOafehMaFxFdV5m5TARSA==
\r
46 X-Received: by 10.28.58.77 with SMTP id h74mr14264048wma.82.1460317480615;
\r
47 Sun, 10 Apr 2016 12:44:40 -0700 (PDT)
\r
48 Received: from localhost (mobile-access-bcee7f-102.dhcp.inet.fi.
\r
50 by smtp.gmail.com with ESMTPSA id o128sm13596863wmb.19.2016.04.10.12.44.39
\r
51 (version=TLSv1/SSLv3 cipher=OTHER);
\r
52 Sun, 10 Apr 2016 12:44:40 -0700 (PDT)
\r
53 From: Jani Nikula <jani@nikula.org>
\r
54 To: notmuch@notmuchmail.org
\r
55 Subject: [PATCH 3/3] lib: clean up _notmuch_database_split_path
\r
56 Date: Sun, 10 Apr 2016 22:43:23 +0300
\r
57 Message-Id: <1460317403-13714-3-git-send-email-jani@nikula.org>
\r
58 X-Mailer: git-send-email 2.1.4
\r
59 In-Reply-To: <1460317403-13714-1-git-send-email-jani@nikula.org>
\r
60 References: <1460317403-13714-1-git-send-email-jani@nikula.org>
\r
61 X-BeenThere: notmuch@notmuchmail.org
\r
62 X-Mailman-Version: 2.1.20
\r
64 List-Id: "Use and development of the notmuch mail system."
\r
65 <notmuch.notmuchmail.org>
\r
66 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
69 List-Post: <mailto:notmuch@notmuchmail.org>
\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
71 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
72 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
73 X-List-Received-Date: Sun, 10 Apr 2016 19:44:55 -0000
\r
75 Make the logic it a bit easier to read. No functional changes.
\r
77 lib/database.cc | 17 +++--------------
\r
78 1 file changed, 3 insertions(+), 14 deletions(-)
\r
80 diff --git a/lib/database.cc b/lib/database.cc
\r
81 index b8486f7d5271..c8c5e26106ad 100644
\r
82 --- a/lib/database.cc
\r
83 +++ b/lib/database.cc
\r
84 @@ -1761,18 +1761,11 @@ _notmuch_database_split_path (void *ctx,
\r
85 slash = path + strlen (path) - 1;
\r
87 /* First, skip trailing slashes. */
\r
88 - while (slash != path) {
\r
89 - if (*slash != '/')
\r
92 + while (slash != path && *slash == '/')
\r
96 /* Then, find a slash. */
\r
97 - while (slash != path) {
\r
98 - if (*slash == '/')
\r
101 + while (slash != path && *slash != '/') {
\r
105 @@ -1780,12 +1773,8 @@ _notmuch_database_split_path (void *ctx,
\r
108 /* Finally, skip multiple slashes. */
\r
109 - while (slash != path) {
\r
110 - if (*(slash - 1) != '/')
\r
113 + while (slash != path && *(slash - 1) == '/')
\r
117 if (slash == path) {
\r