Commit 46edd9e1 authored by rswindell's avatar rswindell
Browse files

Put Micros~1 shortened filenames in the DOSXTRN.ENV file, allowing at least

some XSDK doors to possibly work when run from C:\Synchronet\...
parent 064d8817
......@@ -492,11 +492,28 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
} else { // DOS external
// DOS-compatible (short) paths
char node_dir[MAX_PATH+1];
char ctrl_dir[MAX_PATH+1];
char data_dir[MAX_PATH+1];
char exec_dir[MAX_PATH+1];
// in case GetShortPathName fails
SAFECOPY(node_dir,cfg.node_dir);
SAFECOPY(ctrl_dir,cfg.ctrl_dir);
SAFECOPY(data_dir,cfg.data_dir);
SAFECOPY(exec_dir,cfg.exec_dir);
GetShortPathName(cfg.node_dir,node_dir,sizeof(node_dir));
GetShortPathName(cfg.ctrl_dir,ctrl_dir,sizeof(node_dir));
GetShortPathName(cfg.data_dir,data_dir,sizeof(data_dir));
GetShortPathName(cfg.exec_dir,exec_dir,sizeof(exec_dir));
sprintf(path,"%sDOSXTRN.RET", cfg.node_dir);
remove(path);
// Create temporary environment file
sprintf(path,"%sDOSXTRN.ENV", cfg.node_dir);
sprintf(path,"%sDOSXTRN.ENV", node_dir);
FILE* fp=fopen(path,"w");
if(fp==NULL) {
XTRN_CLEANUP;
......@@ -504,11 +521,11 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
return(errno);
}
fprintf(fp, "%s\n", fullcmdline);
fprintf(fp, "DSZLOG=%sPROTOCOL.LOG\n", cfg.node_dir);
fprintf(fp, "SBBSNODE=%s\n", cfg.node_dir);
fprintf(fp, "SBBSCTRL=%s\n", cfg.ctrl_dir);
fprintf(fp, "SBBSDATA=%s\n", cfg.data_dir);
fprintf(fp, "SBBSEXEC=%s\n", cfg.exec_dir);
fprintf(fp, "DSZLOG=%sPROTOCOL.LOG\n", node_dir);
fprintf(fp, "SBBSNODE=%s\n", node_dir);
fprintf(fp, "SBBSCTRL=%s\n", ctrl_dir);
fprintf(fp, "SBBSDATA=%s\n", data_dir);
fprintf(fp, "SBBSEXEC=%s\n", exec_dir);
fprintf(fp, "SBBSNNUM=%d\n", cfg.node_num);
/* date/time env vars */
fprintf(fp, "DAY=%02u\n", tm.tm_mday);
......@@ -518,9 +535,7 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
fprintf(fp, "YEAR=%u\n",1900+tm.tm_year);
fclose(fp);
SAFECOPY(str,path); // incase GetShortPathName fails
GetShortPathName(path,str,sizeof(str));
sprintf(fullcmdline, "%sDOSXTRN.EXE %s", cfg.exec_dir, str);
sprintf(fullcmdline, "%sDOSXTRN.EXE %s", cfg.exec_dir, path);
if(!(mode&EX_OFFLINE) && nt) { // Windows NT/2000
i=SBBSEXEC_MODE_FOSSIL;
......
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