aboutsummaryrefslogtreecommitdiff
path: root/src/directive.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-04-30 00:50:23 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-04-30 00:50:23 +0300
commit757f98a5805a91c34f70bf090c01e6a9be235716 (patch)
tree8591b594212b5158c67ade4b4cbd2f4fdce8f29f /src/directive.c
parent40c0dbacb40fbd5fa3d1f92e18c99f38004aa0d0 (diff)
downloadwydawca-757f98a5805a91c34f70bf090c01e6a9be235716.tar.gz
wydawca-757f98a5805a91c34f70bf090c01e6a9be235716.tar.bz2
Change replace handling
* src/wydawca.h (struct wy_triplet): New member: replace_allowed * src/directive.c (process_directives): Set trp->replace_allowed depending on the directive file version and the "replace" directive. * src/diskio.c (backup_copy): Use trp->replace_allowed * tests/Makefile.am: Add new tests. * tests/testsuite.at: Include new tests. * tests/upload03.at: New test. * tests/upload04.at: New test. * tests/upload05.at: New test.
Diffstat (limited to 'src/directive.c')
-rw-r--r--src/directive.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/directive.c b/src/directive.c
index bb5ce4b..c621b3f 100644
--- a/src/directive.c
+++ b/src/directive.c
@@ -726,6 +726,8 @@ process_directives(struct wy_triplet *trp)
case version_dir:
/* Already processed. See directive_version_in_range_p,
* called by verify_directive_format */
+ if (trp->version < 102)
+ trp->replace_allowed = 1;
break;
case archive_dir:
@@ -748,7 +750,10 @@ process_directives(struct wy_triplet *trp)
wy_log(LOG_ERR,
_("\"replace\" directive is invalid "
"for version %d"), trp->version);
- }
+ } else if (strcmp(val, "true") == 0)
+ trp->replace_allowed = 1;
+ else
+ trp->replace_allowed = 0;
}
}

Return to:

Send suggestions and report system problems to the System administrator.