Fix escaped environment variable in configuration #549

Merged
witten merged 1 commits from essembeh/borgmatic:master into master 2022-06-23 17:16:11 +00:00
Contributor
  • when an env variable is escaped in the configuration file, we expect
    not to resolve it and remove the escape char \
- when an env variable is escaped in the configuration file, we expect not to resolve it and remove the escape char `\`
essembeh added 1 commit 2022-06-17 07:57:09 +00:00
b63c854509 Fix escaped environment variable in configuration
- when an env variable is escaped in the configuration file, we expect
  not to resolve it and remove the escape char `\`
witten reviewed 2022-06-23 17:14:41 +00:00
@ -12,1 +12,3 @@
name, default = matcher.group("name"), matcher.group("default")
if matcher.group('escape') is not None:
# in case of escaped envvar, unescape it
return matcher.group('variable')
Owner

There's a super edge case where an escaped \${FOO:-default} would not be treated properly, but probably not worth dealing with given how unlikely it is to occur in the wild.

There's a super edge case where an escaped `\${FOO:-default}` would not be treated properly, but probably not worth dealing with given how unlikely it is to occur in the wild.
witten merged commit c664c6b17b into master 2022-06-23 17:16:11 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#549
No description provided.