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

Paulo Alcantara pcacjr at gmail.com
Wed Jul 22 16:27:28 PDT 2015


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) {
-- 
2.1.0



More information about the Syslinux mailing list