/[mailutils]/mailutils/mailbox/imap/folder.c
ViewVC logotype

Diff of /mailutils/mailbox/imap/folder.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.56 by gray, Sun Mar 23 22:54:47 2003 UTC revision 1.57 by gray, Fri Apr 18 12:32:06 2003 UTC
# Line 44  Line 44 
44  #include <mailutils/attribute.h>  #include <mailutils/attribute.h>
45  #include <mailutils/debug.h>  #include <mailutils/debug.h>
46  #include <mailutils/error.h>  #include <mailutils/error.h>
47    #include <mailutils/errno.h>
48  #include <mailutils/header.h>  #include <mailutils/header.h>
49  #include <mailutils/observer.h>  #include <mailutils/observer.h>
50  #include <mailutils/stream.h>  #include <mailutils/stream.h>
# Line 1071  imap_quoted_string (f_imap_t f_imap, cha Line 1072  imap_quoted_string (f_imap_t f_imap, cha
1072    return 0;    return 0;
1073  }  }
1074    
1075    /* A number consists of one or more digit characters, and represents a
1076       numeric value. */
1077          
1078    static int
1079    imap_digits (f_imap_t f_imap, char **ptr)
1080    {
1081      char *start = *ptr;
1082      int len;
1083      
1084      for (++*ptr; **ptr && isdigit(**ptr); ++*ptr)
1085        ;
1086      len = *ptr - start;
1087      stream_write (f_imap->string.stream, start, len,
1088                    f_imap->string.offset, NULL);
1089      f_imap->string.offset += len;
1090      return 0;
1091    }
1092    
1093  /* Find which type of string the response is: literal or quoted and let the  /* Find which type of string the response is: literal or quoted and let the
1094     function fill the string buffer.  */     function fill the string buffer.  */
1095  static int  static int
# Line 1093  imap_string (f_imap_t f_imap, char **ptr Line 1112  imap_string (f_imap_t f_imap, char **ptr
1112            status = imap_literal_string (f_imap, ptr);            status = imap_literal_string (f_imap, ptr);
1113          }          }
1114        break;        break;
1115          
1116      case '"':      case '"':
1117        status = imap_quoted_string (f_imap, ptr);        status = imap_quoted_string (f_imap, ptr);
1118        break;        break;
1119          
1120        /* NIL */        /* NIL */
1121      case 'N':      case 'N':
1122      case 'n':      case 'n':
# Line 1103  imap_string (f_imap_t f_imap, char **ptr Line 1124  imap_string (f_imap_t f_imap, char **ptr
1124        (*ptr)++; /* I|i  */        (*ptr)++; /* I|i  */
1125        (*ptr)++; /* L|l  */        (*ptr)++; /* L|l  */
1126        break;        break;
1127          
1128      default:      default:
1129        /* Problem.  */        if (isdigit (**ptr))
1130        status = 1;          status = imap_digits (f_imap, ptr);
1131          else
1132            /* Problem. FIXME: Return a more appropriate error code */
1133            status = MU_ERR_FAILURE;
1134        break;        break;
1135      }      }
1136    return status;    return status;

Legend:
Removed from v.1.56  
changed lines
  Added in v.1.57

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26