| 763 | } |
| 764 | |
| 765 | void File::buildBaseFilename(const std::string& fullPath, char buff[], std::size_t limit, const char* separator) { |
| 766 | const char *filename = fullPath.c_str(); |
| 767 | std::size_t lastSlashAt = fullPath.find_last_of(separator); |
| 768 | filename += lastSlashAt ? lastSlashAt+1 : 0; |
| 769 | std::size_t sizeOfFilename = strlen(filename); |
| 770 | if (sizeOfFilename >= limit) { |
| 771 | filename += (sizeOfFilename - limit); |
| 772 | if (filename[0] != '.' && filename[1] != '.') { // prepend if not already |
| 773 | filename += 3; // 3 = '..' |
| 774 | STRCAT(buff, "..", limit); |
| 775 | } |
| 776 | } |
| 777 | STRCAT(buff, filename, limit); |
| 778 | } |
| 779 | |
| 780 | // Str |
| 781 |
nothing calls this directly
no outgoing calls
no test coverage detected