[syslinux:elflink] PATH: Use installation directory for 'PATH'

syslinux-bot for Matt Fleming matt.fleming at intel.com
Fri Nov 30 03:33:06 PST 2012


Commit-ID:  10bb72d1528b909a8e6f270fca02e6b5afae6a6e
Gitweb:     http://www.syslinux.org/commit/10bb72d1528b909a8e6f270fca02e6b5afae6a6e
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Fri, 30 Nov 2012 09:50:53 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Fri, 30 Nov 2012 11:04:23 +0000

PATH: Use installation directory for 'PATH'

Files in the installation directory should be able to be executed
(along with their dependencies) from any directory in the file
hierarchy. Using the installation directory as the default value for
'PATH' is the most sensible way to do this.

The PATH config directive still allows other directories to be
appended to the 'PATH' variable, which is useful when there are other
directories containing modules.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 core/elflink/load_env32.c | 5 ++---
 core/include/fs.h         | 1 -
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/core/elflink/load_env32.c b/core/elflink/load_env32.c
index a4bee75..4797b27 100644
--- a/core/elflink/load_env32.c
+++ b/core/elflink/load_env32.c
@@ -124,14 +124,13 @@ void load_env32(com32sys_t * regs __unused)
 
 	dprintf("Starting 32 bit elf module subsystem...\n");
 
-	PATH = malloc(strlen(PATH_DEFAULT) + 1);
+	PATH = malloc(strlen(CurrentDirName) + 1);
 	if (!PATH) {
 		printf("Couldn't allocate memory for PATH\n");
 		return;
 	}
 
-	strcpy(PATH, PATH_DEFAULT);
-	PATH[strlen(PATH_DEFAULT)] = '\0';
+	strcpy(PATH, CurrentDirName);
 
 	init_module_subsystem(&core_module);
 
diff --git a/core/include/fs.h b/core/include/fs.h
index fa5bbc2..9d55278 100644
--- a/core/include/fs.h
+++ b/core/include/fs.h
@@ -182,7 +182,6 @@ static inline struct file *handle_to_file(uint16_t handle)
     return handle ? &files[handle-1] : NULL;
 }
 
-#define PATH_DEFAULT	"/boot/syslinux/:/boot/"
 extern char *PATH;
 
 /* fs.c */


More information about the Syslinux-commits mailing list