# # # patch "paths.cc" # from [defa5bd893d6db66107e50122713ee2769ce8d15] # to [94cfb3385d92668683114518029f786f89dbdd7b] # # patch "paths.hh" # from [08558986bab9f92e47d7cb678ef8cdf19f50be8c] # to [20b799a53ccd8b1c6188c554d24e15f2872be59a] # # patch "work.cc" # from [71b9a127c2d704dbd9ea048a44e7b6aaf5f89afb] # to [fdd9806c7a8fe502a405bfe2902ecf76e91a5d82] # ============================================================ --- paths.cc defa5bd893d6db66107e50122713ee2769ce8d15 +++ paths.cc 94cfb3385d92668683114518029f786f89dbdd7b @@ -1048,6 +1048,12 @@ void } void +get_current_workspace(system_path & workspace) +{ + workspace = working_root.get_but_unused(); +} + +void mark_std_paths_used(void) { working_root.get(); ============================================================ --- paths.hh 08558986bab9f92e47d7cb678ef8cdf19f50be8c +++ paths.hh 20b799a53ccd8b1c6188c554d24e15f2872be59a @@ -469,6 +469,10 @@ go_to_workspace(system_path const & new_ void go_to_workspace(system_path const & new_workspace); +// returns the currently active workspace path +void +get_current_workspace(system_path & workspace); + void mark_std_paths_used(void); file_path ============================================================ --- work.cc 71b9a127c2d704dbd9ea048a44e7b6aaf5f89afb +++ work.cc fdd9806c7a8fe502a405bfe2902ecf76e91a5d82 @@ -642,9 +642,8 @@ workspace::set_options(options const & o var_name name("known-workspaces", origin::internal); var_key key(make_pair(domain, name)); - // there is no easy way to aquire the system path of the current - // workspace, but this should do it as well - std::string cur_workspace = system_path(".").as_internal(); + system_path current_workspace; + get_current_workspace(current_workspace); database old_db(cur_opts, lua); if (old_db.var_exists(key)) @@ -658,7 +657,7 @@ workspace::set_options(options const & o std::vector::iterator pos = std::find(workspaces.begin(), workspaces.end(), - cur_workspace); + current_workspace.as_internal()); if (pos != workspaces.end()) workspaces.erase(pos); @@ -679,9 +678,9 @@ workspace::set_options(options const & o std::vector::iterator pos = std::find(workspaces.begin(), workspaces.end(), - cur_workspace); + current_workspace.as_internal()); if (pos == workspaces.end()) - workspaces.push_back(cur_workspace); + workspaces.push_back(current_workspace.as_internal()); std::string ws; join_lines(workspaces, ws);