Skip to content

Commit

Permalink
- Merging
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Oct 20, 2010
2 parents 5fb9bbe + 20ecc71 commit ebc6a51
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions Compiler/Error.mo
Expand Up @@ -995,6 +995,7 @@ everyone running the testsuite."
output String outFilename;
algorithm
outFilename := matchcontinue filename
case "" then ""; // Absyn.dummyInfo
case filename
equation
true = RTOpts.getRunningTestsuite();
Expand Down
12 changes: 11 additions & 1 deletion Compiler/runtime/System_rml.c
Expand Up @@ -378,10 +378,20 @@ RML_END_LABEL
RML_BEGIN_LABEL(System__basename)
{
const char *str = RML_STRINGDATA(rmlA0);
#if defined(__MINGW32__) || defined(_MSC_VER)
const char* res = strrchr(str, '\\');
if (res == NULL) { res = strrchr(str, '/'); }
if (res == NULL) { res = str; } else { ++res; }
rmlA0 = (void*) mk_scon(res);
#else
/* The POSIX version uses basename which is a bit more robust.
* But it may modify the contents of the pointer.
*/
char *copy = strdup(str);
char *res = basename(copy); /* basename may modify the contents */
char *res = basename(copy);
rmlA0 = (void*) mk_scon(res);
free(copy);
#endif
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL
Expand Down

0 comments on commit ebc6a51

Please sign in to comment.