Fix check for whether a browser is installed
authorSteven Luo <steven+maemo@steven676.net>
Sun, 30 May 2010 08:54:25 +0000 (01:54 -0700)
committerSteven Luo <steven+maemo@steven676.net>
Sun, 30 May 2010 08:54:25 +0000 (01:54 -0700)
The intent was to exempt MicroB (and any other browser listed with
browser->binary = NULL) from the check, but the tests here didn't do
that.  Fix this so that default_browser = microb doesn't emit a warning.

launcher.c

index 935db63..fe57eb9 100644 (file)
@@ -656,12 +656,13 @@ void update_default_browser(struct swb_context *ctx, char *default_browser) {
                if (!strcmp(default_browser, browser->name)) {
                        /* Make sure the user's choice is installed on the
                           system */
-                       if (browser->binary && !access(browser->binary, X_OK)) {
-                               use_launcher_as_default(ctx, browser);
-                               return;
-                       } else
+                       if (browser->binary && access(browser->binary, X_OK)) {
                                log_msg("%s appears not to be installed\n",
                                        default_browser);
+                       } else {
+                               use_launcher_as_default(ctx, browser);
+                               return;
+                       }
                }
 
        /* Deal with default_browser = "other" */