Skip to content

Commit

Permalink
add COMCOM_MOUSE variable
Browse files Browse the repository at this point in the history
It is set with /M switch to propagate mouse enablement to the
child comcoms.
  • Loading branch information
stsp committed Mar 28, 2024
1 parent e83113c commit 9d440fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -4343,7 +4343,7 @@ void do_int0(void)
int main(int argc, const char *argv[], const char *envp[])
{
int a;
char *cmd_path;
char *cmd_path, *v;
int disable_autoexec = 0;
int inited = 0;
// initialize the cmd data ...
Expand Down Expand Up @@ -4380,6 +4380,9 @@ int main(int argc, const char *argv[], const char *envp[])
setenv("COMCOM_VER", version, 1);
setenv("ERRORLEVEL", "0", 1);

if ((v = getenv("COMCOM_MOUSE")) && v[0] == '1')
mouse_en = mouse_init();

// process arguments
for (a = 1; a < argc; a++)
{
Expand Down Expand Up @@ -4416,9 +4419,11 @@ int main(int argc, const char *argv[], const char *envp[])
stepping = 1;
}

if (stricmp(argv[a], "/M") == 0)
if (stricmp(argv[a], "/M") == 0 && !mouse_en)
{
mouse_en = mouse_init();
if (mouse_en)
setenv("COMCOM_MOUSE", "1", 1);
}

// check for command in arguments
Expand Down

0 comments on commit 9d440fa

Please sign in to comment.