File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ))
You can’t perform that action at this time.
0 commit comments