Thread: Added \n to libpq prints

Added \n to libpq prints

From
Bruce Momjian
Date:
I added some missing \n's to libpq error output.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
Index: src/interfaces/libpq/fe-auth.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v
retrieving revision 1.52
diff -c -r1.52 fe-auth.c
*** src/interfaces/libpq/fe-auth.c    2001/08/17 03:09:31    1.52
--- src/interfaces/libpq/fe-auth.c    2001/08/17 14:59:51
***************
*** 285,291 ****
      if (retval)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  "pg_krb5_init: krb5_init_context: %s",
                   error_message(retval));
          return STATUS_ERROR;
      }
--- 285,291 ----
      if (retval)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  "pg_krb5_init: krb5_init_context: %s\n",
                   error_message(retval));
          return STATUS_ERROR;
      }
***************
*** 294,300 ****
      if (retval)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  "pg_krb5_init: krb5_cc_default: %s",
                   error_message(retval));
          krb5_free_context(pg_krb5_context);
          return STATUS_ERROR;
--- 294,300 ----
      if (retval)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  "pg_krb5_init: krb5_cc_default: %s\n",
                   error_message(retval));
          krb5_free_context(pg_krb5_context);
          return STATUS_ERROR;
***************
*** 305,311 ****
      if (retval)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  "pg_krb5_init: krb5_cc_get_principal: %s",
                   error_message(retval));
          krb5_cc_close(pg_krb5_context, pg_krb5_ccache);
          krb5_free_context(pg_krb5_context);
--- 305,311 ----
      if (retval)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  "pg_krb5_init: krb5_cc_get_principal: %s\n",
                   error_message(retval));
          krb5_cc_close(pg_krb5_context, pg_krb5_ccache);
          krb5_free_context(pg_krb5_context);
***************
*** 316,322 ****
      if (retval)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  "pg_krb5_init: krb5_unparse_name: %s",
                   error_message(retval));
          krb5_free_principal(pg_krb5_context, pg_krb5_client);
          krb5_cc_close(pg_krb5_context, pg_krb5_ccache);
--- 316,322 ----
      if (retval)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  "pg_krb5_init: krb5_unparse_name: %s\n",
                   error_message(retval));
          krb5_free_principal(pg_krb5_context, pg_krb5_client);
          krb5_cc_close(pg_krb5_context, pg_krb5_ccache);
***************
*** 371,377 ****
      if (retval)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  "pg_krb5_sendauth: krb5_sname_to_principal: %s",
                   error_message(retval));
          return STATUS_ERROR;
      }
--- 371,377 ----
      if (retval)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  "pg_krb5_sendauth: krb5_sname_to_principal: %s\n",
                   error_message(retval));
          return STATUS_ERROR;
      }
***************
*** 385,391 ****
      if (flags < 0 || fcntl(sock, F_SETFL, (long) (flags & ~O_NONBLOCK)))
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  libpq_gettext("could not set socket to blocking mode: %s"), strerror(errno));
          krb5_free_principal(pg_krb5_context, server);
          return STATUS_ERROR;
      }
--- 385,391 ----
      if (flags < 0 || fcntl(sock, F_SETFL, (long) (flags & ~O_NONBLOCK)))
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  libpq_gettext("could not set socket to blocking mode: %s\n"), strerror(errno));
          krb5_free_principal(pg_krb5_context, server);
          return STATUS_ERROR;
      }
***************
*** 401,414 ****
          if (retval == KRB5_SENDAUTH_REJECTED && err_ret)
          {
              snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                      libpq_gettext("Kerberos 5 authentication rejected: %*s"),
                       err_ret->text.length, err_ret->text.data);
          }
          else
          {
              snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                      "krb5_sendauth: %s",
!                      error_message(retval));
          }

          if (err_ret)
--- 401,413 ----
          if (retval == KRB5_SENDAUTH_REJECTED && err_ret)
          {
              snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                      libpq_gettext("Kerberos 5 authentication rejected: %*s\n"),
                       err_ret->text.length, err_ret->text.data);
          }
          else
          {
              snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                      "krb5_sendauth: %s\n", error_message(retval));
          }

          if (err_ret)
***************
*** 422,428 ****
      if (fcntl(sock, F_SETFL, (long) flags))
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  libpq_gettext("could not restore non-blocking mode on socket: %s"),
                   strerror(errno));
          ret = STATUS_ERROR;
      }
--- 421,427 ----
      if (fcntl(sock, F_SETFL, (long) flags))
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  libpq_gettext("could not restore non-blocking mode on socket: %s\n"),
                   strerror(errno));
          ret = STATUS_ERROR;
      }
***************
*** 594,600 ****
      if (i == n_authsvcs)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  libpq_gettext("invalid authentication service name \"%s\", ignored"),
                   name);
      }
      return;
--- 593,599 ----
      if (i == n_authsvcs)
      {
          snprintf(PQerrormsg, PQERRORMSG_LENGTH,
!                  libpq_gettext("invalid authentication service name \"%s\", ignored\n"),
                   name);
      }
      return;

Re: Added \n to libpq prints

From
"Serguei Mokhov"
Date:
----- Original Message -----
From: Bruce Momjian <pgman@candle.pha.pa.us>
Sent: Friday, August 17, 2001 11:02 AM


> I added some missing \n's to libpq error output.

This change affects the NLS {de|ru}.po files for libpq as well
in /src/interfaces/libpq/, so they need to be merged with the sources.

I did patch the ru.po one (see attachment); however, de.ru still needs patching.
I guess Peter will fix it, since I'm afraid to corrupt some German-specific characters.

And perhaps if Karel has some work done in translating libpq into Czech, he has to fix it as well.

S.


Attachment

Re: Added \n to libpq prints

From
Bruce Momjian
Date:
> ----- Original Message -----
> From: Bruce Momjian <pgman@candle.pha.pa.us>
> Sent: Friday, August 17, 2001 11:02 AM
>
>
> > I added some missing \n's to libpq error output.
>
> This change affects the NLS {de|ru}.po files for libpq as well
> in /src/interfaces/libpq/, so they need to be merged with the sources.
>
> I did patch the ru.po one (see attachment); however, de.ru still needs patching.
> I guess Peter will fix it, since I'm afraid to corrupt some German-specific characters.
>
> And perhaps if Karel has some work done in translating libpq into Czech, he has to fix it as well.

Yes, I know.  I thought Peter didn't want us messing with that.  Somehow
he wants to handle the merges.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: Added \n to libpq prints

From
"Serguei Mokhov"
Date:
----- Original Message -----
From: Bruce Momjian <pgman@candle.pha.pa.us>
Sent: Friday, August 17, 2001 10:55 PM


> > ----- Original Message -----
> > From: Bruce Momjian <pgman@candle.pha.pa.us>
> > Sent: Friday, August 17, 2001 11:02 AM
> >
> > > I added some missing \n's to libpq error output.
> >
> > This change affects the NLS {de|ru}.po files for libpq as well
> > in /src/interfaces/libpq/, so they need to be merged with the sources.
>
> Yes, I know.  I thought Peter didn't want us messing with that.  Somehow
> he wants to handle the merges.

AFAIR he said something like let the language team maintain their language
issues and submit patches against current merges. The problem is that,
if you do not have an appropriate locale set up and if you edit the file certain characters
may easily get corrupt. This might not be a bigger problem for the latin* encodings,
but for others it is.

S.