char *c = str;
while (*c != 0) {
- if (*c == '&') {
- client_write("&", 5);
+ if (*c == '\"') {
+ client_write(""", 4);
+ }
+ else if (*c == '\'') {
+ client_write("'", 4);
}
else if (*c == '<') {
client_write("<", 4);
else if (*c == '>') {
client_write(">", 4);
}
+ else if (*c == '&') {
+ client_write("&", 5);
+ }
else {
client_write(c, 1);
}
* this will be handled by exporting the reference count, not by
* exporting the message multiple times.)
*/
- snprintf(cmd, sizeof cmd, "sort <%s >%s", migr_tempfilename1, migr_tempfilename2);
+ snprintf(cmd, sizeof cmd, "sort -n <%s >%s", migr_tempfilename1, migr_tempfilename2);
if (system(cmd) != 0) CtdlLogPrintf(CTDL_ALERT, "Error %d\n", errno);
snprintf(cmd, sizeof cmd, "uniq <%s >%s", migr_tempfilename2, migr_tempfilename1);
if (system(cmd) != 0) CtdlLogPrintf(CTDL_ALERT, "Error %d\n", errno);
* Traverse the visits file...
*/
void migr_export_visits(void) {
- struct visit vbuf;
+ visit vbuf;
struct cdbdata *cdbv;
cdb_rewind(CDB_VISIT);
while (cdbv = cdb_next_item(CDB_VISIT), cdbv != NULL) {
- memset(&vbuf, 0, sizeof(struct visit));
+ memset(&vbuf, 0, sizeof(visit));
memcpy(&vbuf, cdbv->ptr,
- ((cdbv->len > sizeof(struct visit)) ?
- sizeof(struct visit) : cdbv->len));
+ ((cdbv->len > sizeof(visit)) ?
+ sizeof(visit) : cdbv->len));
cdb_free(cdbv);
client_write("<visit>\n", 8);
char FRname[ROOMNAMELEN];
struct floor flbuf;
int floornum = 0;
-struct visit vbuf;
+visit vbuf;
struct MetaData smi;
long import_msgnum = 0;
char *decoded_msg = NULL;
}
if (citadel_migrate_data != 1) {
- CtdlLogPrintf(CTDL_ALERT, "Out-of-sequence tag <%s> detected. Warning: ODD-DATA!\n");
+ CtdlLogPrintf(CTDL_ALERT, "Out-of-sequence tag <%s> detected. Warning: ODD-DATA!\n", el);
return;
}
else if (!strcasecmp(el, "room")) memset(&qrbuf, 0, sizeof (struct ctdlroom));
else if (!strcasecmp(el, "room_messages")) memset(FRname, 0, sizeof FRname);
else if (!strcasecmp(el, "floor")) memset(&flbuf, 0, sizeof (struct floor));
- else if (!strcasecmp(el, "visit")) memset(&vbuf, 0, sizeof (struct visit));
+ else if (!strcasecmp(el, "visit")) memset(&vbuf, 0, sizeof (visit));
else if (!strcasecmp(el, "message")) {
memset(&smi, 0, sizeof (struct MetaData));
}
if (citadel_migrate_data != 1) {
- CtdlLogPrintf(CTDL_ALERT, "Out-of-sequence tag <%s> detected. Warning: ODD-DATA!\n");
+ CtdlLogPrintf(CTDL_ALERT, "Out-of-sequence tag <%s> detected. Warning: ODD-DATA!\n", el);
return;
}