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

Double escaping on ranges of std::filesystem::path #3319

Closed
phprus opened this issue Feb 25, 2023 · 0 comments
Closed

Double escaping on ranges of std::filesystem::path #3319

phprus opened this issue Feb 25, 2023 · 0 comments

Comments

@phprus
Copy link
Contributor

phprus commented Feb 25, 2023

Code (https://godbolt.org/z/MGsqqnfb5):

#include <filesystem>
#include <vector>
#include <variant>
#include <fmt/ranges.h>
#include <fmt/std.h>

int main(int argc, char* argv[]) {
    std::vector<std::filesystem::path> files = {"path/file.ext", "path2/file2.txt"};
    fmt::println("{}", files);

    std::vector<std::variant<std::filesystem::path, std::string, int>> v = {std::filesystem::path("path/file.ext"), std::string("string"), 1};
    fmt::println("{}", v);

    return 0;
}

Output:

["\"path/file.ext\"", "\"path2/file2.txt\""]
[variant("path/file.ext"), variant("string"), variant(1)]

Expected output:

["path/file.ext", "path2/file2.txt"]
[variant("path/file.ext"), variant("string"), variant(1)]

phprus added a commit to phprus/fmt that referenced this issue Feb 25, 2023
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
phprus added a commit to phprus/fmt that referenced this issue Feb 26, 2023
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
phprus added a commit to phprus/fmt that referenced this issue Feb 26, 2023
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
phprus added a commit to phprus/fmt that referenced this issue Feb 26, 2023
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
phprus added a commit to phprus/fmt that referenced this issue Mar 4, 2023
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
@vitaut vitaut closed this as completed Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants