aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--com32/elflink/ldlinux/ldlinux.c2
-rw-r--r--com32/include/menu.h2
-rw-r--r--com32/menu/menumain.c10
3 files changed, 10 insertions, 4 deletions
diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c
index 4ad5eb85..f56f2c06 100644
--- a/com32/elflink/ldlinux/ldlinux.c
+++ b/com32/elflink/ldlinux/ldlinux.c
@@ -45,7 +45,7 @@ static inline const char *find_command(const char *str)
return p;
}
-static enum kernel_type parse_kernel_type(const char *kernel)
+enum kernel_type parse_kernel_type(const char *kernel)
{
const struct file_ext *ext;
const char *p;
diff --git a/com32/include/menu.h b/com32/include/menu.h
index be2eaeb1..a3e9cd62 100644
--- a/com32/include/menu.h
+++ b/com32/include/menu.h
@@ -94,6 +94,8 @@ enum kernel_type {
extern const char *const kernel_types[];
+extern enum kernel_type parse_kernel_type(const char *kernel);
+
/* Configurable integer parameters */
enum parameter_number {
P_WIDTH,
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index a795cb2c..53bc6c64 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -1161,9 +1161,13 @@ int main(int argc, char *argv[])
printf("\033[?25h\033[%d;1H\033[0m", cursorrow);
if (cmdline) {
- execute(cmdline, KT_NONE);
- if (cm->onerror)
- execute(cm->onerror, KT_NONE);
+ enum kernel_type type = parse_kernel_type(cmdline);
+
+ execute(cmdline, type);
+ if (cm->onerror) {
+ type = parse_kernel_type(cm->onerror);
+ execute(cm->onerror, type);
+ }
} else {
return 0; /* Exit */
}