Skip to content

Commit 9bc0ad7

Browse files
committed
More deprecated stuff removed
1 parent 1efbd79 commit 9bc0ad7

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

src/asar/assembleblock.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,13 +1956,12 @@ void assembleblock(const char * block)
19561956
{
19571957
const char* current_file = get_current_file_name();
19581958
string name;
1959-
#ifdef _WIN32
1959+
// RPG Hacker: Should this also throw on absolute paths?
1960+
// E.g., on something starting with C:/ or whatever.
19601961
if (strchr(par, '\\'))
19611962
{
1962-
//todo throw error
1963-
asar_throw_warning(0, warning_id_feature_deprecated, "windows specific paths", "convert paths to crossplatform style");
1963+
asar_throw_error(0, error_type_block, error_id_platform_paths);
19641964
}
1965-
#endif
19661965
name=safedequote(par);
19671966
assemblefile(name);
19681967
}
@@ -2002,13 +2001,12 @@ void assembleblock(const char * block)
20022001
}
20032002
const char* current_file = get_current_file_name();
20042003
string name;
2005-
#ifdef _WIN32
2004+
// RPG Hacker: Should this also throw on absolute paths?
2005+
// E.g., on something starting with C:/ or whatever.
20062006
if (strchr(par, '\\'))
20072007
{
2008-
//todo throw error
2009-
asar_throw_warning(0, warning_id_feature_deprecated, "windows specific paths", "convert paths to crossplatform style");
2008+
asar_throw_error(0, error_type_block, error_id_platform_paths);
20102009
}
2011-
#endif
20122010
name = safedequote(par);
20132011
char * data;//I couldn't find a way to get this into an autoptr
20142012
if (!readfile(name, current_file, &data, &len)) asar_throw_error(0, error_type_block, vfile_error_to_error_id(asar_get_last_io_error()), name.data());

src/asar/errors.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ static asar_error_mapping asar_errors[] =
298298

299299
{ ERR(macro_param_outside_macro), "Reference to macro parameter outside of macro" },
300300
{ ERR(invalid_depth_resolve), "Invalid %s resolution depth: Trying to backwards-resolve a %s using %i '^', but current scope only supports up to %i '^'." },
301+
302+
{ ERR(platform_paths), "Platform-specific paths aren'supported. Please use platform-independent paths (use / instead of \\)." },
301303
};
302304
// RPG Hacker: Sanity check. This makes sure that the element count of asar_error
303305
// matches with the number of constants in asar_error_id. This is important, because

src/asar/errors.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ enum asar_error_id : int
274274
error_id_macro_param_outside_macro,
275275
error_id_invalid_depth_resolve,
276276

277+
error_id_platform_paths,
278+
277279
error_id_end,
278280
error_id_count = error_id_end - error_id_start - 1,
279281
};

tests/invalid-paths.asm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
;`errEplatform_paths
2+
;`errEplatform_paths
3+
incsrc "include\data.asm"
4+
incbin "data\filename with spaces.bin"

0 commit comments

Comments
 (0)