Skip to content

Escape sequences in source code are converted to raw characters #9

@idpaterson

Description

@idpaterson

Escape characters written in code as \n and \t are converted to their character equivalents before being sent to uncrustify. This can very easily break code regardless of how conservative the uncrustify settings may be.

The problem is due to using echo to pipe the source code to uncrustify. echo decodes the escape characters, sending invalid input to uncrustify.

I have resolved this in pull request #8 by using herestring input which leaves the escape characters intact:

set formatted_source to do shell script "/usr/local/bin/uncrustify -l OC -q -c ~/.uncrustify.cfg <<< " & raw_source

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions