diff options
Diffstat (limited to 'src/buf_text.h')
-rw-r--r-- | src/buf_text.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/buf_text.h b/src/buf_text.h index 458ee33c9..58e4e26a7 100644 --- a/src/buf_text.h +++ b/src/buf_text.h @@ -56,6 +56,20 @@ GIT_INLINE(int) git_buf_text_puts_escape_regex(git_buf *buf, const char *string) extern void git_buf_text_unescape(git_buf *buf); /** + * Replace all \r\n with \n (or do nothing if no \r\n are found) + * + * @return 0 on success, GIT_ENOTFOUND if no \r\n, -1 on memory error + */ +extern int git_buf_text_crlf_to_lf(git_buf *tgt, const git_buf *src); + +/** + * Replace all \n with \r\n (or do nothing if no \n are found) + * + * @return 0 on success, GIT_ENOTFOUND if no \n, -1 on memory error + */ +extern int git_buf_text_lf_to_crlf(git_buf *tgt, const git_buf *src); + +/** * Fill buffer with the common prefix of a array of strings * * Buffer will be set to empty if there is no common prefix |