@@ -1331,7 +1331,14 @@ sub read_config($$)
13311331
13321332 my $set_value = 0;
13331333 info(1, " read_config: $filename \n " );
1334- if (exists ($included_config_files {abs_path($filename )})) {
1334+ my $path = abs_path($filename );
1335+ if (!defined ($path )) {
1336+ lcovutil::ignorable_error($lcovutil::ERROR_USAGE ,
1337+ " config file '$filename ' does not exist" );
1338+ # as below - this line is unreachable because we can't ignore
1339+ # the message due to order of processing - see below.
1340+ return 0; # LCOV_UNREACHABLE_LINE
1341+ } elsif (exists ($included_config_files {$path })) {
13351342 lcovutil::ignorable_error($lcovutil::ERROR_USAGE ,
13361343 ' config file inclusion loop detected: "' .
13371344 join (' " -> "' , @include_stack ) .
@@ -1353,7 +1360,7 @@ sub read_config($$)
13531360 # described above.
13541361 return 0; # didn't set anything LCOV_UNREACHABLE_LINE
13551362 }
1356- $included_config_files {abs_path( $filename ) } = 1;
1363+ $included_config_files {$path } = 1;
13571364 push (@include_stack , $filename );
13581365 VAR: while (<HANDLE>) {
13591366 chomp ;
@@ -1407,7 +1414,7 @@ sub read_config($$)
14071414 }
14081415 }
14091416 close (HANDLE) or die (" unable to close $filename : $! \n " );
1410- delete $included_config_files {abs_path( $filename ) };
1417+ delete $included_config_files {$path };
14111418 pop (@include_stack );
14121419 return $set_value ;
14131420}
0 commit comments