Files
Tejas Attarde dc033a8d5b fix(FilePath): getBaseName crashes on hidden files like .bashrc (#821)
* fix(FilePath): getBaseName crashes on hidden files like .bashrc

For hidden files the leading dot caused contains(".") to pass, then
lastIndexOf(".") returned 0, and substring(0, 0) produced an empty
string. FilePath.of("") throws IllegalArgumentException.

Replacing the contains check with lastIndexOf on the filename and
treating lastDot <= 0 as no-extension fixes both the no-dot and
hidden-file cases.

* fix(FilePath): throw IllegalStateException for dotfile in getBaseName

---------

Co-authored-by: Tejas <tejasae-afk@users.noreply.github.com>
2026-04-29 05:30:09 +02:00
..