Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
96d3590
)
Fixed a potential problem parsing the "!" token from a word-split string.
author
Wayne Davison
<wayned@samba.org>
Tue, 13 Apr 2004 19:07:21 +0000
(19:07 +0000)
committer
Wayne Davison
<wayned@samba.org>
Tue, 13 Apr 2004 19:07:21 +0000
(19:07 +0000)
exclude.c
patch
|
blob
|
blame
|
history
diff --git
a/exclude.c
b/exclude.c
index
9fa8319
..
16ab02d
100644
(file)
--- a/
exclude.c
+++ b/
exclude.c
@@
-236,13
+236,15
@@
int check_exclude(struct exclude_struct **list, char *name, int name_is_dir)
static const char *get_exclude_tok(const char *p, int *len_ptr, int *incl_ptr,
int xflags)
{
static const char *get_exclude_tok(const char *p, int *len_ptr, int *incl_ptr,
int xflags)
{
- const unsigned char *s = (unsigned char *)p;
+ const unsigned char *s = (
const
unsigned char *)p;
int len;
if (xflags & XFLG_WORD_SPLIT) {
/* Skip over any initial whitespace. */
while (isspace(*s))
s++;
int len;
if (xflags & XFLG_WORD_SPLIT) {
/* Skip over any initial whitespace. */
while (isspace(*s))
s++;
+ /* Update for "!" check. */
+ p = (const char *)s;
}
/* Is this a '+' or '-' followed by a space (not whitespace)? */
}
/* Is this a '+' or '-' followed by a space (not whitespace)? */
@@
-262,8
+264,7
@@
static const char *get_exclude_tok(const char *p, int *len_ptr, int *incl_ptr,
} else
len = strlen(s);
} else
len = strlen(s);
- if (*s == '!' && len == 1 && !(xflags & XFLG_NO_PREFIXES)
- && (const char *)s == p)
+ if (*p == '!' && len == 1 && !(xflags & XFLG_NO_PREFIXES))
*incl_ptr = -1;
*len_ptr = len;
*incl_ptr = -1;
*len_ptr = len;