From 918fecfc93b993efa6c5778e893498c1e60998e6 Mon Sep 17 00:00:00 2001 From: Matthew Newton Date: Tue, 21 Jan 2020 21:10:34 +0000 Subject: [PATCH] add fr_bskip_whitespace macro --- src/lib/util/misc.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/util/misc.h b/src/lib/util/misc.h index 10fad0b342d6..92084da65099 100644 --- a/src/lib/util/misc.h +++ b/src/lib/util/misc.h @@ -68,6 +68,13 @@ void fr_talloc_verify_cb(const void *ptr, int depth, */ #define fr_skip_whitespace(_p) while(isspace((int)*(_p))) _p++ +/** Skip whitespace, stopping at end ('\\t', '\\n', '\\v', '\\f', '\\r', ' ') + * + * @param[in,out] _p string to skip over. + * @param[in] _e pointer to end of string. + */ +#define fr_bskip_whitespace(_p, _e) while((_p < _e) && isspace((int)*(_p))) _p++ + /** Skip everything that's not whitespace ('\\t', '\\n', '\\v', '\\f', '\\r', ' ') * * @param[in,out] _p string to skip over.