Re: Porting git to HP NonStop
- From
Brandon Casey <drafnel@gmail.com>
- Date
- Aug 22, 2012, 17:13 UTC
- Message-ID
- <CA+sFfMfzpYaqRc7A0sZykA8PZ3LKahYVi9XASwCRGCEQO5PrrA@mail.gmail.com>
- In-Reply-To
- <CA+sFfMdnixrUekh40Sde05tkap7Oj19=5D6J6aYVVD1krqPZkw@mail.gmail.com>
On Wed, Aug 22, 2012 at 10:00 AM, Brandon Casey <drafnel@gmail.com> wrote:
Show 8 quoted lines
> 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