diff options
author | Michael Paquier <michael@paquier.xyz> | 2019-08-09 11:05:14 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2019-08-09 11:05:14 +0900 |
commit | b8f2da0ac5a24f669c8d320c58646759b8fc69a5 (patch) | |
tree | dc68a064354682b5916a87224ef325f1e83c1bbf /src/include/common/string.h | |
parent | 28b901f73a3924187988bfaac57d20e422a432c3 (diff) | |
download | postgresql-b8f2da0ac5a24f669c8d320c58646759b8fc69a5.tar.gz postgresql-b8f2da0ac5a24f669c8d320c58646759b8fc69a5.zip |
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
Diffstat (limited to 'src/include/common/string.h')
-rw-r--r-- | src/include/common/string.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/common/string.h b/src/include/common/string.h index 77f31337ca4..94f653fdd75 100644 --- a/src/include/common/string.h +++ b/src/include/common/string.h @@ -14,5 +14,6 @@ extern bool pg_str_endswith(const char *str, const char *end); extern int strtoint(const char *pg_restrict str, char **pg_restrict endptr, int base); extern void pg_clean_ascii(char *str); +extern int pg_strip_crlf(char *str); #endif /* COMMON_STRING_H */ |