Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion IntFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,13 @@ TValue *map_fclose(void *node, TArgs *args, Context &context) {
}

TValue *map_project_dir(void *node, TArgs *args, Context &context) {
char *s = cgt->ReadStrParam(PARAM_PROJECT_NAME, context.element);
char *s = cgt->ReadStrParam(PARAM_PROJECT_PATH, context.element);
std::string p(s);
#ifdef WIN32
int pos = p.find_last_of('\\');
#else
int pos = p.find_last_of('/');
#endif
TValue *val = new TValue(p.substr(0, pos+1).c_str(), true);
delete[] s;
return val;
Expand All @@ -417,8 +421,13 @@ TValue *map_project_dir(void *node, TArgs *args, Context &context) {
TValue *map_project_name(void *node, TArgs *args, Context &context) {
char *s = cgt->ReadStrParam(PARAM_PROJECT_NAME, context.element);
std::string p(s);
#ifdef WIN32
int pos = p.find_last_of('\\');
TValue *val = new TValue(p.substr(pos + 1, p.length() - pos).c_str(), true);
#else
int pos = p.find_last_of('/');
TValue *val = new TValue(p.substr(pos + 1, p.length() - pos - 5).c_str(), true);
#endif
delete[] s;
return val;
}
Expand Down