char buf[PATH_MAX];
int a;
struct ctdlroom qrbuf;
+ int rv = 0;
extract_token(filename, cmdbuf, 0, '|', sizeof filename);
extract_token(newroom, cmdbuf, 1, '|', sizeof newroom);
snprintf(buf, sizeof buf,
"cat ./files/%s/filedir |grep \"%s\" >>./files/%s/filedir",
CC->room.QRdirname, filename, qrbuf.QRdirname);
- system(buf);
+ rv = system(buf);
cprintf("%d File '%s' has been moved.\n", CIT_OK, filename);
}
char which_user[USERNAME_SIZE];
int which_floor;
int a;
+ int rv;
extract_token(filename, cmdbuf, 0, '|', sizeof filename);
ERROR + FILE_NOT_FOUND, pathname, strerror(errno));
return;
}
- fread(&MimeTestBuf[0], 1, 32, CC->download_fp);
+ rv = fread(&MimeTestBuf[0], 1, 32, CC->download_fp);
rewind (CC->download_fp);
OpenCmdResult(pathname, GuessMimeType(&MimeTestBuf[0], 32));
}
{
int bytes;
char *buf;
+ int rv;
unbuffer_output();
cprintf("%d %d\n", SEND_BINARY, bytes);
buf = malloc(bytes + 1);
client_read(buf, bytes);
- fwrite(buf, bytes, 1, CC->upload_fp);
+ rv = fwrite(buf, bytes, 1, CC->upload_fp);
free(buf);
}
* API function to perform an operation for each qualifying message in the
* current room. (Returns the number of messages processed.)
*/
-int CtdlForEachMessage(int mode, long ref, char *search_string,
+int CtdlForEachMessage(int mode,
+ long ref,
+ char *search_string,
char *content_type,
struct CtdlMessage *compare,
void (*CallBack) (long, void *),
}
}
+ /* If an EUID was specified, throw away all messages except the correct one. */
+ if (mode == MSGS_EUID) {
+ long correct_msgnum;
+ int found_match = 0;
+
+ if ((num_msgs > 0) && (search_string) ) {
+ correct_msgnum = locate_message_by_euid(search_string, &CC->room);
+ if ( (num_msgs > 0) && (correct_msgnum >= 0L) ) {
+ for (i=0; i<num_msgs; ++i) {
+ if (msglist[i] == correct_msgnum) {
+ found_match = 1;
+ }
+ }
+ }
+ }
+ if (found_match) {
+ msglist[0] = correct_msgnum;
+ num_msgs = 1;
+ } else {
+ num_msgs = 0; /* didn't find the right one ... dump the rest */
+ }
+ mode = MSGS_ALL; /* treat it like 'read all' from now on */
+ }
+
/* If a search string was specified, get a message list from
* the full text index and remove messages which aren't on both
* lists.
mode = MSGS_GT;
else if (!strncasecmp(which, "SEARCH", 6))
mode = MSGS_SEARCH;
+ else if (!strncasecmp(which, "EUID", 4))
+ mode = MSGS_EUID;
else
mode = MSGS_ALL;
CtdlForEachMessage(mode,
( (mode == MSGS_SEARCH) ? 0 : cm_ref ),
- ( (mode == MSGS_SEARCH) ? search_string : NULL ),
+ ( ((mode == MSGS_SEARCH)||(mode == MSGS_EUID)) ? search_string : NULL ),
NULL,
template,
(with_headers ? headers_listing : simple_listing),