Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code to replace path separators on DOS-based filesystems is invalid #2971

Open
CohenArthur opened this issue Apr 24, 2024 · 2 comments
Open
Assignees
Labels

Comments

@CohenArthur
Copy link
Member

  // On windows, the path might mix '/' and '\' separators. Replace the
  // UNIX-like separators by MSDOS separators to make sure the path will resolve
  // properly.
  //
  // Source: rustc compiler
  // (https://github.com/rust-lang/rust/blob/9863bf51a52b8e61bcad312f81b5193d53099f9f/compiler/rustc_expand/src/module.rs#L174)
#if defined(HAVE_DOS_BASED_FILE_SYSTEM)
  path.replace ('/', '\\');
#endif /* HAVE_DOS_BASED_FILE_SYSTEM */

this code is invalid, and throws an error about a lack of matching function. https://en.cppreference.com/w/cpp/string/basic_string/replace shows that indeed this is not a correct usage of the function, and that we should change it.

@CohenArthur
Copy link
Member Author

This is also mentioned in #2843 and can be replaced with a call to std::replace

@CohenArthur CohenArthur self-assigned this May 6, 2024
@CohenArthur
Copy link
Member Author

Assigning this to myself because this has been fixed by a patch from a GCC contributor, which I need to tweak and push here as a PR

@CohenArthur CohenArthur added the windows/wine DOS-related issue label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant