~rjarry/aerc#131: 
wrap utility should skip the signature delimiter block

[A] signature block is conventionally delimited from the body of the message by a single line consisting of exactly two hyphens, followed by a space, followed by the end of line (i.e., in C-notation: "-- \n").

As of now, when reflowing, wrap deletes the space that follows the two hyphens, which leads to failing to recognize the signature (for example, if some other program is used as a pager after wrap).

Probably, wrap should just skip ^-- $ lines altogether.

Status
RESOLVED FIXED
Submitter
~john1doe
Assigned to
Submitted
10 months ago
Updated
7 months ago
Labels
bug

~rjarry REPORTED FIXED 7 months ago

Should work now after the rework of the filter in C

https://git.sr.ht/~rjarry/aerc/commit/3191ee171c435a43912264b131340af66fea8112

~john1doe 7 months ago

~rjarry

Should work now after the rework of the filter in C

No, it doesn't :)

~> echo '-- ' | /usr/local/share/aerc/filters/wrap | awk '{print length($0)}'
2
~> echo '-- ' | awk '{print length($0)}'
3
~> file /usr/local/share/aerc/filters/wrap
/usr/local/share/aerc/filters/wrap: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked

~rjarry 7 months ago

Are you running on master? The current wrap utility is not statically linked.

Also, the trailing space is stripped but the line following a signature delimiter is not wrapped.

rjarry@ringo:~/upstream/aerc master$ printf -- "-- \nfoo" | ./wrap 
--
foo
rjarry@ringo:~/upstream/aerc master$ printf -- "-- \nfoo" | ./wrap | hexdump -vC
00000000  2d 2d 0a 66 6f 6f 0a                              |--.foo.|
00000007
rjarry@ringo:~/upstream/aerc master$ file ./wrap 
./wrap: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6c1fa77785e0b68062ae9cd5eb39e04c3d499fe7, for GNU/Linux 3.2.0, not stripped

~rjarry FIXED REPORTED 7 months ago

~john1doe 7 months ago

Are you running on master?

0.14.144

the trailing space is stripped

Which is exactly the problem :)

Because when viewing mail in some other program, like Vim with :set ft=mail, because of this missing space the signature is not highlighted correctly.

Stripping trailing spaces is good, and I support it with my both hands :) However, in this particular case (beginning-of-the-line dash dash space end-of-the-line) it shouldn't be applied.

~rjarry REPORTED FIXED 7 months ago

Robin Jarry referenced this ticket in commit dd575e2.

Register here or Log in to comment, or comment via email.