[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] [PATCH] rewrote home_dir() to fix memleak
From: |
Giuseppe Scrivano |
Subject: |
Re: [Bug-wget] [PATCH] rewrote home_dir() to fix memleak |
Date: |
Fri, 13 Apr 2012 10:44:51 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
Tim Ruehsen <address@hidden> writes:
> Sorry to say this, there is a little bug in my changes:
> if (!p || !asprintf(&home,"%.*s", (int)(p - path), path))
> return NULL;
>
> should be
>
> if (!p || asprintf(&home,"%.*s", (int)(p - path), path) == -1)
> return NULL;
>
> What about the 'remove trailing path seperator' code.
> I think it is not need, since on most systems 'path/filename' is treated the
> same as 'path//filename'.
> What do you think ?
f//bar is different than foo/bar, some file systems might support an
empty file name. IIRC, POSIX allows it.
Giuseppe