From 14bb8f337c9e368f203f68de9920327811b5f756 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 9 Mar 1998 22:52:38 +0000 Subject: [PATCH] Mod's to better support win32 if perl exists. --- Simulator/runfg | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Simulator/runfg b/Simulator/runfg index 67fa51e92..22a93414b 100755 --- a/Simulator/runfg +++ b/Simulator/runfg @@ -30,18 +30,25 @@ # Flight Gear Version $version_major = "0"; +$path = ""; + # name of Flight Gear executable -$program = "fg" . $version_major; +@programs = ( "fg" . $version_major, "fg" . $version_major . ".exe" ); # see if we can find the executable -if ( -x "./Main/$program" ) { - $path = "./Main/$program"; -} elsif ( -x "./$program" ) { - $path = "./$program"; -} else { - die "Cannot locate $program\n"; +while ( $path eq "" && ($program = shift(@programs)) ) { + print "$program\n"; + + if ( -x "./Main/$program" ) { + $path = "./Main/$program"; + } elsif ( -x "./$program" ) { + $path = "./$program"; + } } +die "Cannot locate program.\n" if ( $path eq "" ); + + # set the FG_ROOT environment variable if it hasn't already been set. if ( $ENV{FG_ROOT} eq "" ) { # look for a file called fgtop as a place marker @@ -59,6 +66,9 @@ exec("$path @ARGV"); #--------------------------------------------------------------------------- # $Log$ +# Revision 1.4 1998/03/09 22:52:38 curt +# Mod's to better support win32 if perl exists. +# # Revision 1.3 1998/02/16 16:17:34 curt # Minor tweaks. # -- 2.39.2