diff --git a/src/shell/shell.cpp b/src/shell/shell.cpp index bc739e06..7441dc96 100644 --- a/src/shell/shell.cpp +++ b/src/shell/shell.cpp @@ -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(configuration); diff --git a/src/shell/shell_batch.cpp b/src/shell/shell_batch.cpp index 033def6f..622da38d 100644 --- a/src/shell/shell_batch.cpp +++ b/src/shell/shell_batch.cpp @@ -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);