not complete. CtdlEncodeBase64() still initialized upon each call -- and it was
initializing dtable, not etable, causing dtable to have the wrong data the next time
CtdlDecodeBase64() is called. Fixed. Also noticed that WebCit was not calling the
initialization function at all, so this has probably been broken ever since the move
to libcitadel. Fixed this too.
int dpos = 0;
int thisline = 0;
int dpos = 0;
int thisline = 0;
- /** Fill dtable with character encodings. */
-
- for (i = 0; i < 26; i++) {
- dtable[i] = 'A' + i;
- dtable[26 + i] = 'a' + i;
- }
- for (i = 0; i < 10; i++) {
- dtable[52 + i] = '0' + i;
- }
- dtable[62] = '+';
- dtable[63] = '/';
-
while (!hiteof) {
byte igroup[3], ogroup[4];
int c, n;
while (!hiteof) {
byte igroup[3], ogroup[4];
int c, n;
igroup[n] = (byte) c;
}
if (n > 0) {
igroup[n] = (byte) c;
}
if (n > 0) {
- ogroup[0] = dtable[igroup[0] >> 2];
+ ogroup[0] = etable[igroup[0] >> 2];
- dtable[((igroup[0] & 3) << 4) |
+ etable[((igroup[0] & 3) << 4) |
(igroup[1] >> 4)];
ogroup[2] =
(igroup[1] >> 4)];
ogroup[2] =
- dtable[((igroup[1] & 0xF) << 2) |
+ etable[((igroup[1] & 0xF) << 2) |
- ogroup[3] = dtable[igroup[2] & 0x3F];
+ ogroup[3] = etable[igroup[2] & 0x3F];
* Replace characters in output stream with "=" pad
* characters if fewer than three characters were
* read from the end of the input stream.
* Replace characters in output stream with "=" pad
* characters if fewer than three characters were
* read from the end of the input stream.
int dpos = 0;
int spos = 0;
int dpos = 0;
int spos = 0;
-
- /*CONSTANTCONDITION*/
while (TRUE) {
byte a[4], b[4], o[3];
while (TRUE) {
byte a[4], b[4], o[3];
lprintf(9, "Changing directory to %s\n", socket_dir);
if (chdir(webcitdir) != 0) {
perror("chdir");
lprintf(9, "Changing directory to %s\n", socket_dir);
if (chdir(webcitdir) != 0) {
perror("chdir");
+ }
+ CtdlInitBase64Table();
initialize_viewdefs();
initialize_axdefs();
initialize_viewdefs();
initialize_axdefs();