diff options
author | Paulo Alcantara <pcacjr@zytor.com> | 2015-07-20 20:09:00 -0300 |
---|---|---|
committer | Paulo Alcantara <pcacjr@zytor.com> | 2016-01-31 18:35:19 -0200 |
commit | 1526689e57e57a55f2de0d94fe938a09153608d1 (patch) | |
tree | 7d098e74bcae1ee06402833bae9baf80b852ea75 | |
parent | e618bed9737279bd5fcc4d5983cebc8d12c69e44 (diff) | |
download | syslinux-1526689e57e57a55f2de0d94fe938a09153608d1.tar.gz |
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@gmail.com>
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
-rw-r--r-- | com32/lib/sys/module/common.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c index 05a27e85..73155ad9 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) { |