fix on return value for sdl functions in Utility
Kartik Thakore [Mon, 10 Aug 2009 10:01:57 +0000 (06:01 -0400)]
Build.PL
make/lib/SDL/Utility.pm

index f2d146d..4774a76 100644 (file)
--- a/Build.PL
+++ b/Build.PL
@@ -144,6 +144,5 @@ $build->set_flags(
        $sdl_compile_flags,
        $sdl_link_flags,
 );
-
 # now we're ready to go!
 $build->create_build_script();
index 425884b..9b4c8fe 100644 (file)
@@ -19,8 +19,8 @@ use SDL::Build;
 sub sdl_con_found
 {
        `sdl-config --libs`;
-       return 0 if ($? >> 8);
-       return 1;
+       return 1 unless ($? >> 8) and return 0;
+       
 }
 
 #This should check if the folder actually has the SDL files
@@ -34,7 +34,8 @@ sub sdl_libs
        if(sdl_con_found)
        {
                local $_ = `sdl-config --libs`;
-               return chomp($_);
+               chomp($_);
+               return $_;
        }       
        elsif( check_sdl_dir() )
        {
@@ -53,7 +54,8 @@ sub sdl_c_flags
         if(sdl_con_found)
         {
                        local $_  = `sdl-config --cflags`;
-               return chomp($_);
+               chomp($_);
+               return $_;
         }
        elsif ( check_sdl_dir() )
        {