[Kstars-devel] branches/kstars/summer/kdeedu/kstars/kstars/data

Akarsh Simha akarshsimha at gmail.com
Mon Jun 2 21:04:40 CEST 2008


SVN commit 815876 by asimha:

Yet another bug in the script that parses the data and puts them into
the MySQL database. The declinations of stars close to the celestial
equator were not stored correctly, due to a sign error.

Thanks to Jason, who pointed out where the bug was immediately.

CCMAIL: kstars-devel at kde.org



 M             deepstars.dat  
 M             shallowstars.dat  
 M             starnames.dat  
 M  +3 -4      tools/datatomysql.pl  


--- branches/kstars/summer/kdeedu/kstars/kstars/data/tools/datatomysql.pl #815875:815876
@@ -181,10 +181,9 @@
 
 sub hms_to_hour {
     my $string = shift;
-    $string =~ /^([+-]?\d\d)(\d\d)(\d\d(?:\.\d*)?)/ or return;
-    my ($h, $m, $s) = ($1, $2, $3);
-    my $sign = $h < 0 ? -1 : 1;
-    $h = abs($h);
+    $string =~ /^([+-]?)(\d\d)(\d\d)(\d\d(?:\.\d*)?)/ or return;
+    my ($h, $m, $s) = ($2, $3, $4);
+    my $sign = ($1 eq '-') ? -1 : 1;
     $m += $s / 60;
     return $sign * ($h + $m / 60);
 }


More information about the Kstars-devel mailing list