Attempt to fix external editor problem

This commit is contained in:
Andrew Pamment 2016-04-09 12:44:25 +10:00
parent 9e73cefd91
commit 25344a392c

View File

@ -283,7 +283,13 @@ char *external_editor(int socket, struct user_record *user, char *to, char *from
// write msgtemp // write msgtemp
if (quote != NULL) { if (quote != NULL) {
fptr = fopen(buffer, "w"); fptr = fopen(buffer, "w");
fwrite(quote, strlen(quote), 1, fptr); for (i=0;i<strlen(quote);i++) {
if (quote[i] == '\r') {
fprintf(fptr, "\r\n");
} else {
fprintf(fptr, "%c", quote[i]);
}
}
fclose(fptr); fclose(fptr);
} }
sprintf(buffer, "%s/node%d/MSGINF", conf.bbs_path, mynode); sprintf(buffer, "%s/node%d/MSGINF", conf.bbs_path, mynode);