Issue #16246 has been updated by Josh Cooper.

Status changed from Unreviewed to Accepted
Keywords set to windows backslash

This works as expected:

<pre>
$ puppet apply -e "notice('foo\\bar')"
notice: Scope(Class[main]): foo\bar
</pre>

As does:

<pre>
$ puppet apply -e 'notice("foo\\bar")'
notice: Scope(Class[main]): foo\bar
</pre>

But using a manifest does not:

<pre>
$ cat backslash.pp 
notice('foo\\bar')
$ puppet apply backslash.pp 
notice: Scope(Class[main]): foo\\bar
</pre>

Interestingly, the lexer defines a backslash token:

<pre>
TOKENS.add_token(
  ...
  '\\' => :BACKSLASH,
</pre>

But `BACKSLASH` it is never used anywhere.

Workaround, don't escape single backslashes, or use double quotes.
----------------------------------------
Bug #16246: Double backslashes in single quote strings should be interpreted as 
single
https://projects.puppetlabs.com/issues/16246#change-70611

Author: Erik Dalén
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.7.18
Keywords: windows backslash
Branch: 


Double backslashes in single quoted strings should be interpreted as single 
backslashes but aren't.

The following manifest:
    notice('foo\\bar')

Gives:
    notice: Scope(Class[main]): foo\\bar

This is not the behavior described at 
[http://docs.puppetlabs.com/guides/language_guide.html#quoting](http://docs.puppetlabs.com/guides/language_guide.html#quoting)


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to