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

Colin Walters walters@debian.org
17 May 2003 22:42:11 -0400


On Sat, 2003-05-17 at 13:51, Havoc Pennington wrote:

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

I think what is happening is Emacs is using tabs for indentation, which
appear as 8 spaces by default in Emacs, but your mailer or mine or
something along the way is converting to spaces.  Or something :)
As you say it's right in the source, as far as I can tell.

> +	{
> +	  runprog = strdup (arg);
> 
> strdup() is unfortunately not portable - I'd just cut-and-paste 
> dbus_strdup into dbus-launch (appropriately un-dbus-ing it).

Ok, done.  What do you think about adding a check for a system strdup in
configure.in, and using it if available?  Probably do this for
_dbus_strdup as well?  If we wanted to make it a bit more efficient we
could add some checks for an "inline" keyword and use it if available
too.

> +         if (!strncmp (shname + strlen(shname) -3, "csh", 3))
> 
> space before parens ;-)

I thought I fixed this but apparently I didn't.  Fixed now for sure :)

> +	  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.

Ok, I moved the initialization down.

> The Hurd people are going to come after you for using FILENAME_MAX you
> know ;-)

Yeah, using a realloc loop is generally better in general I guess.  But
since I didn't need it anyways as you point out, all the better.

> We should probably alphabetize these options.

Done.