fix some return values and logic
authorRicardo Mones <ricardo@mones.org>
Sat, 12 Jan 2008 00:40:52 +0000 (00:40 +0000)
committerRicardo Mones <ricardo@mones.org>
Sat, 12 Jan 2008 00:40:52 +0000 (00:40 +0000)
ChangeLog
VERSION
clawsker

index 192e55f46104b54361d2102d97f84c6b6f85d090..cd1d6715ba01b06c6b191a82fd47a36367eb6787 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-12 01:23  mones   0.2.0svn44
+
+       * clawsker
+               Oops, fix wrong conditions for exit
+
 2008-01-09 22:58  mones   0.2.0svn40
 
        * clawsker
 2008-01-09 22:58  mones   0.2.0svn40
 
        * clawsker
diff --git a/VERSION b/VERSION
index bdeb4f577a06a9df94d5bfbba74a669409d9fc00..bc40ee26082cd20e1e8c95315987254b1cd8538a 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.2.0svn40
+0.2.0svn44
index 50220e15bb1c4432a6b6c0dda73a6ec1d82a5a37..ef02f1992ed8ebecbcce64fb011d2cf164bfb128 100755 (executable)
--- a/clawsker
+++ b/clawsker
@@ -828,7 +828,7 @@ sub parse_command_line() {
         for ($ARGV[$arg]) {
             /--help/ && do { 
                &print_help; 
         for ($ARGV[$arg]) {
             /--help/ && do { 
                &print_help; 
-                exit 0;
+                return FALSE;
            };
            /--verbose/ && do {
                $VERBOSE = TRUE;
            };
            /--verbose/ && do {
                $VERBOSE = TRUE;
@@ -858,6 +858,8 @@ sub parse_command_line() {
        }
        ++$arg;
     }
        }
        ++$arg;
     }
+    # eveything continues...
+    return TRUE;
 }
 
 # update the hidden preferences status from loaded values
 }
 
 # update the hidden preferences status from loaded values
@@ -867,13 +869,15 @@ sub init_hidden_preferences() {
            $HPVALUE{${$hash}{$key}[NAME]} = $PREFS{${$hash}{$key}[NAME]};
         }
     }
            $HPVALUE{${$hash}{$key}[NAME]} = $PREFS{${$hash}{$key}[NAME]};
         }
     }
+    return TRUE;
 }
 
 # load current status from disc
 sub load_preferences() {
     my $rc = &get_rc_filename;
 }
 
 # load current status from disc
 sub load_preferences() {
     my $rc = &get_rc_filename;
-    &check_rc_file ($rc) or return FALSE;
-    &check_claws_not_running or return FALSE;
+    &log_message ("Loading preferences from $rc\n");
+    return FALSE unless &check_rc_file ($rc);
+    return FALSE unless &check_claws_not_running;
     open (RCF, "<$rc");
     while (<RCF>) {
        chomp;
     open (RCF, "<$rc");
     while (<RCF>) {
        chomp;
@@ -888,8 +892,9 @@ sub load_preferences() {
 # save current preferences to disc
 sub save_preferences() {
     my $rc = &get_rc_filename;
 # save current preferences to disc
 sub save_preferences() {
     my $rc = &get_rc_filename;
-    &check_rc_file ($rc) or return FALSE;
-    &check_claws_not_running or return FALSE;
+    &log_message ("Saving preferences to $rc\n");
+    return FALSE unless &check_rc_file ($rc);
+    return FALSE unless &check_claws_not_running;
     my $rcbak = "$rc.backup";
     rename ($rc, $rcbak);
     open (RCF, ">$rc");
     my $rcbak = "$rc.backup";
     rename ($rc, $rcbak);
     open (RCF, ">$rc");
@@ -985,9 +990,9 @@ sub new_button_box() {
 
 # initialise
 $main_window = Gtk2::Window->new ('toplevel');
 
 # initialise
 $main_window = Gtk2::Window->new ('toplevel');
-&parse_command_line;
-&load_preferences or exit;
-&init_hidden_preferences or exit;
+exit unless &parse_command_line;
+exit unless &load_preferences;
+exit unless &init_hidden_preferences;
 # create main GUI
 my $box = Gtk2::VBox->new (FALSE, 5);
 $box->set_border_width(3);
 # create main GUI
 my $box = Gtk2::VBox->new (FALSE, 5);
 $box->set_border_width(3);