File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,13 +220,30 @@ path_transcoder
220220path_transcoder::from (std::string arg)
221221{
222222 if (cget (arg, 1 ).value_or (' \0 ' ) != ' :' ) {
223+ std::optional<bool > caps;
223224#if defined(__MSYS__)
224225 if (arg.find (' \\ ' ) != std::string::npos) {
225226 std::replace (arg.begin (), arg.end (), ' \\ ' , ' /' );
226- return {arg, false };
227+ caps = false ;
228+ }
229+ if (startswith (arg, " /" )) {
230+ auto cwd = std::filesystem::current_path ();
231+ auto cwd_iter = std::next (cwd.begin ());
232+ auto cwd_first_str = cwd_iter->string ();
233+ if (cwd_first_str == " cygdrive" ) {
234+ auto drive_iter = std::next (cwd_iter);
235+ if (drive_iter != cwd.end ()) {
236+ auto cwd_drive_str = drive_iter->string ();
237+ arg.insert (0 , cwd_drive_str);
238+ arg.insert (0 , " /" );
239+ caps = true ;
240+ }
241+ }
242+ arg.insert (0 , cwd_first_str);
243+ arg.insert (0 , " /" );
227244 }
228245#endif
229- return {arg};
246+ return {arg, caps };
230247 }
231248
232249 bool caps = isupper (arg[0 ]);
You can’t perform that action at this time.
0 commit comments