-
Notifications
You must be signed in to change notification settings - Fork 1
Notes about the code
Ambrose Li edited this page Aug 2, 2020
·
16 revisions
Basic screen I/O
- uses bare termcap/terminfo, not curses
- output goes to stdout with FLUSH macro: printf("foo\n") FLUSH;
- reposition cursor: s_goxy(x, y);
Subject lines
- by the time decode_header() gets to see anything all the \n's (vital for proper MIME decoding) are gone
Article selector
- article_selector() in rt-select.c
- display_page() in rt-page.c
- print_lines() is used for the help screen but not on the actual selection page
- display_subject()? ← yes, this is it, grep for "%s%3d (it’s the else statement) → compress_from() in rt-util.c
Article display
- do_article() in art.c – grep “normal line”
- it seems to output characters one byte at a time :-/
- to investigate: putsubstchar() in charsubst.c
MIME decoding
- mime_SetArticle (in mime.c) re-sets is_mime when content-transfer-encoding is 7bit or 8bit (e.g. CJK). I can’t see how this is justifiable given headers (esp. From and Subject) can still be QP-quoted
HTML decoding
-
mime.c
-
it’s really not decoding or parsing, just string replacement. Kind of like what w3c does but even more sloppy. We get garbage like this:
Breakpoint 1, tag_action (t=0x6e4c18 "", word=0x68cb20 "img style=display: block; margi", opening_tag=1) at mime.c:1384 1384 if ((cp = find_attr(word, "alt")) != NULL) { (gdb) p cp $1 = 0x68cb23 <tagword+3> " style=display: block; margi" (gdb) p word $2 = 0x68cb20 "img style=display: block; margi"