Refactor logic to remove trailing CR/LF characters from strings
Michael Paquier <michael@paquier.xyz>
Refactor logic to remove trailing CR/LF characters from strings b654714 has reworked the way trailing CR/LF characters are removed from strings. This commit introduces a new routine in common/string.c and refactors the code so as the logic is in a single place, mostly. Author: Michael Paquier Reviewed-by: Bruce Momjian Discussion: https://postgr.es/m/20190801031820.GF29334@paquier.xyz
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/libpq/be-secure-common.c | modified | +3 −5 |
| src/bin/pg_ctl/pg_ctl.c | modified | +3 −7 |
| src/bin/pg_resetwal/pg_resetwal.c | modified | +3 −7 |
| src/bin/pg_upgrade/option.c | modified | +5 −15 |
| src/bin/psql/prompt.c | modified | +5 −5 |
| src/common/string.c | modified | +22 −0 |
| src/include/common/string.h | modified | +1 −0 |
| src/interfaces/libpq/fe-connect.c | modified | +3 −6 |
Discussion
- Refactoring code stripping trailing \n and \r from strings 4 messages · 2019-08-01 → 2019-08-09