pgsql: Skip trailing whitespaces when parsing integer options

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Skip trailing whitespaces when parsing integer options
Date: 2021-07-27 01:41:12
Message-ID: E1m8C5o-0007CD-4J@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Skip trailing whitespaces when parsing integer options

strtoint(), via strtol(), would skip leading whitespaces but the same
rule was not applied for trailing whitespaces, leading to an
inconsistent behavior. Some tests are changed to cover more this area.

Author: Michael Paquier
Reviewed-by: Kyotaro Horiguchi
Discussion: https://postgr.es/m/YP5Pv0d13Ct+03ve@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f7a9a3d4b24a4ad0de7992f01a0dd2a02ccd30a4

Modified Files
--------------
src/bin/pg_basebackup/t/020_pg_receivewal.pl | 4 +++-
src/bin/pg_dump/t/001_basic.pl | 3 ++-
src/fe_utils/option_utils.c | 9 ++++++++-
3 files changed, 13 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2021-07-27 02:03:04 pgsql: Simplify matching pattern check in TAP tests of pg_receivewal
Previous Message Alvaro Herrera 2021-07-26 17:01:01 pgsql: Remove newly added useless assertion check