diff -Nur webdruid-0.5.4.orig/webdruid.c webdruid-0.5.4/webdruid.c
--- webdruid-0.5.4.orig/webdruid.c	2004-06-22 22:30:32.000000000 +0200
+++ webdruid-0.5.4/webdruid.c	2004-06-26 20:16:07.062500000 +0200
@@ -222,6 +222,7 @@
 char    timestamp[32];                        /* for the reports          */
 
 char    tmp_buf[BUFSIZE];                     /* used to temp save above  */
+char    basedir[BUFSIZE];                     /* Program's base directory */
 
 CLISTPTR *top_ctrys    = NULL;                /* Top countries table      */
 
@@ -361,14 +362,33 @@
    int    one_true_file;                 /* Keep in mind if we will
                                             process one true file
                                             (e.g. not STDIN)            */
+   
+   /* Get execute path from argv[0] */
+   strcpy(tmp_buf, argv[0]);
+   while (tmp_buf[0] && tmp_buf[strlen(tmp_buf) - 1] != '/')
+      tmp_buf[strlen(tmp_buf) - 1] = 0;
+   
+   /* Use excecute path as basedir if it is absolute */
+   if (tmp_buf[0] == '/')
+      strcpy(basedir, tmp_buf);
+   else
+   {
+      /* Get current directory as base for the basedir*/
+      getcwd(basedir, BUFSIZE);
+   
+      /* Add a slash and the execute path to the basedir */
+      strcat(basedir, "/");
+      strcat(basedir, tmp_buf);
+   }
 
    current_locale = setlocale (LC_ALL, "");
-   bindtextdomain ("webdruid", LOCALEDIR);
+   sprintf(tmp_buf, "%slocale", basedir);
+   bindtextdomain ("webdruid", tmp_buf);
    textdomain ("webdruid");
 
    /* set sensible default font path if not set */
    if(getenv("GDFONTPATH") == 0)
-      setenv("GDFONTPATH", "/usr/share/fonts/truetype/freefont:/usr/share/fonts/truetype:/usr/share/fonts/freefont", 1);
+      setenv("GDFONTPATH", basedir, 1);
 
    /* We choose default font face for gd2 (charts + dot graphs): FreeSerif */
    save_opt(&font_face, "FreeSerif");
@@ -383,9 +403,10 @@
    save_opt(&skin_name, "classic");
 
    /* set default dot location */
-   save_opt(&dot_location, "/usr/bin/dot");
+   sprintf(tmp_buf,"%sdot.exe", basedir);
+   save_opt(&dot_location, tmp_buf);
 
-   sprintf(tmp_buf,"%s/webdruid/webdruid.conf", SYSCONFDIR);
+   sprintf(tmp_buf,"%swebdruid.conf", basedir);
    /* check for default config file */
    if (!access("webdruid.conf", R_OK))
       get_config("webdruid.conf");
@@ -580,7 +601,8 @@
          fflush(stdout);
       }
 
-      if(sengine_parse(WEBDRUIDDATADIR ENGINES_FNAME) != 0)
+      sprintf(tmp_buf, "%s%s", basedir, ENGINES_FNAME);
+      if(sengine_parse(tmp_buf) != 0)
       {
          if ( verbose > 1 )
          {
@@ -589,19 +611,6 @@
          clean_exit(1);
       }
 
-      /* Try to load local engines list */
-      if(access(SYSCONFDIR "/webdruid/" ENGINES_FNAME, R_OK) == 0)
-      {
-         if(sengine_parse(SYSCONFDIR "/webdruid/" ENGINES_FNAME) != 0)
-         {
-            if ( verbose > 1 )
-            {
-               printf("%s\n",_("Could not load local search engines list, aborting."));
-            }
-            clean_exit(1);
-         }
-      }
-
       if ( verbose > 1 )
          printf("%s\n", _("Ok"));
 
@@ -2094,7 +2103,7 @@
          argv[i] = "-x";
          i++;
       }
-      snprintf(buff1, sizeof(buff1), "%s%s/apply_skin.sh", WEBDRUIDDATADIR, skin_name);
+      snprintf(buff1, sizeof(buff1), "%s%s/apply_skin.sh", basedir, skin_name);
       argv[i] = buff1;
       i++;
       argv[i] = "MONTH";
@@ -2104,12 +2113,12 @@
       snprintf(buff2, sizeof(buff2), "monthly_%04d_%02d.xml", year, month);
       argv[i] = buff2;
       i++;
-      snprintf(buff3, sizeof(buff3), "%s/webdruid/skin-%s.xml.conf", SYSCONFDIR, skin_name);
+      snprintf(buff3, sizeof(buff3), "%sskin-%s.xml.conf", basedir, skin_name);
       argv[i] = buff3;
       i++;
       argv[i] = "skin_output";
       i++;
-      argv[i] = WEBDRUIDDATADIR;
+      argv[i] = basedir;
       i++;
       argv[i] = NULL;
       i++;

