Skip to content
Snippets Groups Projects
Commit da43d845 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Command-lines that start with '?' or '*' are implicitly native

Don't do the DOSEMU drive-letter dance for xtrn startup directory if the xtrn's command line is implicitly native (e.g. Baja or JS).

Also, recognize Baja command-lines as native in cmdstr() - for %n, %!, etc. DOSemu expansion hack.
parent 57d41ded
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #884 passed
/* xtrn.cpp */
// vi: tabstop=4
/* Synchronet external program support routines */ /* Synchronet external program support routines */
/* $Id: xtrn.cpp,v 1.263 2020/08/02 20:23:34 rswindell Exp $ */
/**************************************************************************** /****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
...@@ -18,21 +13,9 @@ ...@@ -18,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or * * See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html * * http://www.fsf.org/copyleft/gpl.html *
* * * *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see * * For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html * * http://www.synchro.net/source.html *
* * * *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. * * Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/ ****************************************************************************/
#include "sbbs.h" #include "sbbs.h"
...@@ -1856,6 +1839,9 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch ...@@ -1856,6 +1839,9 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch
char str[MAX_PATH+1],*cmd; char str[MAX_PATH+1],*cmd;
int i,j,len; int i,j,len;
if(mode == EX_UNSPECIFIED && (*instr == '?' || *instr == '*'))
mode = EX_NATIVE;
if(outstr==NULL) if(outstr==NULL)
cmd=cmdstr_output; cmd=cmdstr_output;
else else
...@@ -1888,7 +1874,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch ...@@ -1888,7 +1874,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch
break; break;
case 'F': /* File path */ case 'F': /* File path */
#if defined(__linux__) && defined(USE_DOSEMU) #if defined(__linux__) && defined(USE_DOSEMU)
if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE) if(!(mode & EX_NATIVE)
&& strncmp(fpath, cfg.node_dir, strlen(cfg.node_dir)) == 0) { && strncmp(fpath, cfg.node_dir, strlen(cfg.node_dir)) == 0) {
strncat(cmd, DOSEMU_NODE_DIR, avail); strncat(cmd, DOSEMU_NODE_DIR, avail);
strncat(cmd, fpath + strlen(cfg.node_dir), avail); strncat(cmd, fpath + strlen(cfg.node_dir), avail);
...@@ -1899,7 +1885,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch ...@@ -1899,7 +1885,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch
break; break;
case 'G': /* Temp directory */ case 'G': /* Temp directory */
#if defined(__linux__) && defined(USE_DOSEMU) #if defined(__linux__) && defined(USE_DOSEMU)
if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) if(!(mode & EX_NATIVE))
strncat(cmd, DOSEMU_TEMP_DIR, avail); strncat(cmd, DOSEMU_TEMP_DIR, avail);
else else
#endif #endif
...@@ -1913,7 +1899,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch ...@@ -1913,7 +1899,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch
break; break;
case 'J': case 'J':
#if defined(__linux__) && defined(USE_DOSEMU) #if defined(__linux__) && defined(USE_DOSEMU)
if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) if(!(mode & EX_NATIVE))
strncat(cmd, DOSEMU_DATA_DIR, avail); strncat(cmd, DOSEMU_DATA_DIR, avail);
else else
#endif #endif
...@@ -1921,7 +1907,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch ...@@ -1921,7 +1907,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch
break; break;
case 'K': case 'K':
#if defined(__linux__) && defined(USE_DOSEMU) #if defined(__linux__) && defined(USE_DOSEMU)
if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) if(!(mode & EX_NATIVE))
strncat(cmd, DOSEMU_CTRL_DIR, avail); strncat(cmd, DOSEMU_CTRL_DIR, avail);
else else
#endif #endif
...@@ -1935,7 +1921,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch ...@@ -1935,7 +1921,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch
break; break;
case 'N': /* Node Directory (same as SBBSNODE environment var) */ case 'N': /* Node Directory (same as SBBSNODE environment var) */
#if defined(__linux__) && defined(USE_DOSEMU) #if defined(__linux__) && defined(USE_DOSEMU)
if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) if(!(mode & EX_NATIVE))
strncat(cmd, DOSEMU_NODE_DIR, avail); strncat(cmd, DOSEMU_NODE_DIR, avail);
else else
#endif #endif
...@@ -1980,7 +1966,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch ...@@ -1980,7 +1966,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch
break; break;
case 'Z': case 'Z':
#if defined(__linux__) && defined(USE_DOSEMU) #if defined(__linux__) && defined(USE_DOSEMU)
if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) if(!(mode & EX_NATIVE))
strncat(cmd, DOSEMU_TEXT_DIR, avail); strncat(cmd, DOSEMU_TEXT_DIR, avail);
else else
#endif #endif
...@@ -1998,7 +1984,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch ...@@ -1998,7 +1984,7 @@ char* sbbs_t::cmdstr(const char *instr, const char *fpath, const char *fspec, ch
break; break;
case '!': /* EXEC Directory */ case '!': /* EXEC Directory */
#if defined(__linux__) && defined(USE_DOSEMU) #if defined(__linux__) && defined(USE_DOSEMU)
if(*instr != '?' && mode != EX_UNSPECIFIED && !(mode & EX_NATIVE)) if(!(mode & EX_NATIVE))
strncat(cmd, DOSEMU_EXEC_DIR, avail); strncat(cmd, DOSEMU_EXEC_DIR, avail);
else else
#endif #endif
......
/* xtrn_sec.cpp */
/* Synchronet external program/door section and drop file routines */ /* Synchronet external program/door section and drop file routines */
/* $Id: xtrn_sec.cpp,v 1.91 2020/08/01 18:34:24 rswindell Exp $ */
/**************************************************************************** /****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
...@@ -17,21 +13,9 @@ ...@@ -17,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or * * See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html * * http://www.fsf.org/copyleft/gpl.html *
* * * *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see * * For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html * * http://www.synchro.net/source.html *
* * * *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. * * Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/ ****************************************************************************/
...@@ -1611,7 +1595,7 @@ bool sbbs_t::exec_xtrn(uint xtrnnum) ...@@ -1611,7 +1595,7 @@ bool sbbs_t::exec_xtrn(uint xtrnnum)
char drop_file[MAX_PATH + 1]; char drop_file[MAX_PATH + 1];
char startup_dir[MAX_PATH + 1]; char startup_dir[MAX_PATH + 1];
#if defined(__linux__) && defined(USE_DOSEMU) #if defined(__linux__) && defined(USE_DOSEMU)
if(!(cfg.xtrn[xtrnnum]->misc & XTRN_NATIVE)) { if(cfg.xtrn[xtrnnum]->cmd[0] != '?' && cfg.xtrn[xtrnnum]->cmd[0] != '*' && !(cfg.xtrn[xtrnnum]->misc & XTRN_NATIVE)) {
SAFEPRINTF2(startup_dir, "%s\\%s", DOSEMU_XTRN_DRIVE, getdirname(cfg.xtrn[xtrnnum]->path)); SAFEPRINTF2(startup_dir, "%s\\%s", DOSEMU_XTRN_DRIVE, getdirname(cfg.xtrn[xtrnnum]->path));
backslash(startup_dir); backslash(startup_dir);
if(cfg.xtrn[xtrnnum]->misc & STARTUPDIR) if(cfg.xtrn[xtrnnum]->misc & STARTUPDIR)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment