Просмотр исходного кода

Look for more than one digit in timeoffset, a timeoffset over 10 didn't
work.

Morten Brix Pedersen 25 лет назад
Родитель
Сommit
4ec4be6fbe
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      pisg.pl

+ 4 - 4
pisg.pl

@@ -125,11 +125,11 @@ sub init_pisg
 
 
     $timestamp = time;
     $timestamp = time;
 
 
-    if ($timeoffset =~ /\+(\d)/) {
+    if ($timeoffset =~ /\+(\d+)/) {
         # We must plus some hours to the time
         # We must plus some hours to the time
         $timestamp += 3600 * $1; # 3600 seconds per hour
         $timestamp += 3600 * $1; # 3600 seconds per hour
 
 
-    } elsif ($timeoffset =~ /-(\d)/) {
+    } elsif ($timeoffset =~ /-(\d+)/) {
         # We must remove some hours from the time
         # We must remove some hours from the time
         $timestamp -= 3600 * $1; # 3600 seconds per hour
         $timestamp -= 3600 * $1; # 3600 seconds per hour
     }
     }
@@ -883,13 +883,13 @@ sub activetimes
         my $percent = ($times{$hour} / $lines) * 100;
         my $percent = ($times{$hour} / $lines) * 100;
         $percent =~ s/(\.\d)\d+/$1/;
         $percent =~ s/(\.\d)\d+/$1/;
 
 
-        if ($timeoffset =~ /\+(\d)/) {
+        if ($timeoffset =~ /\+(\d+)/) {
             # We must plus some hours to the time
             # We must plus some hours to the time
             $hour += $1;
             $hour += $1;
             $hour = $hour % 24;
             $hour = $hour % 24;
             if ($hour < 10) { $hour = "0" . $hour; }
             if ($hour < 10) { $hour = "0" . $hour; }
 
 
-        } elsif ($timeoffset =~ /-(\d)/) {
+        } elsif ($timeoffset =~ /-(\d+)/) {
             # We must remove some hours from the time
             # We must remove some hours from the time
             $hour -= $1;
             $hour -= $1;
             $hour = $hour % 24;
             $hour = $hour % 24;