Skip to content

Commit ff2c839

Browse files
authored
Merge pull request #1860 from chashiv/fix_unclosed_group
Fix unclosed group
2 parents ed644e4 + a675633 commit ff2c839

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/textcode/strings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def is_relative_path(s):
202202
Return True if s looks like a relative posix path.
203203
Example: usr/lib/librt.so.1 or ../usr/lib
204204
"""
205-
relative = re.compile('^(?:([^/]|\\.\\.)[\\w_\\-]+/.*$', re.IGNORECASE).match
205+
relative = re.compile('^(?:([^/]|\\.\\.)[\\w_\\-]+/.*$)', re.IGNORECASE).match
206206
return relative(s)
207207

208208

tests/textcode/test_strings.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,12 @@ def test_strings_in_all_bin(self):
182182
test_file = os.path.join(test_dir, tf)
183183
expected_file = os.path.join(expec_dir, tf + '.strings')
184184
self.check_file_strings(test_file, expected_file)
185+
186+
def test_is_relative_path(self):
187+
# Win Path
188+
path = "c:\\usr\\lib\\librt.so.1."
189+
self.assertFalse(strings.is_relative_path(path))
190+
191+
# Relative Posix Path
192+
path = "usr/lib/librt.so.1"
193+
self.assertTrue(strings.is_relative_path(path))

0 commit comments

Comments
 (0)