diff --git a/src/juci.cc b/src/juci.cc index 8c6968a..d09c93b 100644 --- a/src/juci.cc +++ b/src/juci.cc @@ -30,8 +30,7 @@ int Application::on_command_line(const Glib::RefPtr boost::system::error_code ec; auto new_p=boost::filesystem::canonical(parent_p, ec); if(!ec && boost::filesystem::is_directory(new_p)) { - new_p+="/"; - new_p+=p.filename(); + new_p/=p.filename(); files.emplace_back(new_p); } else diff --git a/src/window.cc b/src/window.cc index 2315aa7..4aaca2a 100644 --- a/src/window.cc +++ b/src/window.cc @@ -164,7 +164,7 @@ void Window::set_menu_actions() { if(filesystem::write(path)) { if(Directories::get().current_path!="") Directories::get().update(); - notebook.open(path.string()); + notebook.open(boost::filesystem::canonical(path)); Terminal::get().print("New file "+path.string()+" created.\n"); } else @@ -223,7 +223,7 @@ void Window::set_menu_actions() { menu.add_action("open_file", [this]() { auto path=Dialog::open_file(); if(path!="") - notebook.open(path); + notebook.open(boost::filesystem::canonical(path)); }); menu.add_action("open_folder", [this]() { auto path = Dialog::open_folder();