On Tue, Aug 25, 2015 at 1:09 PM, Bartosz Golaszewski
<[email protected]> wrote:
> Add a wrapper around skip_whitespace() which evaluates to true if given
> string contains only whitespace characters.
>
> Signed-off-by: Bartosz Golaszewski <[email protected]>
> ---
>  include/libbb.h         |  2 ++
>  libbb/skip_whitespace.c | 17 +++++++++++++++++
>  2 files changed, 19 insertions(+)
>
> diff --git a/include/libbb.h b/include/libbb.h
> index 2e20706..6d7b128 100644
> --- a/include/libbb.h
> +++ b/include/libbb.h
> @@ -337,6 +337,8 @@ extern char *skip_whitespace(const char *) FAST_FUNC;
>  extern char *skip_non_whitespace(const char *) FAST_FUNC;
>  extern char *skip_dev_pfx(const char *tty_name) FAST_FUNC;
>
> +#define str_isblank(str) (*skip_whitespace(str) == '\0')
> +

This can go into libbb when it has more than one user.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to