gnome-terminal r3374 - trunk/src



Author: chpe
Date: Thu Mar 19 13:48:27 2009
New Revision: 3374
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=3374&view=rev

Log:
Use / instad of /home/chpe as cwd for the factory

Modified:
   trunk/src/terminal.c

Modified: trunk/src/terminal.c
==============================================================================
--- trunk/src/terminal.c	(original)
+++ trunk/src/terminal.c	Thu Mar 19 13:48:27 2009
@@ -21,13 +21,15 @@
 
 #include <config.h>
 
+#include <errno.h>
 #include <locale.h>
+#include <stdlib.h>
+#include <time.h>
+#include <unistd.h>
 
 #include <glib.h>
 #include <glib/gstdio.h>
 
-#include <stdlib.h>
-#include <time.h>
 #include <gdk/gdkx.h>
 
 #ifdef WITH_SMCLIENT
@@ -241,7 +243,7 @@
   int i;
   char **argv_copy;
   int argc_copy;
-  const char *startup_id, *display_name, *home_dir;
+  const char *startup_id, *display_name;
   GdkDisplay *display;
   TerminalOptions *options;
   DBusGConnection *connection;
@@ -476,12 +478,11 @@
   terminal_app_handle_options (terminal_app_get (), options, NULL);
   terminal_options_free (options);
 
-  /* Now change directory to $HOME so we don't prevent unmounting, e.g. if the
+  /* Now change directory to / so we don't prevent unmounting, e.g. if the
    * factory is started by nautilus-open-terminal. See bug #565328.
    */
-  home_dir = g_get_home_dir ();
-  if (home_dir)
-    g_chdir (home_dir);
+  if (chdir ("/") < 0)
+    g_warning ("Failed to chdir to /: %s", g_strerror (errno));
 
   gtk_main ();
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]