From: pdmef Date: Sun, 28 Aug 2005 20:38:57 +0000 (+0000) Subject: Rocco Rutte: X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=e5c944e193f275241f3c709d952387db9073f279 Rocco Rutte: - revert adjusting quoting for f=f messages done by force for now git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@460 e385b8ad-14ed-0310-8656-cc95a2468c6d --- diff --git a/BUGS b/BUGS index 9693b4b..be93cdc 100644 --- a/BUGS +++ b/BUGS @@ -4,31 +4,18 @@ difficult to fix. RfC 3676 defining format=flowed =============================== -This RfC specifies quote chars to be '>' and due to space-stuffing lines -there're no spaces withing the quote prefix of a line allowed. -Currently, the implementation does: +Muttng currently lacks correct dealing with quote prefixes in some +cases, i.e. when converting from format=fixed to format=flowed. One +problem is that $quote_regexp only specifies the complete quote sequence +instead of just one level. Second, quoting characters seen in the wild +like '|' or '#' are part of the default $quote_regexp but may also be +used to mark certain things like writing about examples or the like in +messages. Muttng does not do any guessing so that it's up to the user to +ensure correct quoting. -- Change all quote characters by force to '>'. This is plain wrong in - some cases where a character from $quote_regexp (even with the default - setting) may appear at the beginning of a line but actually doesn't - represent a quoted line. For example, someone may quote parts of - muttng configs with comments. However, _if_ this _is_ a quoted line - using e.g. '#' as $indent_string, we need to change the '#' prefix to - '>'. - -- Compress the complete quote, i.e. remove any spaces within the - complete quote prefix of a line. This, too, is just plain wrong. For - example, some people may have $indent_string set to '> ' and this gets - quoted several times to something like '>> >>'. However this - semanticly has a quote level of 3 as the second poster space-stuffed - that line. IMHO it's more common that people use spaces in - $indent_string (which the implementation removes right now) than - people space-stuffing lines which start '>' to ' >' when composing new - messages. - -- Altough the standard enforces space-stuffing as a MUST, muttng - currently violates it. Space-stuffing is done once after initially - editing the message. The routine only handles '^From ' and '^ ' cases, - '^>' is ignored. (Once because an already space-stuffed line still has - a leading space so that it would get space-stuffed everytime the user - edits a message.) +Altough the standard enforces space-stuffing as a MUST, muttng +currently violates it. Space-stuffing is done _once_ after initially +editing the message. The routine only handles '^From ' and '^ ' cases, +'^>' is ignored. (Once because an already space-stuffed line still has +a leading space so that it would get space-stuffed everytime the user +edits a message.) diff --git a/VERSION.svn b/VERSION.svn index 658bd78..ccbd68f 100644 --- a/VERSION.svn +++ b/VERSION.svn @@ -1 +1 @@ -459 +460 diff --git a/rfc3676.c b/rfc3676.c index b76108d..69f7fba 100644 --- a/rfc3676.c +++ b/rfc3676.c @@ -241,40 +241,6 @@ int rfc3676_handler (BODY * a, STATE * s) { return (0); } -void rfc3676_quote_line (STATE* s, char* dst, size_t dstlen, - const char* line) { - char quote[SHORT_STRING]; - int offset = 0, i = 0, count = 0; - regmatch_t pmatch[1]; - - quote[0] = '\0'; - - while (regexec ((regex_t *) QuoteRegexp.rx, &line[offset], - 1, pmatch, 0) == 0) - offset += pmatch->rm_eo; - - if (offset > 0) { - /* first count number of real quoting characters; - * read: non-spaces - * this maybe just plain wrong, but leaving spaces - * within quoting characters is what I consider - * more plain wrong... - */ - for (i = 0; i < offset; i++) - if (line[i] != ' ') - count++; - /* just make sure we're inside quote althoug we - * likely won't have more than SHORT_STRING quote levels... */ - i = (count > SHORT_STRING-1) ? SHORT_STRING-1 : count; - memset (quote, '>', i); - quote[i] = '\0'; - } - debug_print (4, ("f=f: quotelevel = %d, new prefix = '%s'\n", - i, NONULL (quote))); - snprintf (dst, dstlen, "%s%s%s", NONULL (s->prefix), NONULL (quote), - &line[offset]); -} - void rfc3676_space_stuff (HEADER* hdr) { #if DEBUG int lc = 0; diff --git a/rfc3676.h b/rfc3676.h index bb9d960..3ec6fdd 100644 --- a/rfc3676.h +++ b/rfc3676.h @@ -17,14 +17,6 @@ /* body handler implementing RfC 3676 for format=flowed */ int rfc3676_handler (BODY * a, STATE * s); -/* - * this properly ensures correct quoting; correct is: - * - no spaces within the complete quote prefix of line (sect. 4.5) - * - change all quoting chars to '>' by force; see BUGS in srcdir - */ -void rfc3676_quote_line (STATE* s, char* dst, size_t dstlen, - const char* line); - /* * this does the space-stuffing required as in 'MUST' * this is only used right after editing the initial message's content diff --git a/state.c b/state.c index 3dfdbfb..7b44389 100644 --- a/state.c +++ b/state.c @@ -90,9 +90,8 @@ void state_prefix_putc (char c, STATE * s) if (!option (OPTQUOTEEMPTY) && Quotebuf[offset] == '\n') { buf[0] = '\n'; buf[1] = '\0'; - } else if (option (OPTTEXTFLOWED)) - rfc3676_quote_line (s, buf, sizeof (buf), Quotebuf); - else if (option (OPTQUOTEQUOTED) && offset) { + } + else if (!option (OPTTEXTFLOWED) && option (OPTQUOTEQUOTED) && offset) { for (i = 0; i < offset; i++) if (Quotebuf[i] != ' ') j = i;