Skip to content

Commit

Permalink
Hotfix for #66273 (#66287)
Browse files Browse the repository at this point in the history
* Append a path delimiter for the 'dot' directory.

* Update src/filesystem.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
alef and github-actions[bot] authored Jun 18, 2023
1 parent f771f3b commit c3e2de8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ std::string as_norm_dir( const std::string &path )
{
fs::path dir = fs::u8path( path ) / fs::path{};
fs::path norm = dir.lexically_normal();
return norm.generic_u8string();
std::string ret = norm.generic_u8string();
if( "." == ret ) {
ret = "./"; // TODO Change the many places that use strings instead of paths
}
return ret;
}

std::string as_norm_dir( const fs::path &path )
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ int main( int argc, const char *argv[] )
# if defined(USE_HOME_DIR) || defined(USE_XDG_DIR)
PATH_INFO::init_user_dir( "" );
# else
PATH_INFO::init_user_dir( "./" );
PATH_INFO::init_user_dir( "." );
# endif
#endif
PATH_INFO::set_standard_filenames();
Expand Down

0 comments on commit c3e2de8

Please sign in to comment.