From e7d20cf352688bf717a01f4e6d9e6f497c2bea4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 20 Sep 2025 19:19:34 +0200 Subject: New upstream version 5.3.1Beta2 --- app/bin/stringxtc.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'app/bin/stringxtc.c') diff --git a/app/bin/stringxtc.c b/app/bin/stringxtc.c index e65a97d..28eb9b4 100644 --- a/app/bin/stringxtc.c +++ b/app/bin/stringxtc.c @@ -143,3 +143,28 @@ XtcStricmp(const char *a, const char *b) return ca - cb; } + +/** + * Strip single trailing CR/LF characters from string. Multiple occurences + * will be ignored. + * + * \param line string to be checked. CR/LF are removed in place + */ + +void Stripcr(char* line) +{ + char* cp; + cp = line + strlen(line); + if (cp == line) { + return; + } + cp--; + if (*cp == '\n') { + *cp-- = '\0'; + } + if (cp >= line && *cp == '\r') { + *cp = '\0'; + } +} + + -- cgit v1.2.3