From fd2a061f6a30304e8b3ccccec175f3e02e2855ed Mon Sep 17 00:00:00 2001 From: Shamil Gumirov Date: Sat, 27 Mar 2021 17:35:12 +0100 Subject: [PATCH] Minor output fix to use quote_n() instead of quote() * src/ftp.c (ftp_retrieve_list): change quote to quote_n * src/iri.c (do_conversion): change quote to quote_n * src/url.c (convert_fname): change quote to quote_n The implementation quote() reuses the buffer it returns which leads to printing the same string for each quote() call in one output line. Instead, quote_n() should be used as highlighted in the doc: https://www.gnu.org/software/gnulib/manual/html_node/Quoting.html Copyright-paperwork-exempt: Yes --- src/ftp.c | 6 +++--- src/iri.c | 2 +- src/url.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ftp.c b/src/ftp.c index ab6802a6..a1fcaa50 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -2352,15 +2352,15 @@ The sizes do not match (local %s) -- retrieving.\n\n"), { logprintf (LOG_VERBOSE, _("\ Already have correct symlink %s -> %s\n\n"), - quote (con->target), - quote (f->linkto)); + quote_n (0, con->target), + quote_n (1, f->linkto)); dlthis = false; break; } } } logprintf (LOG_VERBOSE, _("Creating symlink %s -> %s\n"), - quote (con->target), quote (f->linkto)); + quote_n (0, con->target), quote_n (1, f->linkto)); /* Unlink before creating symlink! */ unlink (con->target); if (symlink (f->linkto, con->target) == -1) diff --git a/src/iri.c b/src/iri.c index 0d1b6567..e75974fe 100644 --- a/src/iri.c +++ b/src/iri.c @@ -138,7 +138,7 @@ do_conversion (const char *tocode, const char *fromcode, char const *in_org, siz if (cd == (iconv_t)(-1)) { logprintf (LOG_VERBOSE, _("Conversion from %s to %s isn't supported\n"), - quote (fromcode), quote (tocode)); + quote_n (0, fromcode), quote_n (1, tocode)); *out = NULL; return false; } diff --git a/src/url.c b/src/url.c index 8e7aa75e..d84849f8 100644 --- a/src/url.c +++ b/src/url.c @@ -1585,7 +1585,7 @@ convert_fname (char *fname) if (cd == (iconv_t) (-1)) { logprintf (LOG_VERBOSE, _ ("Conversion from %s to %s isn't supported\n"), - quote (from_encoding), quote (to_encoding)); + quote_n (0, from_encoding), quote_n (1, to_encoding)); return fname; }