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 ?

Mit freundlichem Gruß

     Tim Rühsen

Reply via email to