char *s;
IMAP_NAMESPACE_INFO nsi[16]; int nns; int home_namespace = 0;
int imap_init_browse (char *path, struct browser_state *state){  CONNECTION *conn;  IMAP_DATA *idata;  char buf[LONG_STRING];  char mbox[LONG_STRING];  char host[SHORT_STRING];  char seq[16];  char *ipath = NULL;  int n;  int port;  char *s;  if (imap_parse_path (path, host, sizeof (host), &port, &ipath))    return (-1);  conn = mutt_socket_select_connection (host, port, 0);  idata = CONN_DATA;  if (!idata || (idata->state == IMAP_DISCONNECTED))  {    if (!idata)    {      /* The current connection is a new connection */      idata = safe_calloc (1, sizeof (IMAP_DATA));      conn->data = idata;      idata->conn = conn;    }    if (imap_open_connection (idata, conn))      return (-1);  }  imap_fix_path (idata, ipath, mbox, sizeof (mbox));  for (n = mutt_strlen (mbox) - 1; n > 0 && mbox[n] != idata->delim ; n--);  if (n > 0)  {    int i;    for (i = n - 1; i > 0 && mbox[i] != idata->delim ; i--);    if (i > 0)    {      mbox[i] = '\0';      add_folder (idata->delim, mbox, host, port, 1, 0, state);      mbox[i] = idata->delim;    }    else if (i != 0)      add_folder (idata->delim, "INBOX", host, port, 0, 0, state);    else      add_folder (idata->delim, "/", host, port, 1, 0, state);    mbox[n] = '\0';    /* Don't duplicate INBOX here */    if (strcmp ("INBOX", mbox))      add_folder (idata->delim, mbox, host, port, 0, 1, state);    mbox[n] = idata->delim;    mbox[n+1] = '\0';  }  else  {    if (mbox[0] != '#')    {      if (idata->delim == '/')	strcpy (mbox, "/");      else if (idata->delim == '\\')	strcpy (mbox, "\\");      else	mbox[0] = '\0';      if (add_namespace (idata, host, port, state) < 0)	return (-1);      add_folder (idata->delim, "INBOX", host, port, 0, 0, state);    }  }  imap_make_sequence (seq, sizeof (seq));  mutt_message _("Contacted server, getting folder list...");  snprintf (buf, sizeof (buf), "%s %s \"\" \"%s%%\"\r\n", seq,       option (OPTIMAPLSUB) ? "LSUB" : "LIST", mbox);  mutt_socket_write (conn, buf);  do   {    if (mutt_socket_read_line_d (buf, sizeof (buf), conn) < 0)    {      return (-1);    }    if (buf[0] == '*')     {      s = imap_next_word (buf);      if ((mutt_strncasecmp ("LIST", s, 4) == 0) ||	  (mutt_strncasecmp ("LSUB", s, 4) == 0))      {	int noselect = 0;	int noinferiors = 0;	s = imap_next_word (s); /* flags */	if (*s == '(')	{	  char *ep;	  s++;	  ep = s;	  while (*ep && *ep != ')') ep++;	  do {	    if (!strncmp (s, "\\NoSelect", 9))	      noselect = 1;	    if (!strncmp (s, "\\NoInferiors", 12))	      noinferiors = 1;	    if (*s != ')')	      s++;	    while (*s && *s != '\\' && *s != ')') s++;	  } while (s != ep);	}	else	  break;	s = imap_next_word (s); /* delim */	/* Reset the delimiter, this can change */	if (strncmp (s, "NIL", 3))	if (s && s[0] == '\"' && s[1] && s[2] == '\"')	  idata->delim = s[1];	else if (s && s[0] == '\"' && s[1] && s[1] == '\\' && s[2] && s[3] == '\"')	  idata->delim = s[2];	s = imap_next_word (s); /* name */	add_folder (idata->delim, s, host, port, noselect, noinferiors, state);      }      else      {	if (imap_handle_untagged (idata, buf) != 0)	  return (-1);      }    }  }  while ((mutt_strncmp (buf, seq, SEQLEN) != 0));  mutt_clear_error ();  return 0;}