-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
confuse: re-add search path patch dropped with the v3.3 update
Contrary to my claim in meta-ptx commit 52d88c6 ("confuse: update to 3.3"), the patch was not part of v3.3, yet (but is part of master). Thus re-add it and fix the Upstream-Status by replacing the now invalid 'Accepted' with 'Backport'. Signed-off-by: Enrico Jörns <[email protected]>
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
recipes-devtools/confuse/files/0001-only-apply-search-path-logic-to-relative-pathnames.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From b684f4cc25821b6e86a58576f864e4b12dfdfecc Mon Sep 17 00:00:00 2001 | ||
From: Rasmus Villemoes <[email protected]> | ||
Date: Sat, 5 Jun 2021 22:57:51 +0200 | ||
Subject: [PATCH] only apply search path logic to relative pathnames | ||
|
||
Adding any directory to the search path via cfg_add_searchpath breaks | ||
lookup of absolute paths. So change the logic in cfg_searchpath() to | ||
ignore the search path when the given filename is absolute, and merely | ||
check that for existence. | ||
|
||
This is technically an ABI change, but the current behaviour is quite | ||
unusual and unexpected. | ||
|
||
Upstream-status: Backport [https://github.com/libconfuse/libconfuse/pull/155] | ||
|
||
Signed-off-by: Rasmus Villemoes <[email protected]> | ||
--- | ||
src/confuse.c | 8 ++++++++ | ||
1 file changed, 8 insertions(+) | ||
|
||
diff --git a/src/confuse.c b/src/confuse.c | ||
index 2ea0254..19b56e3 100644 | ||
--- a/src/confuse.c | ||
+++ b/src/confuse.c | ||
@@ -1746,12 +1746,20 @@ DLLIMPORT char *cfg_searchpath(cfg_searchpath_t *p, const char *file) | ||
return NULL; | ||
} | ||
|
||
+ if (file[0] == '/') { | ||
+ fullpath = strdup(file); | ||
+ if (!fullpath) | ||
+ return NULL; | ||
+ goto check; | ||
+ } | ||
+ | ||
if ((fullpath = cfg_searchpath(p->next, file)) != NULL) | ||
return fullpath; | ||
|
||
if ((fullpath = cfg_make_fullpath(p->dir, file)) == NULL) | ||
return NULL; | ||
|
||
+check: | ||
#ifdef HAVE_SYS_STAT_H | ||
err = stat((const char *)fullpath, &st); | ||
if ((!err) && S_ISREG(st.st_mode)) | ||
-- | ||
2.31.1 | ||
|