diff --git a/source/build/smb_build/config_mk.pm b/source/build/smb_build/config_mk.pm index 652a52f..4abfcbe 100644 --- a/source/build/smb_build/config_mk.pm +++ b/source/build/smb_build/config_mk.pm @@ -102,43 +102,33 @@ sub _read_config_file($$$) my $cwd = getcwd; chomp $cwd; - if ($srcdir ne $builddir) { - # Push the builddir path on the front, so we prefer builddir - # to srcdir when the file exists in both. - @dirlist = ($builddir, $srcdir); - } else { - @dirlist = ($srcdir); - } - - foreach my $d (@dirlist) { - my @lines; - my $basedir; + my @lines; + my $basedir; - chdir $cwd; - chdir $d; + chdir $cwd; + chdir $srcdir; - # We need to catch the exception from open in the case where - # the filename is actually a shell pipeline. Why is this - # different to opening a regular file? Because this is perl! - eval { - open(CONFIG_MK, "./$filename"); - @lines = ; - close(CONFIG_MK); - }; + # We need to catch the exception from open in the case where + # the filename is actually a shell pipeline. Why is this + # different to opening a regular file? Because this is perl! + eval { + open(CONFIG_MK, "./$filename"); + @lines = ; + close(CONFIG_MK); + }; - chdir $cwd; - next unless (@lines); + chdir $cwd; + next unless (@lines); - # I blame abartlett for this crazy hack -- jpeach - if ($filename =~ /\|$/) { - $basedir = $builddir; - } else { - $basedir = dirname($filename); - push(@parsed_files, $filename); - } - $basedir =~ s!^($builddir|$srcdir)[/]!!; - return ($filename, $basedir, @lines); + # I blame abartlett for this crazy hack -- jpeach + if ($filename =~ /\|$/) { + $basedir = $builddir; + } else { + $basedir = dirname($filename); + push(@parsed_files, $filename); } + $basedir =~ s!^($builddir|$srcdir)[/]!!; + return ($filename, $basedir, @lines); chdir $cwd; return;