Skip to content

Remove string splits with \r from renderer resource parsers #1666

@heinezen

Description

@heinezen

if (args[2][args[2].size() - 1] == '\r') {
texture.path = args[2].substr(1, args[2].size() - 3);
}
else {
texture.path = args[2].substr(1, args[2].size() - 2);
}

if (line.empty() || line.substr(0, 1) == "#" || line[0] == '\r') {

if (line.empty() || line.substr(0, 1) == "#" || line[0] == '\r') {

if (args[1][args[1].size() - 1] == '\r') {

if (line.empty() || line.substr(0, 1) == "#" || line[0] == '\r') {

This should not be handled in here, but in the string splitter code, see https://github.com/SFTtech/openage/blob/master/libopenage/util/strings.cpp

I guess we need a dedicated newline function for this that first splits at \n and then checks if the generated lines end with \r to also remove those.

Originally posted by @heinezen in #1642 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: rendererConcerns our graphics rendererbugBehaving differently as it should behaveimprovementEnhancement of an existing componentlang: c++Done in C++ code

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions