From e16402a1021c30810d2b0c031a6d02067153d76c Mon Sep 17 00:00:00 2001 From: alex-z Date: Fri, 24 Sep 2021 12:33:01 +0200 Subject: [PATCH 1/2] Fix incorrect db name for nextcloud command line client. Signed-off-by: alex-z --- src/cmd/cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index da092807b..38e8d7091 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -350,7 +350,7 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - QUrl hostUrl = QUrl::fromUserInput(options.target_url); + QUrl hostUrl = QUrl::fromUserInput(options.target_url.endsWith('/') ? options.target_url.chopped(1) : options.target_url); // Order of retrieval attempt (later attempts override earlier ones): // 1. From URL From dc22307a42e9d1b4be4759b339e0381b9b8337a6 Mon Sep 17 00:00:00 2001 From: alex-z Date: Sat, 25 Sep 2021 11:59:12 +0300 Subject: [PATCH 2/2] Fix review comments + also check against trailing bakslash. Signed-off-by: alex-z --- src/cmd/cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index 38e8d7091..b706a382b 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -350,7 +350,7 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - QUrl hostUrl = QUrl::fromUserInput(options.target_url.endsWith('/') ? options.target_url.chopped(1) : options.target_url); + QUrl hostUrl = QUrl::fromUserInput((options.target_url.endsWith(QLatin1Char('/')) || options.target_url.endsWith(QLatin1Char('\\'))) ? options.target_url.chopped(1) : options.target_url); // Order of retrieval attempt (later attempts override earlier ones): // 1. From URL