Skip to content
Snippets Groups Projects
  • Lyude Paul's avatar
    a8c256b4
    runner: Fix handling of metadata values containing spaces · a8c256b4
    Lyude Paul authored
    
    Noticed while running some tests that adding any kind of spaces into the
    name of a test run would stop igt_resume from working for said test run.
    Turns out that when we parse test metadata, we accidentally use the
    '%ms' specifier with fscanf() which finishes parsing strings when any
    kind of whitespace is encountered.
    
    So, fix this by using the proper %m[^\n] specifier, which dynamically
    allocates it's result and doesn't stop reading the string until a
    newline is encountered. Additionally, add a test for this.
    
    Signed-off-by: Lyude Paul's avatarLyude Paul <lyude@redhat.com>
    Reviewed-by: default avatarPetri Latvala <petri.latvala@intel.com>
    a8c256b4
    History
    runner: Fix handling of metadata values containing spaces
    Lyude Paul authored
    
    Noticed while running some tests that adding any kind of spaces into the
    name of a test run would stop igt_resume from working for said test run.
    Turns out that when we parse test metadata, we accidentally use the
    '%ms' specifier with fscanf() which finishes parsing strings when any
    kind of whitespace is encountered.
    
    So, fix this by using the proper %m[^\n] specifier, which dynamically
    allocates it's result and doesn't stop reading the string until a
    newline is encountered. Additionally, add a test for this.
    
    Signed-off-by: Lyude Paul's avatarLyude Paul <lyude@redhat.com>
    Reviewed-by: default avatarPetri Latvala <petri.latvala@intel.com>