From: Brandon Casey Date: Wed, 22 Aug 2012 17:13:22 GMT Subject: Re: Porting git to HP NonStop Message-ID: In-Reply-To: On Wed, Aug 22, 2012 at 10:00 AM, Brandon Casey wrote: > Also, we have xstrndup. So I think the body of your function can become > something like: > > if (len && dir[len-1] == '/') > dir = tmp_dir = xstrndup(dir, len-1); > > retval = mkdir(dir, mode); > free(tmp_dir); Actually, xmemdupz could be used in place of xstrndup since we've already called strlen. -Brandon