From e63ca12ab815e0cd4d5cc7fd129cde04f7c4404a Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 6 Sep 2014 18:10:36 +0000 Subject: (svn r26775) -Cleanup [Squirrel]: "resolve" several of the unicode wrapper defines --- src/script/squirrel_std.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/script/squirrel_std.cpp') diff --git a/src/script/squirrel_std.cpp b/src/script/squirrel_std.cpp index ccd8affc1..ccebe2015 100644 --- a/src/script/squirrel_std.cpp +++ b/src/script/squirrel_std.cpp @@ -19,7 +19,8 @@ #include "../string_func.h" /* Due to the different characters for Squirrel, the scstrcat might be a simple - * strcat which triggers the safeguard. But it isn't always a simple strcat. */ + * strcat which triggers the safeguard. But it isn't always a simple strcat. + * TODO: use properly safe functions now that Squirrel uses chars exclusively. */ #include "../safeguards.h" #undef strcat #undef strdup @@ -60,9 +61,9 @@ SQInteger SquirrelStd::require(HSQUIRRELVM vm) DEBUG(misc, 0, "[squirrel] Couldn't detect the script-name of the 'require'-caller; this should never happen!"); return SQ_ERROR; } - real_filename = scstrdup(si.source); + real_filename = strdup(si.source); /* Keep the dir, remove the rest */ - SQChar *s = scstrrchr(real_filename, PATHSEPCHAR); + SQChar *s = strrchr(real_filename, PATHSEPCHAR); if (s != NULL) { /* Keep the PATHSEPCHAR there, remove the rest */ s++; @@ -70,8 +71,8 @@ SQInteger SquirrelStd::require(HSQUIRRELVM vm) } /* And now we concat, so we are relative from the current script * First, we have to make sure we have enough space for the full path */ - real_filename = ReallocT(real_filename, scstrlen(real_filename) + scstrlen(filename) + 1); - scstrcat(real_filename, filename); + real_filename = ReallocT(real_filename, strlen(real_filename) + strlen(filename) + 1); + strcat(real_filename, filename); /* Tars dislike opening files with '/' on Windows.. so convert it to '\\' ;) */ char *filen = stredup(real_filename); #if (PATHSEPCHAR != '/') -- cgit v1.2.3-54-g00ecf