mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:17:45 +00:00
LibCore: Avoid duplicate '/' in DirIterator::next_full_path()
When the root path of a DirIterator ends with '/', we don't need to add another '/' before appending the file name. Fixes an issue where files found by Assistant had 2 leading slashes.
This commit is contained in:
parent
70278d57ba
commit
e4a55404f1
1 changed files with 6 additions and 1 deletions
|
@ -77,7 +77,12 @@ String DirIterator::next_path()
|
||||||
|
|
||||||
String DirIterator::next_full_path()
|
String DirIterator::next_full_path()
|
||||||
{
|
{
|
||||||
return String::formatted("{}/{}", m_path, next_path());
|
StringBuilder builder;
|
||||||
|
builder.append(m_path);
|
||||||
|
if (!m_path.ends_with('/'))
|
||||||
|
builder.append('/');
|
||||||
|
builder.append(next_path());
|
||||||
|
return builder.to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
String find_executable_in_path(String filename)
|
String find_executable_in_path(String filename)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue