From 19aecdfcdc6cd1db2a0b8e67b9787aad0ba0117d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 14 Feb 2003 22:28:29 +0000 Subject: [PATCH] add StripCrnl --- stepmania/src/RageUtil.cpp | 6 ++++++ stepmania/src/RageUtil.h | 1 + 2 files changed, 7 insertions(+) diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index dfe42a2d3a..5e49538bd5 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -601,6 +601,12 @@ void TrimRight(CString &str, const char *s) str.erase(str.begin()+n, str.end()); } +void StripCrnl(CString &s) +{ + while(s[s.size()-1] == '\r' || s[s.size()-1] == '\n') + s.erase(s.size()-1); +} + /* path is a .redir pathname. Read it and return the real one. */ CString DerefRedir(const CString &path) { diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 90cb7d5672..3e810816ab 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -193,6 +193,7 @@ float calc_stddev(const float *start, const float *end); void TrimLeft(CString &str, const char *s = "\r\n\t "); void TrimRight(CString &str, const char *s = "\r\n\t "); +void StripCrnl(CString &s); CString DerefRedir(const CString &path);