test1574 test1575 test1576 test1577 test1578 test1579 test1580 test1581 \
\
test1590 test1591 test1592 test1593 test1594 test1595 test1596 test1597 \
-test1598 \
-test1600 test1601 test1602 test1603 test1604 test1605 test1606 test1607 \
-test1608 test1609 test1610 test1611 test1612 test1613 test1614 test1615 \
-test1616 \
+test1598 test1599 test1600 test1601 test1602 test1603 test1604 test1605 \
+test1606 test1607 test1608 test1609 test1610 test1611 test1612 test1613 \
+test1614 test1615 test1616 \
test1620 test1621 \
\
test1630 test1631 test1632 test1633 test1634 test1635 \
--- /dev/null
+<testcase>
+<info>
+<keywords>
+FTP
+netrc
+</keywords>
+</info>
+
+# Test based on GitHub issue 17659
+#
+# Server-side
+<reply>
+<data>
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+ftp
+</server>
+<name>
+FTP with netrc using no user but control code in password
+</name>
+<command>
+ftp://%HOSTIP:%FTPPORT/%TESTNUMBER log/netrc%TESTNUMBER
+</command>
+<tool>
+lib%TESTNUMBER
+</tool>
+<file name="log/netrc%TESTNUMBER" nonewline="yes">
+default passwor?dlogin anonymou\ ' password login anonymous passwor?d.'macdef
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+0
+</errorcode>
+</verify>
+</testcase>
--- /dev/null
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ * SPDX-License-Identifier: curl
+ *
+ ***************************************************************************/
+#include "test.h"
+
+#include "testtrace.h"
+
+static CURLcode test_lib1599(char *URL)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ global_init(CURL_GLOBAL_ALL);
+ curl = curl_easy_init();
+ if(curl) {
+ curl_easy_setopt(curl, CURLOPT_URL, URL);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_NETRC, (long)CURL_NETRC_REQUIRED);
+ curl_easy_setopt(curl, CURLOPT_NETRC_FILE, libtest_arg2);
+
+ res = curl_easy_perform(curl);
+ curl_easy_cleanup(curl);
+ }
+ curl_global_cleanup();
+ return res;
+}