Fix a number of effc++ warnings in shell code
This commit is contained in:
parent
08a7f47c2b
commit
bb2088eb72
2 changed files with 29 additions and 17 deletions
|
@ -156,14 +156,18 @@ AutoexecObject::~AutoexecObject(){
|
|||
this->CreateAutoexec();
|
||||
}
|
||||
|
||||
DOS_Shell::DOS_Shell():Program(){
|
||||
input_handle=STDIN;
|
||||
echo=true;
|
||||
exit=false;
|
||||
bf=0;
|
||||
call=false;
|
||||
completion_start = NULL;
|
||||
}
|
||||
DOS_Shell::DOS_Shell()
|
||||
: Program(),
|
||||
l_history{},
|
||||
l_completion{},
|
||||
completion_start(nullptr),
|
||||
completion_index(0),
|
||||
input_handle(STDIN),
|
||||
bf(nullptr),
|
||||
echo(true),
|
||||
exit(false),
|
||||
call(false)
|
||||
{}
|
||||
|
||||
Bitu DOS_Shell::GetRedirection(char *s, char **ifn, char **ofn,bool * append) {
|
||||
|
||||
|
@ -371,7 +375,10 @@ private:
|
|||
AutoexecObject autoexec[17];
|
||||
AutoexecObject autoexec_echo;
|
||||
public:
|
||||
AUTOEXEC(Section* configuration):Module_base(configuration) {
|
||||
AUTOEXEC(Section* configuration)
|
||||
: Module_base(configuration),
|
||||
autoexec_echo()
|
||||
{
|
||||
/* Register a virtual AUOEXEC.BAT file */
|
||||
std::string line;
|
||||
Section_line * section=static_cast<Section_line *>(configuration);
|
||||
|
|
|
@ -23,17 +23,22 @@
|
|||
#include "shell.h"
|
||||
#include "support.h"
|
||||
|
||||
BatchFile::BatchFile(DOS_Shell * host,char const * const resolved_name,char const * const entered_name, char const * const cmd_line) {
|
||||
location = 0;
|
||||
prev=host->bf;
|
||||
echo=host->echo;
|
||||
shell=host;
|
||||
BatchFile::BatchFile(DOS_Shell *host,
|
||||
char const * const resolved_name,
|
||||
char const * const entered_name,
|
||||
char const * const cmd_line)
|
||||
: file_handle(0),
|
||||
location(0),
|
||||
echo(host->echo),
|
||||
shell(host),
|
||||
prev(host->bf),
|
||||
cmd(new CommandLine(entered_name, cmd_line)),
|
||||
filename("")
|
||||
{
|
||||
char totalname[DOS_PATHLENGTH+4];
|
||||
DOS_Canonicalize(resolved_name,totalname); // Get fullname including drive specificiation
|
||||
cmd = new CommandLine(entered_name,cmd_line);
|
||||
filename = totalname;
|
||||
|
||||
//Test if file is openable
|
||||
// Test if file is openable
|
||||
if (!DOS_OpenFile(totalname,(DOS_NOT_INHERIT|OPEN_READ),&file_handle)) {
|
||||
//TODO Come up with something better
|
||||
E_Exit("SHELL:Can't open BatchFile %s",totalname);
|
||||
|
|
Loading…
Add table
Reference in a new issue