- switch (n.character[0])
- {
- case '*':
- {
- int currentLength;
-
- ++n.character;
- --n.length;
- /* The greedy match is not yet well tested. Some day we may */
- /* need to refer to the matched parts, so the code is already */
- /* prepared for that. */
-#if 1
- /* greedy match */
- currentLength=h.length;
- h.character+=h.length;
- h.length=0;
- while (h.length<=currentLength)
- {
- if (eq_octetglob(&n,&h)) return 1;
- else /* go back one octet */
- {
- --h.character;
- ++h.length;
- }
- }
- return 0;
-#else
- /* minimal match */
- while (h.length)
- {
- if (eq_octetglob(&n,&h)) return 1;
- else /* advance one octet */
- {
- ++h.character;
- --h.length;
- }
- }
- break;
-#endif
- }
- case '?':
- {
- if (h.length)
- {
- ++h.character;
- --h.length;
- ++n.character;
- --n.length;
- }
- else return 0;
- break;
- }
- case '\\':
- {
- ++n.character;
- --n.length;
- /* FALLTHROUGH */
- }
- default:
- {
- if
- (
- h.length==0 ||
-#if !HAVE_ICONV
- (h.character[0]&0x80) || (n.character[0]&0x80) ||
-#endif
- h.character[0]!=n.character[0]
- ) return 0;
- else
- {
- ++h.character;
- --h.length;
- ++n.character;
- --n.length;
- };
- }