mkdir (result, 0777);
if (mkdir (result, 0777) < 0) return NULL;
construct_output_path (char *path){  const char *normal = NULL;  char *result;  char *endp;  if (strchr (path, '/') == NULL)    {      /* This is a system path.  First examine whether the locale name	 contains a reference to the codeset.  This should be	 normalized.  */      char *startp;      size_t n;      startp = path;      /* We must be prepared for finding a CEN name or a location of	 the introducing `.' where it is not possible anymore.  */      while (*startp != '\0' && *startp != '@' && *startp != '.'	     && *startp != '+' && *startp != ',')	++startp;      if (*startp == '.')	{	  /* We found a codeset specification.  Now find the end.  */	  endp = ++startp;	  while (*endp != '\0' && *endp != '@')	    ++endp;	  if (endp > startp)	    normal = normalize_codeset (startp, endp - startp);	}      else	/* This is to keep gcc quiet.  */	endp = NULL;      /* We put an additional '\0' at the end of the string because at	 the end of the function we need another byte for the trailing	 '/'.  */      if (normal == NULL)	n = asprintf (&result, "%s%s/%s%c",		      output_prefix ?: "", LOCALEDIR, path, '\0');      else	n = asprintf (&result, "%s%s/%.*s%s%s%c",		      output_prefix ?: "", LOCALEDIR,		      (int) (startp - path), path, normal, endp, '\0');      endp = result + n - 1;    }  else    {      /* This is a user path.  Please note the additional byte in the	 memory allocation.  */      size_t len = strlen (path) + 1;      result = xmalloc (len + 1);      endp = mempcpy (result, path, len) - 1;    }  errno = 0;  if (euidaccess (result, W_OK) == -1)    /* Perhaps the directory does not exist now.  Try to create it.  */    if (errno == ENOENT)      {	errno = 0;	mkdir (result, 0777);      }  *endp++ = '/';  *endp = '\0';  return result;}