OLD | NEW |
1 /* ***** BEGIN LICENSE BLOCK ***** | 1 /* ***** BEGIN LICENSE BLOCK ***** |
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
3 * | 3 * |
4 * The contents of this file are subject to the Mozilla Public License Version | 4 * The contents of this file are subject to the Mozilla Public License Version |
5 * 1.1 (the "License"); you may not use this file except in compliance with | 5 * 1.1 (the "License"); you may not use this file except in compliance with |
6 * the License. You may obtain a copy of the License at | 6 * the License. You may obtain a copy of the License at |
7 * http://www.mozilla.org/MPL/ | 7 * http://www.mozilla.org/MPL/ |
8 * | 8 * |
9 * Software distributed under the License is distributed on an "AS IS" basis, | 9 * Software distributed under the License is distributed on an "AS IS" basis, |
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 /* Find the closing parenthesis that ends this union in the expression */ | 198 /* Find the closing parenthesis that ends this union in the expression */ |
199 cp = _scan_and_copy(exp, ')', '\0', NULL); | 199 cp = _scan_and_copy(exp, ')', '\0', NULL); |
200 if (cp == ABORTED || cp < 4) /* must be at least "(a|b" before ')' */ | 200 if (cp == ABORTED || cp < 4) /* must be at least "(a|b" before ')' */ |
201 return ABORTED; | 201 return ABORTED; |
202 ++cp; /* now index of char after closing parenthesis */ | 202 ++cp; /* now index of char after closing parenthesis */ |
203 e2 = (char *) PORT_Alloc(1 + strlen(exp)); | 203 e2 = (char *) PORT_Alloc(1 + strlen(exp)); |
204 if (!e2) | 204 if (!e2) |
205 return ABORTED; | 205 return ABORTED; |
206 for (sx = 1; ; ++sx) { | 206 for (sx = 1; ; ++sx) { |
207 » /* Here, exp[sx] is one character past the preceeding '(' or '|'. */ | 207 » /* Here, exp[sx] is one character past the preceding '(' or '|'. */ |
208 /* Copy everything up to the next delimiter to e2 */ | 208 /* Copy everything up to the next delimiter to e2 */ |
209 count = _scan_and_copy(exp + sx, ')', '|', e2); | 209 count = _scan_and_copy(exp + sx, ')', '|', e2); |
210 if (count == ABORTED || !count) { | 210 if (count == ABORTED || !count) { |
211 ret = ABORTED; | 211 ret = ABORTED; |
212 break; | 212 break; |
213 } | 213 } |
214 sx += count; | 214 sx += count; |
215 /* Append everything after closing parenthesis to e2. This is safe. */ | 215 /* Append everything after closing parenthesis to e2. This is safe. */ |
216 strcpy(e2+count, exp+cp); | 216 strcpy(e2+count, exp+cp); |
217 ret = _shexp_match(str, e2, case_insensitive, level + 1); | 217 ret = _shexp_match(str, e2, case_insensitive, level + 1); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 { | 403 { |
404 case INVALID_SXP: | 404 case INVALID_SXP: |
405 return -1; | 405 return -1; |
406 case NON_SXP: | 406 case NON_SXP: |
407 return (PORT_Strcasecmp(exp,str) ? 1 : 0); | 407 return (PORT_Strcasecmp(exp,str) ? 1 : 0); |
408 default: | 408 default: |
409 return port_RegExpMatch(str, exp, PR_TRUE); | 409 return port_RegExpMatch(str, exp, PR_TRUE); |
410 } | 410 } |
411 } | 411 } |
412 | 412 |
OLD | NEW |