diff options
Diffstat (limited to 'src/gmcerts.c')
-rw-r--r-- | src/gmcerts.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gmcerts.c b/src/gmcerts.c index 345c36e0..ed4759be 100644 --- a/src/gmcerts.c +++ b/src/gmcerts.c | |||
@@ -146,6 +146,7 @@ iBool isUsed_GmIdentity(const iGmIdentity *d) { | |||
146 | } | 146 | } |
147 | 147 | ||
148 | iBool isUsedOn_GmIdentity(const iGmIdentity *d, const iString *url) { | 148 | iBool isUsedOn_GmIdentity(const iGmIdentity *d, const iString *url) { |
149 | #if 0 | ||
149 | size_t pos = iInvalidPos; | 150 | size_t pos = iInvalidPos; |
150 | locate_StringSet(d->useUrls, url, &pos); | 151 | locate_StringSet(d->useUrls, url, &pos); |
151 | if (pos < size_StringSet(d->useUrls)) { | 152 | if (pos < size_StringSet(d->useUrls)) { |
@@ -159,6 +160,12 @@ iBool isUsedOn_GmIdentity(const iGmIdentity *d, const iString *url) { | |||
159 | return iTrue; | 160 | return iTrue; |
160 | } | 161 | } |
161 | } | 162 | } |
163 | #endif | ||
164 | iConstForEach(StringSet, i, d->useUrls) { | ||
165 | if (startsWithCase_String(url, cstr_String(i.value))) { | ||
166 | return iTrue; | ||
167 | } | ||
168 | } | ||
162 | return iFalse; | 169 | return iFalse; |
163 | } | 170 | } |
164 | 171 | ||
@@ -193,7 +200,13 @@ void setUse_GmIdentity(iGmIdentity *d, const iString *url, iBool use) { | |||
193 | iAssert(wasInserted); | 200 | iAssert(wasInserted); |
194 | } | 201 | } |
195 | else { | 202 | else { |
196 | remove_StringSet(d->useUrls, url); | 203 | iForEach(Array, i, &d->useUrls->strings.values) { |
204 | iString *used = i.value; | ||
205 | if (startsWithCase_String(url, cstr_String(used))) { | ||
206 | deinit_String(used); | ||
207 | remove_ArrayIterator(&i); | ||
208 | } | ||
209 | } | ||
197 | } | 210 | } |
198 | } | 211 | } |
199 | 212 | ||
@@ -202,6 +215,7 @@ void clearUse_GmIdentity(iGmIdentity *d) { | |||
202 | } | 215 | } |
203 | 216 | ||
204 | const iString *findUse_GmIdentity(const iGmIdentity *d, const iString *url) { | 217 | const iString *findUse_GmIdentity(const iGmIdentity *d, const iString *url) { |
218 | if (!d) return NULL; | ||
205 | iConstForEach(StringSet, using, d->useUrls) { | 219 | iConstForEach(StringSet, using, d->useUrls) { |
206 | if (startsWith_String(url, cstr_String(using.value))) { | 220 | if (startsWith_String(url, cstr_String(using.value))) { |
207 | return using.value; | 221 | return using.value; |