Skip to content

Commit

Permalink
Removed duplicate variable
Browse files Browse the repository at this point in the history
  • Loading branch information
12xx12 committed Mar 21, 2023
1 parent c16f294 commit de11bac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Server/Plugins/Core
Submodule Core updated 2 files
+2 −2 cmd_scoreboard.lua
+1 −1 core_motd.lua
10 changes: 4 additions & 6 deletions src/IniFile.cpp
Expand Up @@ -56,7 +56,7 @@ bool cIniFile::ReadFile(const AString & a_FileName, bool a_AllowExampleRedirect)
// a few bugs with ifstream. So ... fstream used.
fstream f;
AString line;
AString keyname, rawvalue, valuename, value;
AString keyname, valuename, value;
AString::size_type pLeft, pRight;
bool IsFromExampleRedirect = false;

Expand Down Expand Up @@ -146,8 +146,7 @@ bool cIniFile::ReadFile(const AString & a_FileName, bool a_AllowExampleRedirect)
case '=':
{
valuename = line.substr(0, pLeft);
rawvalue = TrimString(line.substr(pLeft + 1));
value = rawvalue;
value = TrimString(line.substr(pLeft + 1));
ReplaceString(value, "\\n", "\n");
AddValue(keyname, valuename, value);
break;
Expand Down Expand Up @@ -193,7 +192,7 @@ bool cIniFile::WriteFile(const AString & a_FileName) const
// Normally you would use ofstream, but the SGI CC compiler has
// a few bugs with ofstream. So ... fstream used.
fstream f;
AString runvalue, writevalue;
AString writevalue;

f.open((a_FileName).c_str(), ios::out);
if (f.fail())
Expand Down Expand Up @@ -226,8 +225,7 @@ bool cIniFile::WriteFile(const AString & a_FileName) const
// Values.
for (size_t valueID = 0; valueID < m_Keys[keyID].m_Names.size(); ++valueID)
{
runvalue = m_Keys[keyID].m_Values[valueID];
writevalue = runvalue;
writevalue = m_Keys[keyID].m_Values[valueID];
ReplaceString(writevalue, "\n", "\\n");
f << m_Keys[keyID].m_Names[valueID] << '=' << writevalue << iniEOL;
}
Expand Down

0 comments on commit de11bac

Please sign in to comment.