Skip to content

Commit

Permalink
StringProcessing: Fix single-backslash bug
Browse files Browse the repository at this point in the history
Bug fixed in function unescape().

Fixes #483.
  • Loading branch information
Makman2 committed Apr 26, 2015
1 parent 4ff6ebc commit b982315
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions coalib/parsing/StringProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ def unescape(string):
:param string: The string to unescape.
"""
if string == "\\":
return ""

regex = r"\\(.)"

def replacement_function(match):
Expand Down
2 changes: 1 addition & 1 deletion coalib/tests/parsing/StringProcessingTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def set_up_unescape(self):
r"out1 'str1''str2''str3' out2",
r"",
r"out1 out2 out3",
self.bs,
r"",
self.bs]

def assertSearchForResultEqual(self,
Expand Down

2 comments on commit b982315

@sils
Copy link
Member

@sils sils commented on b982315 Apr 26, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but if I now provide "anything" this won't work

@Makman2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah damn never thought about that... Will fix^^

Please sign in to comment.