diff options
Diffstat (limited to 'com32/elflink/ldlinux/readconfig.c')
-rw-r--r-- | com32/elflink/ldlinux/readconfig.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c index b845d9a8..5bf6f42c 100644 --- a/com32/elflink/ldlinux/readconfig.c +++ b/com32/elflink/ldlinux/readconfig.c @@ -27,6 +27,7 @@ #include <dprintf.h> #include <ctype.h> #include <core.h> +#include <fs.h> #include "menu.h" #include "config.h" @@ -1332,6 +1333,23 @@ do_include: } } else if (looking_at(p, "say")) { printf("%s\n", p + 4); + } else if (looking_at(p, "path")) { + /* PATH-based lookup */ + char *new_path, *_p; + size_t len, new_len; + + new_path = refstrdup(skipspace(p + 4)); + len = strlen(PATH); + new_len = strlen(new_path); + _p = realloc(PATH, len + new_len + 2); + if (_p) { + strncpy(_p, PATH, len); + _p[len++] = ':'; + strncpy(_p + len, new_path, new_len); + _p[len + new_len] = '\0'; + PATH = _p; + } else + printf("Failed to realloc PATH\n"); } } } |