$OpenBSD: patch-minimo_base_Minimo_cpp,v 1.4 2010/06/06 08:11:38 espie Exp $
--- minimo/base/Minimo.cpp.orig	Fri Oct 27 22:30:36 2006
+++ minimo/base/Minimo.cpp	Sun Jun  6 10:03:40 2010
@@ -34,6 +34,8 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
+#include <unistd.h>
+
 #include "MinimoPrivate.h"
 
 #include "nsIFullScreen.h"
@@ -77,7 +79,7 @@ void ErrorAlert(const char* message)
 
 }
 
-PRBool isChromeAvaiable()
+PRBool isChromeAvailable()
 {
   nsCOMPtr<nsIWindowWatcher> wwatch = do_GetService(NS_WINDOWWATCHER_CONTRACTID);
   if (!wwatch)
@@ -91,7 +93,7 @@ PRBool isChromeAvaiable()
   nsCOMPtr<nsIDOMWindow> rootWin(do_GetInterface(rootItem));
   nsCOMPtr<nsIDOMChromeWindow> chromeWin(do_QueryInterface(rootWin));
 
-  return (PRBool)chromeWin.get();
+  return chromeWin.get() != 0;
 }
 
 class ApplicationObserver: public nsIObserver 
@@ -508,7 +510,7 @@ LRESULT CALLBACK BrowserWndProc(HWND hWnd, UINT messag
 
     if (!strncmp(command, "URL", 3))
     {
-      if (!isChromeAvaiable())
+      if (!isChromeAvailable())
       {
         // We are currently starting up.  Save this url request as a startup page.
         nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID);
@@ -806,6 +808,8 @@ void UnloadKnownLibs()
 
 int main(int argc, char *argv[])
 {
+  chdir(MOZAPPDIR);
+
 #ifdef WINCE
   CreateListenerWindow();
 #endif
