Add missing newlines to PQescapeInternal() messages pre-v16.
authorTom Lane <[email protected]>
Thu, 1 May 2025 21:36:47 +0000 (17:36 -0400)
committerTom Lane <[email protected]>
Thu, 1 May 2025 21:36:47 +0000 (17:36 -0400)
While back-patching 9f45e6a91, I neglected that the convention in
pre-v16 libpq was to include a trailing newline in error message
strings (since then, we add those separately).  Add them now.

Reported-by: Peter Eisentraut <[email protected]>
Discussion: https://postgr.es/m/a9c837ad-d507-4607-94e4-c5743a8f49e0@eisentraut.org
Backpatch-through: 13-15

src/interfaces/libpq/fe-exec.c

index 14d6743f083f3ac14f8dd691c99b297f4c2e474e..526e51abf6364051141209db8132714ab2b17ece 100644 (file)
@@ -4017,10 +4017,10 @@ PQescapeStringInternal(PGconn *conn,
            {
                if (remaining < charlen)
                    appendPQExpBufferStr(&conn->errorMessage,
-                                        libpq_gettext("incomplete multibyte character"));
+                                        libpq_gettext("incomplete multibyte character\n"));
                else
                    appendPQExpBufferStr(&conn->errorMessage,
-                                        libpq_gettext("invalid multibyte character"));
+                                        libpq_gettext("invalid multibyte character\n"));
                /* Issue a complaint only once per string */
                already_complained = true;
            }