if (x && path[--x] != idata->delim) x++;
char *imap_fix_path (IMAP_DATA *idata, char *mailbox, char *path,     size_t plen){  int x = 0;  if (!mailbox || !*mailbox)  {    strfcpy (path, "INBOX", plen);    return path;  }  while (mailbox && *mailbox && (x < (plen - 1)))  {    if ((*mailbox == '/') || (*mailbox == idata->delim))    {      while ((*mailbox == '/') || (*mailbox == idata->delim)) mailbox++;      path[x] = idata->delim;    }    else    {      path[x] = *mailbox;      mailbox++;    }    x++;  }  path[x] = '\0';  return path;}