=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rsync/rules.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -c -r1.2 -r1.2.2.1 *** src/usr.bin/rsync/rules.c 2021/09/01 09:48:08 1.2 --- src/usr.bin/rsync/rules.c 2021/11/09 13:40:41 1.2.2.1 *************** *** 1,3 **** --- 1,19 ---- + /* $OpenBSD: rules.c,v 1.2.2.1 2021/11/09 13:40:41 benno Exp $ */ + /* + * Copyright (c) 2021 Claudio Jeker + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ #include #include #include *************** *** 7,15 **** struct rule { char *pattern; ! enum rule_type type; #ifdef NOTYET ! unsigned int modifiers; #endif short numseg; unsigned char anchored; --- 23,31 ---- struct rule { char *pattern; ! enum rule_type type; #ifdef NOTYET ! unsigned int modifiers; #endif short numseg; unsigned char anchored; *************** *** 110,116 **** { const char *mod; size_t i; ! mod = memchr(command, ',', len); if (mod != NULL) { /* XXX modifiers not yet implemented */ --- 126,132 ---- { const char *mod; size_t i; ! mod = memchr(command, ',', len); if (mod != NULL) { /* XXX modifiers not yet implemented */ *************** *** 163,169 **** nseg++; r->numseg = nseg; ! /* check if this pattern only matches against the basename */ if (nseg == 1 && !r->anchored) r->fileonly = 1; --- 179,185 ---- nseg++; r->numseg = nseg; ! /* check if this pattern only matches against the basename */ if (nseg == 1 && !r->anchored) r->fileonly = 1; *************** *** 205,211 **** return -1; type = def; pattern = line; ! } else pattern = line + len + 1; if (*pattern == '\0' && type != RULE_CLEAR) --- 221,227 ---- return -1; type = def; pattern = line; ! } else pattern = line + len + 1; if (*pattern == '\0' && type != RULE_CLEAR) *************** *** 396,407 **** struct rule *r; size_t i; ! basename = strrchr(path, '/'); if (basename != NULL) basename += 1; else basename = path; ! for (i = 0; i < numrules; i++) { r = &rules[i]; --- 412,423 ---- struct rule *r; size_t i; ! basename = strrchr(path, '/'); if (basename != NULL) basename += 1; else basename = path; ! for (i = 0; i < numrules; i++) { r = &rules[i];