[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to detect spaces in paths
From: |
Paul Smith |
Subject: |
Re: How to detect spaces in paths |
Date: |
Wed, 15 Dec 2021 10:11:00 -0500 |
User-agent: |
Evolution 3.36.5-0ubuntu1 |
On Wed, 2021-12-15 at 15:05 +0100, R. Diez wrote:
> Is there a better way?
I think if $(words $(PATH_TO_CHECK)) is 1, then it's OK and if it's >1
then it contains whitespace.
You can write a test using $(if ...) rather than using ifeq, then it
can be put anywhere:
$(if $(filter-out 1,$(words $(PATH_TO_CHECK))),$(error spaces found))
Just to note this will also say "spaces found" if the variable is
empty... you'll have to check that separately if it's something to be
concerned about.