/[mailutils]/mailutils/mailbox/url_mbox.c
ViewVC logotype

Diff of /mailutils/mailbox/url_mbox.c

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

revision 1.7 by sroberts, Sat Jan 19 16:38:53 2002 UTC revision 1.8 by gray, Wed Jan 30 14:43:53 2002 UTC
# Line 69  _url_path_hashed (const char *spooldir, Line 69  _url_path_hashed (const char *spooldir,
69    return mbox;    return mbox;
70  }  }
71    
72    static int transtab[] = {
73      'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
74      'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
75      'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
76      'y', 'z', 'a', 'b', 'c', 'd', 'e', 'f',
77      'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
78      'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
79      'w', 'x', 'y', 'z', 'a', 'b', 'c', 'd',
80      'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
81      'm', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
82      'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
83      'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
84      'x', 'y', 'z', 'b', 'c', 'd', 'e', 'f',
85      'g', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
86      'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
87      'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
88      'x', 'y', 'z', 'b', 'c', 'd', 'e', 'f',
89      'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
90      'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
91      'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
92      'z', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
93      'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
94      'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
95      'x', 'y', 'z', 'a', 'b', 'c', 'd', 'e',
96      'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
97      'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
98      'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
99      'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
100      'y', 'z', 'b', 'c', 'd', 'e', 'f', 'g',
101      'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
102      'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
103      'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
104      'y', 'z', 'b', 'c', 'd', 'e', 'f', 'g'
105    };
106    
107  /* Forward Indexing */  /* Forward Indexing */
108  static char *  static char *
109  _url_path_index (const char *spooldir, const char *user, int index_depth)  _url_path_index (const char *spooldir, const char *user, int index_depth)
# Line 79  _url_path_index (const char *spooldir, c Line 114  _url_path_index (const char *spooldir, c
114    if (ulen == 0)    if (ulen == 0)
115      return NULL;      return NULL;
116        
117    mbox = malloc (ulen + strlen (spooldir) + 2*index_depth + 1);    mbox = malloc (ulen + strlen (spooldir) + 2*index_depth + 2);
118    strcpy (mbox, spooldir);    strcpy (mbox, spooldir);
119    p = mbox + strlen (mbox);    p = mbox + strlen (mbox);
120    for (i = 0; i < index_depth && i < ulen; i++)    for (i = 0; i < index_depth && i < ulen; i++)
121      {      {
122        *p++ = '/';        *p++ = '/';
123        *p++ = user[i];        *p++ = transtab[ user[i] ];
124      }      }
125    for (; i < index_depth; i++)    for (; i < index_depth; i++)
126      {      {
127        *p++ = '/';        *p++ = '/';
128        *p++ = user[ulen-1];        *p++ = transtab[ user[ulen-1] ];
129      }      }
130    *p++ = '/';    *p++ = '/';
131    strcpy (p, user);    strcpy (p, user);
# Line 113  _url_path_rev_index (const char *spooldi Line 148  _url_path_rev_index (const char *spooldi
148    for (i = 0; i < index_depth && i < ulen; i++)    for (i = 0; i < index_depth && i < ulen; i++)
149      {      {
150        *p++ = '/';        *p++ = '/';
151        *p++ = user[ulen - i - 1];        *p++ = transtab[ user[ulen - i - 1] ];
152      }      }
153    for (; i < index_depth; i++)    for (; i < index_depth; i++)
154      {      {
155        *p++ = '/';        *p++ = '/';
156        *p++ = user[0];        *p++ = transtab[ user[0] ];
157      }      }
158    *p++ = '/';    *p++ = '/';
159    strcpy (p, user);    strcpy (p, user);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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