FastLED 3.9.15
Loading...
Searching...
No Matches

◆ fastled_file_offset()

const char * fl::fastled_file_offset ( const char * file)

Definition at line 56 of file log.cpp.hpp.

56 {
57 const char *p = file;
58 const char *last_slash = nullptr;
59
60 while (*p) {
61 // Check for "src/" or "src\\" (handle both Unix and Windows paths)
62 if (p[0] == 's' && p[1] == 'r' && p[2] == 'c' && (p[3] == '/' || p[3] == '\\')) {
63 return p; // Skip past "src/" or "src\\"
64 }
65 // Track both forward slash and backslash
66 if (*p == '/' || *p == '\\') {
67 last_slash = p;
68 }
69 p++;
70 }
71 // If "src/" or "src\\" not found but we found at least one slash, return after the
72 // last slash
73 if (last_slash) {
74 return last_slash + 1;
75 }
76 return file; // If no slashes found at all, return original path
77}