}
static int get_namespace (IMAP_DATA *idata, char *nsbuf, int nsblen, 			  IMAP_NAMESPACE_INFO *nsi, int nsilen, int *nns){  char buf[LONG_STRING];  char seq[16];  char *s;  int n;  char ns[LONG_STRING];  char delim = '/';  int type;  int nsbused = 0;  *nns = 0;  nsbuf[nsblen-1] = '\0';  imap_make_sequence (seq, sizeof (seq));  snprintf (buf, sizeof (buf), "%s NAMESPACE\r\n", seq);  mutt_socket_write (idata->conn, buf);  do   {    if (mutt_socket_read_line_d (buf, sizeof (buf), idata->conn) < 0)    {      return (-1);    }    if (buf[0] == '*')     {      s = imap_next_word (buf);      if (mutt_strncasecmp ("NAMESPACE", s, 9) == 0)      {	/* There are three sections to the response, User, Other, Shared,	 * and maybe more by extension */	for (type = IMAP_NS_PERSONAL; *s; type++)	{	  s = imap_next_word (s);	  if (*s && strncmp (s, "NIL", 3))	  {	    s++;	    while (*s && *s != ')')	    {	      s++; /* skip ( */	      /* copy namespace */	      n = 0;	      if (*s == '\"')	      {		s++;		while (*s && *s != '\"') 		{		  if (*s == '\\')		    s++;		  ns[n++] = *s;		  s++;		}	      }	      else		while (*s && !ISSPACE (*s)) 		{		  ns[n++] = *s;		  s++;		}	      ns[n] = '\0';	      /* delim? */	      s = imap_next_word (s);	      if (*s && *s == '\"')		if (s[1] && s[2] == '\"')		  delim = s[1];		else if (s[1] && s[1] == '\\' && s[2] && s[3] == '\"')		  delim = s[2];	      /* Save result (if space) */	      if ((nsbused < nsblen) && (*nns < nsilen))	      {		nsi->type = type;		strncpy(nsbuf+nsbused,ns,nsblen-nsbused-1);		nsi->prefix = nsbuf+nsbused;		nsbused += n+1;		nsi->delim = delim;		nsi++;		(*nns)++;	      }	      while (*s && *s != ')') s++;	      s++;	    }	  }	}      }      else      {	if (imap_handle_untagged (idata, buf) != 0)	  return (-1);      }    }  }  while ((mutt_strncmp (buf, seq, SEQLEN) != 0));  return 0;}