summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
be393b8)
- fix bug #4709
git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@385
e385b8ad-14ed-0310-8656-
cc95a2468c6d
int bytes = a->length;
char buf[LONG_STRING];
char *curline = strdup ("");
int bytes = a->length;
char buf[LONG_STRING];
char *curline = strdup ("");
unsigned int curline_len = 1;
unsigned int quotelevel = 0, newql = 0;
int first_line = 1;
unsigned int curline_len = 1;
unsigned int quotelevel = 0, newql = 0;
int first_line = 1;
newql = get_quote_level (buf);
newql = get_quote_level (buf);
- if ((t = strrchr (buf, '\n')) || (t = strrchr (buf, '\r'))) {
- *t = '\0';
+ if (bytes == 0 || ((t = strrchr (buf, '\n')) || (t = strrchr (buf, '\r')))) {
+ if (t)
+ *t = '\0';
if (str_len (curline) > 0 && curline[str_len (curline) - 1] == ' '
&& newql == quotelevel
&& strcmp (curline + quotelevel, "-- ") != 0) {
if (str_len (curline) > 0 && curline[str_len (curline) - 1] == ' '
&& newql == quotelevel
&& strcmp (curline + quotelevel, "-- ") != 0) {
- else if (bytes == 0) {
- /* in case there's no line end it's likely the last line
- * so append to current (if any) */
- if (buf[newql] == ' ')
- curline[str_len (curline) - 1] = '\0';
- curline = realloc (curline, curline_len + str_len (buf));
- if (curline_len == 1)
- *curline = '\0';
- curline_len += str_len (buf);
- str_ncat (curline, curline_len, buf + newql,
- str_len (buf + newql));
- break;
- }
}
if (curline) {
print_flowed_line (curline, s, quotelevel);
}
if (curline) {
print_flowed_line (curline, s, quotelevel);