Article View: news.software.nn
Article #11377patch to mask top bit when displaying articles
From: G. Paul Ziemba
Date: Sun, 05 Feb 2012 06:58
Date: Sun, 05 Feb 2012 06:58
54 lines
3292 bytes
3292 bytes
I finally got annoyed enough at nn sending my xterm into goofball mode
due to non-ascii characters in posts that I made this quick and dirty
patch to mask off the high bit of characters sent to the terminal.
I'm open to suggestions for a better way to do it.
This patch is based on nn 6.7.3.
put "set term-7bit true" in .nn/init to enable.
--- term.c.orig 2005-06-29 14:40:27.000000000 -0700
+++ term.c 2012-02-04 22:29:13.000000000 -0800
@@ -153,6 +153,7 @@
int mouse_state; /* if xterm is in mouse state */
int mouse_usage; /* 0 don't set mouse, 1 only if xterm, 2 set
* mouse */
+int term_7bit = 0; /* mask top bit when displaying to terminal */
key_type help_key = '?';
key_type comp1_key = SP;
@@ -990,6 +991,9 @@
{
int i;
+ if (term_7bit)
+ c &= 0x7f;
+
#ifdef TERM_DEBUG
if (term_debug) {
fprintf(stderr, "tputc %d %d [%d] ", curxy_c, curxy_l, curxy_nonsp);
--- variable.c.orig 2005-03-30 11:15:31.000000000 -0800
+++ variable.c 2012-02-04 22:31:07.000000000 -0800
@@ -122,7 +122,7 @@
save_report, scroll_clear_page, select_leave_next, select_on_sender,
seq_cross_filtering, shell_restrictions, show_article_date,
show_current_time, show_motd_on_entry, silent, slow_mode,
- suggest_save_file, tidy_newsrc, use_ed_line, use_mail_folders,
+ suggest_save_file, term_7bit, tidy_newsrc, use_ed_line, use_mail_folders,
use_mmdf_folders, use_path_in_from, use_selections, use_visible_bell;
extern int /* integer variables */
@@ -386,6 +386,7 @@
"subject-match-offset", INT 0, (char **) &match_skip_prefix,
"subject-match-parts", BOOL 0, (char **) &match_parts_equal,
"suggest-default-save", BOOL 0, (char **) &suggest_save_file,
+ "term-7bit", BOOL 0, (char **) &term_7bit,
"tidy-newsrc", BOOL 0, (char **) &tidy_newsrc,
"time", BOOL 0, (char **) &show_current_time,
"trace-folder-packing", BOOL 0, (char **) &folder_rewrite_trace,
--
G. Paul Ziemba
FreeBSD unix:
10:56PM up 47 days, 1:17, 20 users, load averages: 0.32, 0.37, 0.35
Technical Details
Message-ID:
<jgl9bf$dgv$1@hairball.ziemba.us>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nn.20140326.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.astraweb.com!border6.newsrouter.astraweb.com!news-xfer.nntp.sonic.net!posts.news.sonic.net!nnrp1.nntp.sonic.net!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <jgl9bf$dgv$1@hairball.ziemba.us> Subject: patch to mask top bit when displaying articles Date: Sun, 05 Feb 2012 06:58:55 +0000 From: "G. Paul Ziemba" <paul+usenet@w6yx.stanford.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nn.20140326.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.astraweb.com!border6.newsrouter.astraweb.com!news-xfer.nntp.sonic.net!posts.news.sonic.net!nnrp1.nntp.sonic.net!not-for-mail Newsgroups: news.software.nn Organization: The Treehouse Reply-To: paul+usenet@w6yx.stanford.edu User-Agent: nn/6.7.3 Lines: 54 NNTP-Posting-Date: 05 Feb 2012 07:25:00 GMT NNTP-Posting-Host: e522a34c.news.sonic.net X-Trace: DXC=aOOaN3obR]; BnD]Qjm0_32m4K\QM1CV^01OYf0H`?; X17>J1Nl==FX42?0=KL2VB00[XakaPgm@G0e?TWG9kH=2? X-Complaints-To: abuse@sonic.net X-Original-Bytes: 3034