I recently migrated my data from a RHEL 6 box to a Ubunto 16.04 LTS box. after bringing over the data, I recompiled Synchronet for the new OS. Everything seems to be working fine, with the exception of every one of my dos doors.
I can run them fine with dosemu locally, and today I tracked it down to external.bat isn't mapping the full pathname I have in SCFG for the door!
Re: external.bat not mapping complete pathname
By: Hemo to All on Sun Feb 05 2017 07:48 pm
I recently migrated my data from a RHEL 6 box to a Ubunto 16.04 LTS box. after bringing over the data, I recompiled Synchronet for the new OS. Everything seems to be working fine, with the exception of every one of my dos doors.
I can run them fine with dosemu locally, and today I tracked it down to external.bat isn't mapping the full pathname I have in SCFG for the door!
DM -
I think I tracked my problem down to the part of external.bat where it changes to drive E: and then is supposed to do a cd to the door folder. The line in external.bat is just printing 'cd' , and not 'cd door'.
I know the code in xtrn.cpp hasn't changed recently, but was hoping you might have an idea why or how str[0] might be getting set to '\0' in this section of code starting at line 1555. I don't read cpp very well but this is what I think is happening, resulting in the empty 'cd' command:
/* change to the drive where the parent of the startup_dir is mounted */ fprintf(dosemubat,"%s\r\n",xtrndrive);
if(startup_dir!=NULL && startup_dir[0]) {
SAFECOPY(str,startup_dir);
/* if theres a trailing slash, dump it */
p=lastchar(str);
if (*p=='/') *p=0;
if ((p=strrchr(str, '/'))!=NULL)
SAFECOPY(str,p+1); /* str = game's starting dir */
else str[0] = '\0';
}
else str[0] = '\0';
fprintf(dosemubat,"cd %s\r\n",str); /* startup_dir */
thoughts? I'm stumped why under this recent Ubuntu compile I started having this issue of losing the door folder name in the external.bat file .
Re: external.bat not mapping complete pathname
By: Hemo to DIGITAL MAN on Tue Feb 07 2017 03:30 pm
I think I tracked my problem down to the part of external.bat where it
changes to drive E: and then is supposed to do a cd to the door
folder. The line in external.bat is just printing 'cd' , and not 'cd
door'.
thoughts? I'm stumped why under this recent Ubuntu compile I started
having this issue of losing the door folder name in the external.bat
file .
What's the startup directory configured as for this door in SCFG?
if(startup_dir!=NULL && startup_dir[0]) {
SAFECOPY(str,startup_dir);
/* if theres a trailing slash, dump it */
p=lastchar(str);
if (*p=='/') *p=0;
if ((p=strrchr(str, '/'))!=NULL)
SAFECOPY(str,p+1); /* str = game's starting dir */
else str[0] = '\0';
}
else str[0] = '\0';
fprintf(dosemubat,"cd %s\r\n",str); /* startup_dir */
Re: external.bat not mapping complete pathname
By: Digital Man to Hemo on Tue Feb 07 2017 04:43 pm
Re: external.bat not mapping complete pathname
By: Hemo to DIGITAL MAN on Tue Feb 07 2017 03:30 pm
I think I tracked my problem down to the part of external.bat where it
changes to drive E: and then is supposed to do a cd to the door
folder. The line in external.bat is just printing 'cd' , and not 'cd
door'.
thoughts? I'm stumped why under this recent Ubuntu compile I started
having this issue of losing the door folder name in the external.bat
file .
What's the startup directory configured as for this door in SCFG?
I've tried each of the following variations with same results: ../xtrn/dos/lord
../xtrn/dos/lord/
/sbbs/xtrn/dos/lord
/sbbs/xtrn/dos/lord/
Keeping in mind I am by no means a C/C++ programmer, by know just enough to figure some things out if I look hard enough.
I edited xtrn.cpp and added a bunch of debug lines that would print out REM lines in the external.bat file and show me that value of str and startup_dir at various stages.
so here is the code and the value of str at various stages, when I was using "../xtrn/dos/lord/" as the startup directory:
if(startup_dir!=NULL && startup_dir[0]) {
SAFECOPY(str,startup_dir);
str=/sbbs/xtrn/dos/lord/
/* if theres a trailing slash, dump it */
p=lastchar(str);
if (*p=='/') *p=0;
str=/sbbs/xtrn/dos/lord
if ((p=strrchr(str, '/'))!=NULL)
SAFECOPY(str,p+1); /* str = game's starting dir */
str=
else str[0] = '\0';
}
else str[0] = '\0';
fprintf(dosemubat,"cd %s\r\n",str); /* startup_dir */
something with the SAFECOPY(str,p+1); instruction?
I hammered in a kludge using basename(str) and a new char* , which seems to be working and setting the new value to "lord".
I added "char* new_str;" at the top of the sbbs_t::external function
and then commented out the "SAFECOPY(str,p+1);" code and put in "new_str = basename(str);" and edited the later fprintf to use tmp_str when writing out the "cd " command to external.bat
It worked, I had no idea what I was doing, reading search results and trying things. I have no clue why this part of code would start behaving this way now that I compiled under Ubuntu with gcc version 5.4.0, but the stuff I changed seems to have it working for my system now.
Digital Man wrote to Hemo <=-b 10 2017 GCC 5.4.0
Re: external.bat not mapping complete pathname
By: Hemo to Digital Man on Tue Feb 07 2017 11:34 pm
Re: external.bat not mapping complete pathname
By: Digital Man to Hemo on Tue Feb 07 2017 04:43 pm
Re: external.bat not mapping complete pathnameso here is the code and the value of str at various stages, when I was using "../xtrn/dos/lord/" as the startup directory:
By: Hemo to DIGITAL MAN on Tue Feb 07 2017 03:30 pm
if(startup_dir!=NULL && startup_dir[0]) {
SAFECOPY(str,startup_dir);
str=/sbbs/xtrn/dos/lord/
/* if theres a trailing slash, dump it */
p=lastchar(str);
if (*p=='/') *p=0;
str=/sbbs/xtrn/dos/lord
if ((p=strrchr(str, '/'))!=NULL)
SAFECOPY(str,p+1); /* str = game's starting dir */
str=
That's odd. If you replace that "SAFECOPY" call with "strcpy", does the same problem happen?
| Sysop: | Winzlo |
|---|---|
| Location: | Minnesota, USA |
| Users: | 11 |
| Nodes: | 16 (0 / 16) |
| Uptime: | 495937:19:08 |
| Calls: | 82 |
| Files: | 1,070 |
| D/L today: |
27 files (11,920K bytes) |
| Messages: | 286,956 |