Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable substitution eats characters on end of line (closing brackets get eaten) #154

Closed
indyjo opened this issue Apr 11, 2014 · 0 comments
Labels
Milestone

Comments

@indyjo
Copy link

indyjo commented Apr 11, 2014

In files that are processed by FilteredFile, and in lines which are processed by Util.replaceVariables(), characters immediately preceding the end of line get eaten if they are a prefix of the opening or closing token (by default, [[ and ]]).

E.g., a postinst with the following content:

#!/bin/sh

if [ -e some_file ]
then
    echo blabla
fi 

gets mangled into

#!/bin/sh

if [ -e some_file 
then
    echo blabla
fi 

(notice the missing closing brace).

Reason seems to be Utils.replaceVariables(), where characters that match opening and closing braces are withheld from output until it is determined whether a complete token is read. On end of line, these characters are not flushed.

Observed in 1.1.1
Workaround for me: Don't close lines with a ] character.

@tcurdt tcurdt added the bug label Apr 11, 2014
@tcurdt tcurdt added this to the 1.2 milestone Apr 11, 2014
tcurdt added a commit that referenced this issue Jun 12, 2014
@tcurdt tcurdt closed this as completed Jun 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants