Skip to content

Commit 3b11344

Browse files
committed
Improve constexpr to find root of file name
1 parent c54f51c commit 3b11344

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -725,15 +725,15 @@ void setup_printSignOnDashLine(void)
725725
printNl();
726726
}
727727

728-
static constexpr const char *filebasename2(const char *s, const char *p) {
728+
static constexpr const char *filebasename(const char *s, const char *p) {
729729
return p[0] == '\0' ? s :
730-
(p[0] == '/' || p[0] == '\\') ? filebasename2(p + 1, p + 1) :
731-
filebasename2(s, p + 1) ;
730+
(p[0] == '/' || p[0] == '\\') ? filebasename(p + 1, p + 1) :
731+
filebasename(s, p + 1) ;
732732
}
733733

734734
static constexpr const char *filebasename(const char *s)
735735
{
736-
return filebasename2(s, s);
736+
return filebasename(s, s);
737737
}
738738

739739
void printVersionFragment(char sep, uint8_t v) {

0 commit comments

Comments
 (0)