- Notifications
You must be signed in to change notification settings - Fork5.3k
Commit8b3e2c6
committed
Fix pg_isblank()
There was a pg_isblank() function that claimed to be a replacement forthe standard isblank() function, which was thought to be "not veryportable yet". We can now assume that it's portable (it's in C99).But pg_isblank() actually diverged from the standard isblank() by alsoaccepting '\r', while the standard one only accepts space and tab.This was added to support parsing pg_hba.conf under Windows. But thehba parsing code now works completely differently and already handlesline endings before we get to pg_isblank(). The other user ofpg_isblank() is for ident protocol message parsing, which also handles'\r' separately. So this behavior is now obsolete and confusing.To improve clarity, I separated those concerns. The ident parsing nowgets its own function that hardcodes the whitespace charactersmentioned by the relevant RFC. pg_isblank() is now static in hba.cand is a wrapper around the standard isblank(), with some extra logicto ensure robust treatment of non-ASCII characters.Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://www.postgresql.org/message-id/flat/170308e6-a7a3-4484-87b2-f960bb564afa%40eisentraut.org1 parente68b6ad commit8b3e2c6
3 files changed
+16
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1580 | 1580 | | |
1581 | 1581 | | |
1582 | 1582 | | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
1583 | 1592 | | |
1584 | 1593 | | |
1585 | 1594 | | |
| |||
1613 | 1622 | | |
1614 | 1623 | | |
1615 | 1624 | | |
1616 | | - | |
| 1625 | + | |
1617 | 1626 | | |
1618 | 1627 | | |
1619 | | - | |
| 1628 | + | |
1620 | 1629 | | |
1621 | 1630 | | |
1622 | 1631 | | |
1623 | | - | |
| 1632 | + | |
1624 | 1633 | | |
1625 | 1634 | | |
1626 | 1635 | | |
| |||
1643 | 1652 | | |
1644 | 1653 | | |
1645 | 1654 | | |
1646 | | - | |
| 1655 | + | |
1647 | 1656 | | |
1648 | 1657 | | |
1649 | 1658 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 141 | + | |
146 | 142 | | |
147 | 143 | | |
148 | | - | |
| 144 | + | |
| 145 | + | |
149 | 146 | | |
150 | 147 | | |
151 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | 184 | | |
186 | 185 | | |
187 | 186 | | |
| |||
0 commit comments
Comments
(0)