Deleted Added
full compact
fnmatch.c (19132) fnmatch.c (19276)
1/*
2 * Copyright (c) 1989, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Guido van Rossum.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 31 unchanged lines hidden (view full) ---

40
41/*
42 * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6.
43 * Compares a filename or pathname to a pattern.
44 */
45
46#include <ctype.h>
47#include <fnmatch.h>
1/*
2 * Copyright (c) 1989, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Guido van Rossum.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 31 unchanged lines hidden (view full) ---

40
41/*
42 * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6.
43 * Compares a filename or pathname to a pattern.
44 */
45
46#include <ctype.h>
47#include <fnmatch.h>
48#include <locale.h>
49#include <string.h>
50#include <stdio.h>
51
48#include <string.h>
49#include <stdio.h>
50
51#include "collate.h"
52
52#define EOS '\0'
53
54static const char *rangematch __P((const char *, char, int));
55
56int
57fnmatch(pattern, string, flags)
58 const char *pattern, *string;
59 int flags;

--- 121 unchanged lines hidden (view full) ---

181 if (c2 == '\\' && !(flags & FNM_NOESCAPE))
182 c2 = *pattern++;
183 if (c2 == EOS)
184 return (NULL);
185
186 if (flags & FNM_CASEFOLD)
187 c2 = tolower((unsigned char)c2);
188
53#define EOS '\0'
54
55static const char *rangematch __P((const char *, char, int));
56
57int
58fnmatch(pattern, string, flags)
59 const char *pattern, *string;
60 int flags;

--- 121 unchanged lines hidden (view full) ---

182 if (c2 == '\\' && !(flags & FNM_NOESCAPE))
183 c2 = *pattern++;
184 if (c2 == EOS)
185 return (NULL);
186
187 if (flags & FNM_CASEFOLD)
188 c2 = tolower((unsigned char)c2);
189
189 if ( collate_range_cmp(c, test) <= 0
190 && collate_range_cmp(test, c2) <= 0
190 if ( __collate_range_cmp(c, test) <= 0
191 && __collate_range_cmp(test, c2) <= 0
191 )
192 ok = 1;
193 } else if (c == test)
194 ok = 1;
195 }
196 return (ok == negate ? NULL : pattern);
197}
192 )
193 ok = 1;
194 } else if (c == test)
195 ok = 1;
196 }
197 return (ok == negate ? NULL : pattern);
198}