imap/src/osdep/nt/env_nt.c
/* Return mailbox file name
 * Accepts: destination buffer
 *	    mailbox name
 * Returns: file name or empty string for driver-selected INBOX or NIL if error
 */
Return mailbox file name
Accepts: destination buffer
mailbox name
Returns: file name or empty string for driver-selected INBOX or NIL if error
Return mailbox file name Accepts : destination buffer mailbox name Returns : file name or empty string for driver - selected INBOX or NIL if error
char *mailboxfile (char *dst,char *name)
{
  char homedev[3];
  char *dir = myhomedir ();
  if (dir[0] && isalpha (dir[0]) && (dir[1] == ':')) {
    homedev[0] = dir[0];	
    homedev[1] = dir[1];
    homedev[2] = '\0';
  }
  else homedev[0] = '\0';	
  *dst = '\0';			
  if (!compare_cstring (name,"INBOX"));
  else if (strchr (name,'/')) dst = NIL;
  else switch (*name) {
  case '#':			
    if (((name[1] == 'u') || (name[1] == 'U')) &&
	((name[2] == 's') || (name[2] == 'S')) &&
	((name[3] == 'e') || (name[3] == 'E')) &&
	((name[4] == 'r') || (name[4] == 'R')) && (name[5] == '.')) {
      for (dir = dst,name += 6; *name && (*name != '\\'); *dir++ = *name++);
      *dir++ = '\0';		
      if (dir = win_homedir (dst)) {
	sprintf (dst,"%s\\%s",dir,name);
	fs_give ((void **) &dir);
      }
      else dst = NIL;
    }
    else dst = NIL;		
    break;
  case '\\':			
    sprintf (dst,"%s%s",homedev,name);
    break;
  default:			
    if (name[1] == ':') {	
      if (name[2] == '\\') strcpy (dst,name);
      else sprintf (dst,"%c:\\%s",name[0],name+2);
    }
    else sprintf (dst,"%s\\%s",dir,name);
  }
  return dst;			
}
char * mailboxfile ( char * dst , char * name ) { char homedev [ 3 ] ; char * dir = myhomedir ( ) ; if ( dir [ 0 ] && isalpha ( dir [ 0 ] ) && ( dir [ 1 ] == ' ' ) ) { homedev [ 0 ] = dir [ 0 ] ; homedev [ 1 ] = dir [ 1 ] ; homedev [ 2 ] = ' \0 ' ; } else homedev [ 0 ] = ' \0 ' ; * dst = ' \0 ' ; if ( ! compare_cstring ( name , " " ) ) ; else if ( strchr ( name , ' ' ) ) dst = NIL ; else switch ( * name ) { case ' ' : if ( ( ( name [ 1 ] == ' ' ) || ( name [ 1 ] == ' ' ) ) && ( ( name [ 2 ] == ' ' ) || ( name [ 2 ] == ' ' ) ) && ( ( name [ 3 ] == ' ' ) || ( name [ 3 ] == ' ' ) ) && ( ( name [ 4 ] == ' ' ) || ( name [ 4 ] == ' ' ) ) && ( name [ 5 ] == ' ' ) ) { for ( dir = dst , name += 6 ; * name && ( * name != ' \\ ' ) ; * dir ++ = * name ++ ) ; * dir ++ = ' \0 ' ; if ( dir = win_homedir ( dst ) ) { sprintf ( dst , " \\ " , dir , name ) ; fs_give ( ( void * * ) & dir ) ; } else dst = NIL ; } else dst = NIL ; break ; case ' \\ ' : sprintf ( dst , " " , homedev , name ) ; break ; default : if ( name [ 1 ] == ' ' ) { if ( name [ 2 ] == ' \\ ' ) strcpy ( dst , name ) ; else sprintf ( dst , " \\ " , name [ 0 ] , name + 2 ) ; } else sprintf ( dst , " \\ " , dir , name ) ; } return dst ; }
Return mailbox file name
 Accepts: destination buffer
          mailbox name
 Returns: file name or empty string for driver-selected INBOX or NIL if error
Return mailbox file name Accepts : destination buffer mailbox name Returns : file name or empty string for driver - selected INBOX or NIL if error
/* copy home device */ /* ??no home device?? */ /* default to empty string */ /* check for INBOX */ /* reject names with / */ /* namespace names */ /* copy user name to destination buffer */ /* tie off user name */ /* look up homedir for user name */ /* build resulting name */ /* unknown namespace name */ /* absolute path on default drive? */ /* any other name */ /* some other drive? */ /* build home-directory relative name */ /* return it */