-/* $OpenBSD: extern.h,v 1.40 2021/08/29 13:43:46 claudio Exp $ */
+/* $OpenBSD: extern.h,v 1.41 2021/09/01 09:48:08 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
int no_motd; /* --no-motd */
int numeric_ids; /* --numeric-ids */
int one_file_system; /* -x */
- int from0; /* -0 */
char *rsync_path; /* --rsync-path */
char *ssh_prog; /* --rsh or -e */
char *port; /* --port */
int mktemplate(char **, const char *, int);
int parse_rule(char *line, enum rule_type);
-void parse_file(const char *, enum rule_type, int);
+void parse_file(const char *, enum rule_type);
void send_rules(struct sess *, int);
void recv_rules(struct sess *, int);
int rules_match(const char *, int);
-/* $OpenBSD: main.c,v 1.58 2021/08/30 20:25:01 job Exp $ */
+/* $OpenBSD: main.c,v 1.59 2021/09/01 09:48:08 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
{ "dry-run", no_argument, &opts.dry_run, 1 },
{ "exclude", required_argument, NULL, OP_EXCLUDE },
{ "exclude-from", required_argument, NULL, OP_EXCLUDE_FROM },
- { "from0", no_argument, NULL, '0' },
- { "no-from0", no_argument, &opts.from0, 0 },
{ "group", no_argument, &opts.preserve_gids, 1 },
{ "no-group", no_argument, &opts.preserve_gids, 0 },
{ "help", no_argument, NULL, 'h' },
while ((c = getopt_long(argc, argv, "Dae:ghlnoprtvxz", lopts, NULL))
!= -1) {
switch (c) {
- case '0':
- opts.from0 = 1;
- break;
case 'D':
opts.devices = 1;
opts.specials = 1;
optarg);
break;
case OP_EXCLUDE_FROM:
- parse_file(optarg, RULE_EXCLUDE,
- opts.from0 ? '\0' : '\n' );
+ parse_file(optarg, RULE_EXCLUDE);
break;
case OP_INCLUDE_FROM:
- parse_file(optarg, RULE_INCLUDE,
- opts.from0 ? '\0' : '\n' );
+ parse_file(optarg, RULE_INCLUDE);
break;
case OP_VERSION:
fprintf(stderr, "openrsync: protocol version %u\n",
/* by default and for --timeout=0 disable poll_timeout */
if (poll_timeout == 0)
- poll_timeout = -1;
- else
+ poll_timeout = -1; else
poll_timeout *= 1000;
/*
}
void
-parse_file(const char *file, enum rule_type def, int delim)
+parse_file(const char *file, enum rule_type def)
{
FILE *fp;
char *line = NULL;
if ((fp = fopen(file, "r")) == NULL)
err(ERR_SYNTAX, "open: %s", file);
- while ((linelen = getdelim(&line, &linesize, delim, fp)) != -1) {
+ while ((linelen = getline(&line, &linesize, fp)) != -1) {
linenum++;
line[linelen - 1] = '\0';
if (parse_rule(line, def) == -1)