-/* $OpenBSD: cert.c,v 1.148 2024/06/12 10:03:09 tb Exp $ */
+/* $OpenBSD: cert.c,v 1.149 2024/07/08 15:31:11 tb Exp $ */
/*
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2021 Job Snijders <job@openbsd.org>
goto out;
if (cert->repo == NULL && strncasecmp(carepo,
RSYNC_PROTO, RSYNC_PROTO_LEN) == 0) {
+ if (carepo[strlen(carepo) - 1] != '/') {
+ char *carepo_tmp;
+
+ if (asprintf(&carepo_tmp, "%s/",
+ carepo) == -1)
+ errx(1, NULL);
+ free(carepo);
+ carepo = carepo_tmp;
+ }
+
cert->repo = carepo;
carepo = NULL;
continue;