Skip to content

Commit a9c46d5

Browse files
committed
Merge pull request #252 from Atari2/master
Fix a vfs bug and enable compilation when using C++17 or later on Windows.
1 parent 9b3c711 commit a9c46d5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/asar/interface-cli.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void error_interface(int errid, int whichpass, const char * e_)
4444
errnum++;
4545
// don't show current block if the error came from an error command
4646
bool show_block = (thisblock && (errid != error_id_error_command));
47-
fputs(STR getdecor() + "error: (" + get_error_name((asar_error_id)errid) + "): " + e_ + (show_block ? (STR" [" + thisblock + "]") : "") + "\n", errloc);
47+
fputs(STR getdecor() + "error: (" + get_error_name((asar_error_id)errid) + "): " + e_ + (show_block ? (STR" [" + thisblock + "]") : STR "") + "\n", errloc);
4848
static const int max_num_errors = 20;
4949
if (errnum == max_num_errors + 1) asar_throw_error(pass, error_type_fatal, error_id_limit_reached, max_num_errors);
5050
}
@@ -57,7 +57,7 @@ void warn(int errid, const char * e_)
5757
{
5858
// don't show current block if the warning came from a warn command
5959
bool show_block = (thisblock && (errid != warning_id_warn_command));
60-
fputs(STR getdecor()+"warning: (" + get_warning_name((asar_warning_id)errid) + "): " + e_ + (show_block ? (STR" [" + thisblock + "]") : "") + "\n", errloc);
60+
fputs(STR getdecor()+"warning: (" + get_warning_name((asar_warning_id)errid) + "): " + e_ + (show_block ? (STR" [" + thisblock + "]") : STR "") + "\n", errloc);
6161
warned=true;
6262
}
6363

src/asar/interface-lib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void fillerror(errordata& myerr, int errid, const char * type, const char
9090
if (thisblock) myerr.block= duplicate_string(thisblock);
9191
else myerr.block= duplicate_string("");
9292
myerr.rawerrdata= duplicate_string(str);
93-
myerr.fullerrdata= duplicate_string(STR getdecor()+type+str+((thisblock&&show_block)?(STR" ["+thisblock+"]"):""));
93+
myerr.fullerrdata= duplicate_string(STR getdecor()+type+str+((thisblock&&show_block)?(STR" ["+thisblock+"]"):STR ""));
9494
myerr.callerline=callerline;
9595
myerr.callerfilename=callerfilename ? duplicate_string(callerfilename) : nullptr;
9696
// RPG Hacker: TODO: Rework this once we bump the DLL API version again.

src/asar/virtualfile.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,9 @@ virtual_filesystem::virtual_file_type virtual_filesystem::get_file_type_from_pat
259259

260260
void virtual_filesystem::add_memory_file(const char* name, const void* buffer, size_t length) {
261261
memory_buffer mem_buf = { buffer, length };
262-
m_memory_files.remove(name);
263-
m_memory_files.create(name) = mem_buf;
262+
string normalized_path = normalize_path(name);
263+
m_memory_files.remove(normalized_path);
264+
m_memory_files.create(normalized_path) = mem_buf;
264265

265266
}
266267

0 commit comments

Comments
 (0)