diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-09 12:12:15 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-09 12:12:15 +0300 |
commit | b2e929c9fb31933cd4aeef841447c7db88db234c (patch) | |
tree | 8deae8b607b5aea9eda51dd3b5add1deb2f3c6ed | |
parent | b54a7ff7753b9607cab39086eb3be3ce5851874f (diff) |
GmCerts: Checking if an identity is in use
-rw-r--r-- | src/gmcerts.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gmcerts.c b/src/gmcerts.c index 6370057d..484f8766 100644 --- a/src/gmcerts.c +++ b/src/gmcerts.c | |||
@@ -145,7 +145,15 @@ iBool isUsedOn_GmIdentity(const iGmIdentity *d, const iString *url) { | |||
145 | size_t pos = iInvalidPos; | 145 | size_t pos = iInvalidPos; |
146 | locate_StringSet(d->useUrls, url, &pos); | 146 | locate_StringSet(d->useUrls, url, &pos); |
147 | if (pos < size_StringSet(d->useUrls)) { | 147 | if (pos < size_StringSet(d->useUrls)) { |
148 | return startsWithCase_String(url, cstr_String(constAt_StringSet(d->useUrls, pos))); | 148 | if (!cmpStringCase_String(url, constAt_StringSet(d->useUrls, pos))) { |
149 | return iTrue; | ||
150 | } | ||
151 | } | ||
152 | if (pos > 0) { | ||
153 | /* URLs with a longer path will be following the shorter URL(s). */ | ||
154 | if (startsWithCase_String(url, cstr_String(constAt_StringSet(d->useUrls, pos - 1)))) { | ||
155 | return iTrue; | ||
156 | } | ||
149 | } | 157 | } |
150 | return iFalse; | 158 | return iFalse; |
151 | } | 159 | } |