Skip to content

Script quits when \n is in a filename #11

@dd388

Description

@dd388

Most linebreaks in filenames on testing disk images have been \r, but I have spotted one that ends in \n. Since the parser splits on \n when pulling in output from hls this causes a line that doesn't match either regular expression and the script fails.

This hopefully is a really weird edge case, but I should account for it.

Possible solution--
Add two more regexes to quickly identify the start of a file or directory line. If the file line does not end in a double quote (and or if the next line consists of just double quotes), assume this is because a line split broke before the end of the quoting of the filename. Add a double quote to the end of the string and re-parse. Skip the next line that consists of one pair of double quotes. Do the same for directories.

This is, of course, the best I can factor at the end of the day on a Friday. Maybe I'll have a better solution later.

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