Commit a3cdd3b8 authored by rswindell's avatar rswindell
Browse files

Added 2 new environment variables dynamically-defined when launching DOS

programs: PCBDRIVE (the drive letter of the current node directory) and PCBDIR
(the path to the current node directory, without the drive letter).

These emulate the same variables crated by PCBoard.

The reason these are being added is that Sunrise Door Software's 16-bit doors
contain special support for these environment vars when used in their .CFG files
(e.g. %PCBDIR%DOOR.SYS) and this allows easy multi-node configuration with a
single .CFG file. The SBBSNODE environment varialbe would have worked perfectly
fine for this purpose, but apparently Sunrise Doors (or the DoorFrame
development kit they utilized) has hard-coded these PCBoard (and Wildcat!)
environment variable names, so SBBSNODE wont' work for this purpose.

For Synchronet-Win32, you will need the DOSXTRN.EXE revision 25 or later
or you may experience NTVDM crashes when running external DOS programs.
parent dfe45581
......@@ -476,6 +476,8 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
fprintf(fp, "SBBSEXEC=%s\n", exec_dir);
fprintf(fp, "SBBSNNUM=%d\n", cfg.node_num);
fprintf(fp, "PCBNODE=%d\n", cfg.node_num);
fprintf(fp, "PCBDRIVE=%.2s\n", node_dir);
fprintf(fp, "PCBDIR=%s\n", node_dir + 2);
/* date/time env vars */
fprintf(fp, "DAY=%02u\n", tm.tm_mday);
fprintf(fp, "WEEKDAY=%s\n",wday[tm.tm_wday]);
......@@ -1179,6 +1181,8 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
......@@ -1312,6 +1316,8 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
fprintf(dosemubat,"set SBBSDATA=%s\r\n",datadrive);
fprintf(dosemubat,"set SBBSEXEC=%s\r\n",execdrive);
fprintf(dosemubat,"set PCBNODE=%d\r\n",cfg.node_num);
fprintf(dosemubat,"set PCBDRIVE=%s\r\n",nodedrive);
fprintf(dosemubat,"set PCBDIR=\\\r\n");
// let's do this cleanly like dosemu's default autoexec.bat does -wk42
/* clear existing redirections on dos side and */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment