Skip to content

CSV parser always trims only the trailing whitespace of a field, no matter what trimFields is set to #12

Description

@Kwanddwo

In add_field, we have the following loop:

while (len > 0 && (start[len-1] == ' ' || start[len-1] == '\t')) {
    len--;
}

This always runs, meaning that the trailing whitespace of all fields is deleted, there is no code in csv_parser.c to trim leading whitespace.

Note: there is the csv_utils_trim_whitespace function in csv_utils.c that handles this

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions