[patch] make dbus-launch export vars, usage bits

Havoc Pennington hp@redhat.com
Sat, 17 May 2003 13:51:38 -0400


Hi,

Looks good to commit, minor comments follow.
Thanks a lot.
 
       if (!strcmp (arg, "--session"))
-	type = DBUS_BUS_SESSION;
+	type = DBUS_BUS_SYSTEM;

This looks like only 1 space indentation, but I think it must be 
diff playing with our minds, since the current source looks right.

+	{
+	  runprog = strdup (arg);

strdup() is unfortunately not portable - I'd just cut-and-paste 
dbus_strdup into dbus-launch (appropriately un-dbus-ing it).

+         if (!strncmp (shname + strlen(shname) -3, "csh", 3))

space before parens ;-)

+	  char *envvar = malloc (strlen ("DBUS_SESSION_BUS_ADDRESS=") + FILENAME_MAX + 1);
+	  char **args = malloc (sizeof (char *) *
((argc-remaining_args)+2));

I can live with "foo = NULL" inline but this much stuff in the
variable declaration bugs me somewhat.

The Hurd people are going to come after you for using FILENAME_MAX you
know ;-) it probably would be better anyhow to just go ahead and
strlen the bus_address, since the address is not inherently a
filename.

+.I "--version"
+Print the version of dbus-launch
+
+.TP
+.I "--sh-syntax"
+Emit Bourne-shell compatible code.
+
+.TP
+.I "--csh-syntax"
+Emit csh compatible code.
+
+.TP
+.I "--auto-syntax"
+Attempt to detect the shell in use, and emit compatible code.
+
+.TP

We should probably alphabetize these options.

Havoc