Starting with POSIX.1.2008 resolved_path can be NULL.
Systems implementing a standard before that crash. Example of such
system is Mac OS X 10.5, the last version running on PowerPC hardware.
Since this is the only occurrance of the realpath(3) function in Mutt,
instead of wrapping it, just adjust this invocation.
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
{
CONTEXT *ctx = pctx;
int rc;
+ char realpathbuf[PATH_MAX];
if (!ctx)
ctx = safe_malloc (sizeof (CONTEXT));
FREE (&ctx);
return NULL;
}
- if (! (ctx->realpath = realpath (ctx->path, NULL)) )
+ if (! realpath (ctx->path, realpathbuf) )
ctx->realpath = safe_strdup (ctx->path);
+ else
+ ctx->realpath = safe_strdup (realpathbuf);
ctx->msgnotreadyet = -1;
ctx->collapsed = 0;