@@ -359,9 +359,10 @@ def compile_patterns(self, patterns):
359359
360360 def walk_dirs (self ):
361361 match_expressions = self .compile_patterns (self .kwargs ['match_definitions' ])
362+
362363 for path in self .kwargs ['folders' ]:
363364 for r ,d ,f in os .walk (path ):
364- if not [skip for skip in self .kwargs ['exclude_dirs' ] if path + '/' + skip in r ]:
365+ if not [skip for skip in self .kwargs ['exclude_dirs' ] if os . path . join ( path , os . path . normpath ( skip )) in r ]:
365366 for _file in f :
366367 self .parse_file (_file , r , match_expressions )
367368
@@ -371,7 +372,7 @@ def reindex_file(self, index_key):
371372 if (file_path .endswith (".js" )
372373 and not file_path .endswith (tuple (self .kwargs ['exclude_file_suffixes' ]))
373374 and index_key in ng .projects_index_cache
374- and not [skip for skip in self .kwargs ['exclude_dirs' ] if skip in file_path ]):
375+ and not [skip for skip in self .kwargs ['exclude_dirs' ] if os . path . normpath ( skip ) in file_path ]):
375376 ng .alert ('Reindexing ' + self .kwargs ['file_path' ])
376377 project_index = ng .get_project_indexes_at (index_key )
377378
@@ -398,7 +399,8 @@ def reindex_file(self, index_key):
398399 def parse_file (self , file_path , r , match_expressions ):
399400 if (file_path .endswith (".js" )
400401 and not file_path .endswith (tuple (self .kwargs ['exclude_file_suffixes' ]))):
401- _file = codecs .open (r + '/' + file_path )
402+ _abs_file_path = os .path .join (r , file_path )
403+ _file = codecs .open (_abs_file_path )
402404 _lines = _file .readlines ();
403405 _file .close ()
404406 line_number = 1
@@ -409,7 +411,7 @@ def parse_file(self, file_path, r, match_expressions):
409411 for matched in matches :
410412 definition_name = matched [0 ] + ": "
411413 definition_name += matched [1 ].group (int (self .kwargs ['match_expression_group' ]))
412- self .function_matches .append ([definition_name , r + '/' + file_path , str (line_number )])
414+ self .function_matches .append ([definition_name , _abs_file_path , str (line_number )])
413415 line_number += 1
414416
415417 def get_definition_details (self , line_content , match_expressions ):
0 commit comments