|
@@ -204,8 +204,11 @@ static int luaB_context(lua_State *L)
|
|
|
|
|
|
if (!name || !strcmp(name, "cmd")) {
|
|
if (!name || !strcmp(name, "cmd")) {
|
|
pars = kcontext_pargv(context);
|
|
pars = kcontext_pargv(context);
|
|
- entry = kpargv_command(pars);
|
|
|
|
- val = kentry_name(entry);
|
|
|
|
|
|
+ val = NULL;
|
|
|
|
+ if (pars) {
|
|
|
|
+ entry = kpargv_command(pars);
|
|
|
|
+ val = kentry_name(entry);
|
|
|
|
+ }
|
|
if (val) {
|
|
if (val) {
|
|
if (!name) {
|
|
if (!name) {
|
|
lua_pushstring(L, "cmd");
|
|
lua_pushstring(L, "cmd");
|
|
@@ -220,8 +223,11 @@ static int luaB_context(lua_State *L)
|
|
|
|
|
|
if (!name || !strcmp(name, "pcmd")) {
|
|
if (!name || !strcmp(name, "pcmd")) {
|
|
pars = kcontext_parent_pargv(context);
|
|
pars = kcontext_parent_pargv(context);
|
|
- entry = kpargv_command(pars);
|
|
|
|
- val = kentry_name(entry);
|
|
|
|
|
|
+ val = NULL;
|
|
|
|
+ if (pars) {
|
|
|
|
+ entry = kpargv_command(pars);
|
|
|
|
+ val = kentry_name(entry);
|
|
|
|
+ }
|
|
if (val) {
|
|
if (val) {
|
|
if (!name) {
|
|
if (!name) {
|
|
lua_pushstring(L, "pcmd");
|
|
lua_pushstring(L, "pcmd");
|