RE: An annoyingly regular 1.0.50 pep talk



Hi

> Note that fixing the cwd like this can potentially break clients.  For

Should any clients be relying on that value in the session-options?

If it is going to break apps, do you have any alternative suggestions on how
to fix this?

> Please use the appropriate define in manager.h instead of hard-coding
> the entire path name.

Apologies for that, I didn't look closely enough at the header file.

> Please use the prevalent indentation and formatting style.

Both of those are fixed in the patch below.

I've had a look at the session-properties capple and will have a go at
putting the config option for this in, but I need to put a test rig together
first - I don't want to disturb my current installation. Perhaps someone
familiar with the capplets should add it (it should only take a few
minutes)?

---
 _____ _         _       _____
| __  | |___ ___| |_ ___|   __|_ _ ___        Chris "Ng" Jones
| __ -| | .'|  _| '_|___|__   | | |   |  chris@black-sun.co.uk
|_____|_|__,|___|_,_|   |_____|___|_|_|    www.black-sun.co.uk
            S o f t w a r e

 "Linux is beating Windows" - David Cole, Microsoft Executive


diff -urN gsm.orig/manager.c gsm/manager.c
--- gsm.orig/manager.c	Fri Sep 17 09:07:00 1999
+++ gsm/manager.c	Fri Sep 17 23:16:43 1999
@@ -260,12 +260,18 @@
 run_command (Client* client, const gchar* command)
 {
   int argc, envc, envpc, pid = -1;
-  char **argv, *dir, **envv, **envp, *restart_info;
+  gboolean def = 0;
+  char **argv, *dir = NULL, **envv, **envp, *restart_info;

   if (find_vector_property (client, command, &argc, &argv))
     {
-      if (!find_string_property (client, SmCurrentDirectory, &dir))
-	dir = NULL;
+      dir = gnome_config_get_string_with_default (GSM_OPTION_CONFIG_PREFIX
"/FixedCwd=", &def);
+      if (def)
+        {
+          if (dir)
+            g_free(dir);
+          find_string_property (client, SmCurrentDirectory, &dir);
+        }

       if (find_vector_property (client, SmEnvironment, &envc, &envv)
 	  && envc > 0



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