Re: [PATCH] Fix make_absolute_path() for parameters without a slash

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

 



Hi,

On Sun, 2 Mar 2008, Johannes Schindelin wrote:

> diff --git a/path.c b/path.c
> index 4260952..bf3e469 100644
> --- a/path.c
> +++ b/path.c
> @@ -311,8 +311,10 @@ const char *make_absolute_path(const char *path)
>  			if (last_slash) {
>  				*last_slash = '\0';
>  				last_elem = xstrdup(last_slash + 1);
> -			} else
> +			} else {
> +				*buf = '\0';
>  				last_elem = xstrdup(buf);

Oh, my.  The *buf = '\0' must come _after the assignment to last_elem, of 
course.

Will stop posting patches for today, and fix tomorrow.

Ciao,
Dscho

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux