From: claudio Date: Wed, 1 Sep 2021 09:48:08 +0000 (+0000) Subject: Remove from0 support. openrsync will not implement all bad ideas that X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0345af144f1d9b37bda449efae4f9cd700194f6a;p=openbsd Remove from0 support. openrsync will not implement all bad ideas that were added to rsync. from0 is one of those and really not needed. OK job@ --- diff --git a/usr.bin/rsync/extern.h b/usr.bin/rsync/extern.h index 4681d47fa24..2815f82cf89 100644 --- a/usr.bin/rsync/extern.h +++ b/usr.bin/rsync/extern.h @@ -1,4 +1,4 @@ -/* $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 * @@ -131,7 +131,6 @@ struct opts { 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 */ @@ -379,7 +378,7 @@ char *mkstempsock(const char *, char *); 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); diff --git a/usr.bin/rsync/main.c b/usr.bin/rsync/main.c index f45a31ac865..06606c07674 100644 --- a/usr.bin/rsync/main.c +++ b/usr.bin/rsync/main.c @@ -1,4 +1,4 @@ -/* $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 * @@ -292,8 +292,6 @@ const struct option lopts[] = { { "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' }, @@ -344,9 +342,6 @@ main(int argc, char *argv[]) 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; @@ -423,12 +418,10 @@ main(int argc, char *argv[]) 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", @@ -453,8 +446,7 @@ main(int argc, char *argv[]) /* by default and for --timeout=0 disable poll_timeout */ if (poll_timeout == 0) - poll_timeout = -1; - else + poll_timeout = -1; else poll_timeout *= 1000; /* diff --git a/usr.bin/rsync/rules.c b/usr.bin/rsync/rules.c index c34e7d94365..c9e884093ca 100644 --- a/usr.bin/rsync/rules.c +++ b/usr.bin/rsync/rules.c @@ -223,7 +223,7 @@ parse_rule(char *line, enum rule_type def) } 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; @@ -233,7 +233,7 @@ parse_file(const char *file, enum rule_type def, int delim) 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)