Re: Launch buttons in the options dialog now look for a locally installed app

Stephen Watson <[email protected]>
Newsgroups gmane.comp.desktop.rox.devel
Message-ID <[email protected]>
"Thomas Leonard" <[email protected]> wrote:

> Looking at commit 11ce57102f89a7dad707d1a2f050749c4507414f (kerofin):
> 
> +/* Search for a application on $APPDIRPATH
> + * (~/Apps:/usr/local/apps:/usr/apps) and return a copy of the path
found.
> + * Returns NULL if not found
> + */
> +gchar *find_app(const char *appname)
> +{
> +  const gchar *path=g_getenv(appname);
> +  gchar **search;
> 
> Why does it call g_getenv on appname?

Should have been g_getenv("APPDIRPATH")

> Also:
> 
> +  for(i=0; search[i]; i++)
> +  {
> +	  app=g_strconcat(search[i], "/", appname, NULL);
> +	  if(access(app, X_OK)==0)
> +		  goto out;
> +  }
> 
> Missing a g_free?

I don't think so.  app is returned and search is freed before exit.

-- 
Stephen Watson     http://www.kerofin.demon.co.uk/
If you read this on a mailing list, send any reply back to the list and not
to me.  Not even CC.
"Bad dog!" "Affirmative!"

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.