aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/ldlinux/readconfig.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@linux.intel.com>2011-06-07 20:12:17 +0100
committerMatt Fleming <matt.fleming@linux.intel.com>2011-06-07 20:12:17 +0100
commit2e97bb931cc676846e1a8d373b6c8645d560a982 (patch)
tree9f9d17832b06cb6eef5eaedb491ab8deaf571a7d /com32/elflink/ldlinux/readconfig.c
parent9ab2c9cd558e3047cdba3b4db31b69d26c493006 (diff)
parentef3cb76bffc52b40b9a013f5b16835e062a5db4b (diff)
downloadsyslinux-2e97bb931cc676846e1a8d373b6c8645d560a982.tar.gz
syslinux-2e97bb931cc676846e1a8d373b6c8645d560a982.tar.xz
syslinux-2e97bb931cc676846e1a8d373b6c8645d560a982.zip
Merge branch 'PATH-based-search' into for-hpa/elflink/ldlinux
Conflicts: com32/elflink/ldlinux/readconfig.c
Diffstat (limited to 'com32/elflink/ldlinux/readconfig.c')
-rw-r--r--com32/elflink/ldlinux/readconfig.c18
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");
}
}
}