- implemented builtin variable BXBIOS for the non-plugin version and platforms

that do not support setenv()
This commit is contained in:
Volker Ruppert 2002-11-26 20:40:50 +00:00
parent 91af460652
commit 9f7130c150

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: main.cc,v 1.197 2002-11-26 18:15:56 vruppert Exp $
// $Id: main.cc,v 1.198 2002-11-26 20:40:50 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -2309,6 +2309,18 @@ parse_bochsrc(char *rcfile)
return retval;
}
static char *
get_builtin_variable(char *varname)
{
if (strlen(varname)<1) return NULL;
else {
if (!strcmp(varname, "BXBIOS")) {
return BX_BIOS_DEFAULT_PATH;
}
return NULL;
}
}
static Bit32s
parse_line_unformatted(char *context, char *line)
{
@ -2355,7 +2367,13 @@ parse_line_unformatted(char *context, char *line)
}
*pv = 0;
if (strlen(varname)<1 || !(value = getenv(varname))) {
BX_PANIC (("could not look up environment variable '%s'\n", varname));
if ((value = get_builtin_variable(varname))) {
// append value to the string
for (pv=value; *pv; pv++)
string[string_i++] = *pv;
} else {
BX_PANIC (("could not look up environment variable '%s'", varname));
}
} else {
// append value to the string
for (pv=value; *pv; pv++)