Attempt to include last line in quotes

This commit is contained in:
Andrew Pamment 2017-09-11 08:37:49 +10:00
parent 4ff97e8daf
commit d5e9f84c6e

View File

@ -940,9 +940,6 @@ int main(int argc, char **argv)
buffer[strlen(buffer) - 1] = '\0'; buffer[strlen(buffer) - 1] = '\0';
} else if (buffer[strlen(buffer) - 1] == '\n') { } else if (buffer[strlen(buffer) - 1] == '\n') {
buffer[strlen(buffer) - 1] = '\r'; buffer[strlen(buffer) - 1] = '\r';
} else {
buffer[strlen(buffer)+1] = '\0';
buffer[strlen(buffer)] = '\r';
} }
if (unwrapped_quote_len == 0) { if (unwrapped_quote_len == 0) {
unwrapped_quote = (char *)malloc(strlen(buffer) + 1); unwrapped_quote = (char *)malloc(strlen(buffer) + 1);
@ -1027,34 +1024,18 @@ int main(int argc, char **argv)
j++; j++;
} }
} }
if (j > 0) {
/* if (quote_line_count == 0) {
fgets(buffer, 73, fptr); quote_lines = (char **)malloc(sizeof(char *));
while (!feof(fptr)) { } else {
for (i=strlen(buffer) - 1; i >= 0; i--) { quote_lines = (char **)realloc(quote_lines, sizeof(char *) * (quote_line_count + 1));
if (buffer[i] != '\r' && buffer[i] != '\n') { }
break; quote_lines[quote_line_count] = (char *)malloc(i - start_line + 6);
} else { memset(buffer, 0, 256);
buffer[i] = '\0'; strncpy(buffer, &unwrapped_quote[start_line], j);
} sprintf(quote_lines[quote_line_count], " %c> %s", msgto[0], buffer);
} quote_line_count++;
}
if (quote_line_count == 0) {
quote_lines = (char **)malloc(sizeof(char *));
} else {
quote_lines = (char **)realloc(quote_lines, sizeof(char *) * (quote_line_count + 1));
}
quote_lines[quote_line_count] = (char *)malloc(strlen(buffer) + 5);
sprintf(quote_lines[quote_line_count], " %c> %s", msgto[0], buffer);
quote_line_count++;
fgets(buffer, 73, fptr);
}
*/
} }
body = message_editor(); body = message_editor();