Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
bf4b140b
Commit
bf4b140b
authored
22 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
More case-insensitivity fixes for executing Baja and JS modules on Unix.
parent
f039980a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/exec.cpp
+9
-7
9 additions, 7 deletions
src/sbbs3/exec.cpp
with
9 additions
and
7 deletions
src/sbbs3/exec.cpp
+
9
−
7
View file @
bf4b140b
...
@@ -589,17 +589,17 @@ long sbbs_t::js_execfile(char *cmd)
...
@@ -589,17 +589,17 @@ long sbbs_t::js_execfile(char *cmd)
}
}
fname
=
cmdline
;
fname
=
cmdline
;
/* Add extension if not specified */
if
(
strcspn
(
fname
,
"/
\\
"
)
==
strlen
(
fname
))
{
if
(
strcspn
(
fname
,
"/
\\
"
)
==
strlen
(
fname
))
{
sprintf
(
path
,
"%s%s"
,
cfg
.
mods_dir
,
fname
);
sprintf
(
path
,
"%s%s"
,
cfg
.
mods_dir
,
fname
);
if
(
cfg
.
mods_dir
[
0
]
==
0
||
!
fexist
(
path
))
if
(
cfg
.
mods_dir
[
0
]
==
0
||
!
fexist
case
(
path
))
sprintf
(
path
,
"%s%s"
,
cfg
.
exec_dir
,
fname
);
sprintf
(
path
,
"%s%s"
,
cfg
.
exec_dir
,
fname
);
}
else
}
else
sprintf
(
path
,
"%.*s"
,(
int
)
sizeof
(
path
)
-
4
,
fname
);
sprintf
(
path
,
"%.*s"
,(
int
)
sizeof
(
path
)
-
4
,
fname
);
/* Add extension if not specified */
if
(
!
strchr
(
path
,
'.'
))
if
(
!
strchr
(
path
,
'.'
))
strcat
(
path
,
".js"
);
strcat
(
path
,
".js"
);
if
(
!
fexist
(
path
))
{
if
(
!
fexist
case
(
path
))
{
errormsg
(
WHERE
,
ERR_OPEN
,
path
,
O_RDONLY
);
errormsg
(
WHERE
,
ERR_OPEN
,
path
,
O_RDONLY
);
return
(
-
1
);
return
(
-
1
);
}
}
...
@@ -668,11 +668,11 @@ long sbbs_t::exec_bin(char *mod, csi_t *csi)
...
@@ -668,11 +668,11 @@ long sbbs_t::exec_bin(char *mod, csi_t *csi)
#ifdef JAVASCRIPT
#ifdef JAVASCRIPT
if
(
cfg
.
mods_dir
[
0
])
{
if
(
cfg
.
mods_dir
[
0
])
{
sprintf
(
str
,
"%s%s.js"
,
cfg
.
mods_dir
,
mod
);
sprintf
(
str
,
"%s%s.js"
,
cfg
.
mods_dir
,
mod
);
if
(
fexist
(
str
))
if
(
fexist
case
(
str
))
return
(
js_execfile
(
str
));
return
(
js_execfile
(
str
));
}
}
sprintf
(
str
,
"%s%s.js"
,
cfg
.
exec_dir
,
mod
);
sprintf
(
str
,
"%s%s.js"
,
cfg
.
exec_dir
,
mod
);
if
(
fexist
(
str
))
if
(
fexist
case
(
str
))
return
(
js_execfile
(
str
));
return
(
js_execfile
(
str
));
#endif
#endif
...
@@ -684,8 +684,10 @@ long sbbs_t::exec_bin(char *mod, csi_t *csi)
...
@@ -684,8 +684,10 @@ long sbbs_t::exec_bin(char *mod, csi_t *csi)
strcat
(
modname
,
".bin"
);
strcat
(
modname
,
".bin"
);
sprintf
(
str
,
"%s%s"
,
cfg
.
mods_dir
,
modname
);
sprintf
(
str
,
"%s%s"
,
cfg
.
mods_dir
,
modname
);
if
(
cfg
.
mods_dir
[
0
]
==
0
||
!
fexist
(
str
))
if
(
cfg
.
mods_dir
[
0
]
==
0
||
!
fexist
case
(
str
))
{
sprintf
(
str
,
"%s%s"
,
cfg
.
exec_dir
,
modname
);
sprintf
(
str
,
"%s%s"
,
cfg
.
exec_dir
,
modname
);
fexistcase
(
str
);
}
if
((
file
=
nopen
(
str
,
O_RDONLY
))
==-
1
)
{
if
((
file
=
nopen
(
str
,
O_RDONLY
))
==-
1
)
{
errormsg
(
WHERE
,
ERR_OPEN
,
str
,
O_RDONLY
);
errormsg
(
WHERE
,
ERR_OPEN
,
str
,
O_RDONLY
);
return
(
-
1
);
return
(
-
1
);
...
@@ -1171,7 +1173,7 @@ int sbbs_t::exec(csi_t *csi)
...
@@ -1171,7 +1173,7 @@ int sbbs_t::exec(csi_t *csi)
console
|=
CON_R_ECHO
;
console
|=
CON_R_ECHO
;
break
;
break
;
case
CS_CHKFILE
:
case
CS_CHKFILE
:
csi
->
logic
=!
fexist
(
cmdstr
((
char
*
)
csi
->
ip
,
path
,
csi
->
str
,(
char
*
)
buf
));
csi
->
logic
=!
fexist
case
(
cmdstr
((
char
*
)
csi
->
ip
,
path
,
csi
->
str
,(
char
*
)
buf
));
break
;
break
;
case
CS_EXEC
:
case
CS_EXEC
:
external
(
cmdstr
((
char
*
)
csi
->
ip
,
path
,
csi
->
str
,(
char
*
)
buf
),
0
);
external
(
cmdstr
((
char
*
)
csi
->
ip
,
path
,
csi
->
str
,(
char
*
)
buf
),
0
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment