make_makefile_swig sometimes goes into infinite loop #561

Added a check to see if array has elements before we shift an empty array.
This commit is contained in:
Alex Lin 2018-02-09 09:38:58 -06:00
parent 049c9a3207
commit 3ac538775b

View File

@ -27,7 +27,7 @@ sub get_paths {
# trim whitespace
@paths = map { s/(^\s+|\s+$)//g ; $_ } @paths ;
# Remove empty elements. Sort forced all blank names to the front.
while ( not length @paths[0] ) {
while ( scalar @paths and not length @paths[0] ) {
shift @paths ;
}
@paths = map { (-e $_) ? abs_path($_) : $_ } @paths ;