diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2006-07-05 19:00:40 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2006-07-05 19:00:40 +0000 |
commit | fc99697e4760b877e4321a5c5dc5e28e9c9242cb (patch) | |
tree | a2dcf21bd185a91dc7bc2a7ed488e09cbd9f3f87 /lib/sbin/f_depend_modules.pl | |
parent | 938e56d7757aebc5a358be153c8472840d970fd5 (diff) |
Clean up the looping structure that loop over all directories in the
include path and all files in such a directory. When a matching file
is found, exit all loops, not just the innermost one.
Use the same mechanism that was already used for "use" statements also
for "include" statements. Fortran include statements did not work
correctly before.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4343 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/f_depend_modules.pl')
-rwxr-xr-x | lib/sbin/f_depend_modules.pl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/sbin/f_depend_modules.pl b/lib/sbin/f_depend_modules.pl index fc4749d8..9cb20888 100755 --- a/lib/sbin/f_depend_modules.pl +++ b/lib/sbin/f_depend_modules.pl @@ -45,13 +45,13 @@ while (<STDIN>) my $dirhdl; if( opendir( DIRHDL, "$srcdir" ) ) { - while( defined( my $filename = readdir( DIRHDL ) ) ) + file: while( defined( my $filename = readdir( DIRHDL ) ) ) { if( $filename eq "$name" ) { $found = 1; print " \\\n $filename"; - last loop; + last file; } } closedir DIRHDL; @@ -60,7 +60,7 @@ while (<STDIN>) if (! $found) { # reference to an include file in another thorn? - loop: foreach my $dir (@otherdirs) + dir: foreach my $dir (@otherdirs) { # note: we could also use the SUBDIRS from the make.code.defn here foreach my $subdir (".", "include") @@ -73,7 +73,7 @@ while (<STDIN>) { $found = 1; print " \\\n $dir/$subdir/$filename"; - last loop; + last dir; } } closedir DIRHDL; @@ -119,15 +119,15 @@ while (<STDIN>) my $dirhdl; if( opendir( DIRHDL, "$srcdir" ) ) { - while( defined( my $filename = readdir( DIRHDL ) ) ) + file: while( defined( my $filename = readdir( DIRHDL ) ) ) { - loop: foreach my $suffix (@suffixes) + foreach my $suffix (@suffixes) { if( $filename eq "$name$suffix" ) { $found = 1; print " \\\n $filename.o"; - last loop; + last file; } } } @@ -137,7 +137,7 @@ while (<STDIN>) if (! $found) { # reference to a module in another thorn? - loop: foreach my $dir (@otherdirs) + dir: foreach my $dir (@otherdirs) { # note: we could also use the SUBDIRS from the make.code.defn here foreach my $subdir (".", "include") @@ -152,7 +152,7 @@ while (<STDIN>) { $found = 1; print " \\\n $dir/$subdir/$filename"; - last loop; + last dir; } } } |