[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: patch for xchat to compile on the Hurd
From: |
Ludovic Courtès |
Subject: |
Re: patch for xchat to compile on the Hurd |
Date: |
Tue, 25 Jan 2005 12:26:00 +0100 |
User-agent: |
Mutt/1.5.4i [Guile enabled] |
Hi,
Today, 3 hours, 9 minutes, 14 seconds ago, Christopher Bodenstein wrote:
> --- xchat-2.4.1/plugins/python/python.c 2004-10-18 14:12:21.000000000
> +0200
> +++ xchat-2.4.1/plugins/python/python.c 2005-01-23 15:23:03.000000000
> +0100
> @@ -327,11 +327,14 @@ Util_BuildList(char *word[])
> static void
> Util_Autoload()
> {
> - char oldcwd[PATH_MAX];
> + /* char oldcwd[PATH_MAX]; */
> + char curdirname = get_current_dir_name();
This should be "char *curdirname" and it should be freed eventually.
You should actually call it `oldcwd' too. Note that _GNU_SOURCE must be
defined for `get_current_dir_name ()' to be available. So you can do
something like:
#ifdef _GNU_SOURCE
char *oldcwd = get_current_dir_name ();
#else
char oldcwd[PATH_MAX];
#endif
> + char oldcwd[sizeof(curdirname)];
This is not needed (and wrong).
> const char *dir_name;
> struct dirent *ent;
> DIR *dir;
> - if (getcwd(oldcwd, PATH_MAX) == NULL)
> + /* if (getcwd(oldcwd, PATH_MAX) == NULL) */
> + if (getcwd(oldcwd, sizeof(curdirname)) == NULL)
> return;
You don't need to call `getcwd ()' since you used `get_current_dir_name ()'
so you can enclose this `if' in an "#ifndef _GNU_SOURCE" or some such.
And then you can send it to the xchat maintainers. :-)
Thanks,
Ludovic.