diff --git a/include/strings.cpp b/include/strings.cpp index dd56e2f49..c73912738 100755 --- a/include/strings.cpp +++ b/include/strings.cpp @@ -566,6 +566,20 @@ const char* TFilename::name() const return d+1; } +// Certified 90% +const char* TFilename::path() const +{ + const char* d = strrchr(_str, '\\'); + if (d == NULL) d = strrchr(_str, '/'); + if (d == NULL) + { + d = strchr(_str, ':'); + if (d != NULL) d++; + } + if (d == NULL) spark.cut(0); + else spark.strncpy(_str, d - _str); + return spark; +} // Certified 70% const TFilename& TFilename::tempdir()