aboutsummaryrefslogtreecommitdiff
path: root/src/modules/extra/m_pgsql.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2025-12-03 17:26:28 +0000
committerGravatar Sadie Powell2025-12-03 17:26:28 +0000
commitfdda1b1fa03903afa77daf9f0bf92ec6c9a9440f (patch)
tree1c530243bdcbccdf854a8792a61df9343b249108 /src/modules/extra/m_pgsql.cpp
parentFix the <autoconnect> indentation in the example link config. (diff)
parentStrip all newline characters from the PostgreSQL error message. (diff)
Merge branch 'insp3' into insp4.
Diffstat (limited to 'src/modules/extra/m_pgsql.cpp')
-rw-r--r--src/modules/extra/m_pgsql.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index 24a6de9b7..3ef1fcd78 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -409,7 +409,10 @@ restart:
case PGRES_BAD_RESPONSE:
case PGRES_FATAL_ERROR:
{
- SQL::Error err(SQL::QREPLY_FAIL, PQresultErrorMessage(result));
+ std::string errmsg = PQresultErrorMessage(result);
+ for (size_t pos = 0; ((pos = errmsg.find_first_of("\r\n", pos)) != std::string::npos); )
+ errmsg[pos] = ' ';
+ SQL::Error err(SQL::QREPLY_FAIL, errmsg);
qinprog.c->OnError(err);
break;
}