rem: char *p_concat; size_t baselen; size_t dirlen;  if (!dir) { p_concat = strdup (base); if (base_in_result) *base_in_result = p_concat; return p_concat; }   baselen = base_len (base); dirlen = strlen (dir);  p_concat = malloc (dirlen + baselen + 2); if (!p_concat) return 0;
context: path_concat (const char *dir, const char *base, char **base_in_result){  char *p;  char *p_concat;  size_t baselen;  size_t dirlen;  if (!dir)    {      p_concat = strdup (base);      if (base_in_result)        *base_in_result = p_concat;      return p_concat;    }  /* DIR is not empty. */  baselen = base_len (base);  dirlen = strlen (dir);  p_concat = malloc (dirlen + baselen + 2);  if (!p_concat)    return 0;  p = mempcpy (p_concat, dir, dirlen);  if (FILESYSTEM_PREFIX_LEN (dir) < dirlen)    {      if (ISSLASH (*(p - 1)) && ISSLASH (*base))	--p;      else if (!ISSLASH (*(p - 1)) && !ISSLASH (*base))	*p++ = DIRECTORY_SEPARATOR;    }  if (base_in_result)    *base_in_result = p;  memcpy (p, base, baselen);  p[baselen] = '\0';  return p_concat;}