[syslinux:multifs] sys/common: handle multifs paths in findpath()

syslinux-bot for Paulo Alcantara pcacjr at zytor.com
Mon Feb 1 03:18:08 PST 2016


Commit-ID:  1526689e57e57a55f2de0d94fe938a09153608d1
Gitweb:     http://www.syslinux.org/commit/1526689e57e57a55f2de0d94fe938a09153608d1
Author:     Paulo Alcantara <pcacjr at zytor.com>
AuthorDate: Mon, 20 Jul 2015 20:09:00 -0300
Committer:  Paulo Alcantara <pcacjr at zytor.com>
CommitDate: Sun, 31 Jan 2016 18:35:19 -0200

sys/common: handle multifs paths in findpath()

By looking for PATH entries and trying to find multifs-like paths does
not make any sense. Only try to open it once.

Cc: Gene Cumm <gene.cumm at gmail.com>
Signed-off-by: Paulo Alcantara <pcacjr at zytor.com>

---
 com32/lib/sys/module/common.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c
index 05a27e8..73155ad 100644
--- a/com32/lib/sys/module/common.c
+++ b/com32/lib/sys/module/common.c
@@ -59,12 +59,17 @@ void print_elf_symbols(struct elf_module *module) {
 
 FILE *findpath(char *name)
 {
+	int is_multifs_path = 0;
+	char *p;
 	struct path_entry *entry;
 	char path[FILENAME_MAX];
 	FILE *f;
 
+	/* NOTE: multifs already handle both relative and absolute paths */
+	if ((p = strchr(name, ')')) && strchr(p, ')'))
+		is_multifs_path = 1; /* assume multifs-like path */
 	f = fopen(name, "rb"); /* for full path */
-	if (f)
+	if (f || is_multifs_path)
 		return f;
 
 	list_for_each_entry(entry, &PATH, list) {


More information about the Syslinux-commits mailing list