summaryrefslogtreecommitdiffstats
path: root/common/blspec.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-09-14 17:27:11 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-09-15 14:42:49 +0200
commita2ed66346ba87029541229a73fc018d5c402dec3 (patch)
tree44ee975005d8007eca4722a021367c6127f545ca /common/blspec.c
parenta49cf5c14d050bc37f0d12f2623c86a2d383e9b7 (diff)
downloadbarebox-a2ed66346ba87029541229a73fc018d5c402dec3.tar.gz
barebox-a2ed66346ba87029541229a73fc018d5c402dec3.tar.xz
blspec: devicetree-overlay: don't warn on multiple delimiting spaces
strsep unlike strtok(_r) returns an empty string for each pair of consecutive delimiters. blspec_apply_oftree_overlay is not equipped to handle an empty string and will attempt treating "abspath/" as device tree file. Explicitly check for empty strings, so this doesn't happen. Cc: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/blspec.c')
-rw-r--r--common/blspec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/blspec.c b/common/blspec.c
index 9e1036c834..ed66352d11 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -109,8 +109,11 @@ static void blspec_apply_oftree_overlays(const char *overlays,
sep = freep = xstrdup(overlays);
- while ((overlay = strsep(&sep, " ")))
+ while ((overlay = strsep(&sep, " "))) {
+ if (!*overlay)
+ continue;
blspec_apply_oftree_overlay(overlay, abspath, dryrun);
+ }
free(freep);
}