mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
util: skip "." completely in normalize_path()
Don't copy "." segments to the final_components list only to remove it afterwards.
This commit is contained in:
parent
0589f295fa
commit
5c0c336c6b
1 changed files with 3 additions and 3 deletions
|
@ -1567,11 +1567,11 @@ string normalize_path(const std::string_view path)
|
|||
for ( it = components.begin(); it != components.end(); ++it )
|
||||
{
|
||||
if ( *it == "" ) continue;
|
||||
if ( *it == "." && it != components.begin() ) continue;
|
||||
|
||||
final_components.push_back(*it);
|
||||
|
||||
if ( *it == "." && it != components.begin() )
|
||||
final_components.pop_back();
|
||||
else if ( *it == ".." )
|
||||
if ( *it == ".." )
|
||||
{
|
||||
auto cur_idx = final_components.size() - 1;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue