Article View: news.software.nn
Article #9813Re: nn-6.6.beta2 now available
From: J. Porter Clark
Date: Wed, 11 Jul 2001 00:23
Date: Wed, 11 Jul 2001 00:23
248 lines
8566 bytes
8566 bytes
As promised long ago, here are some diffs to nn-6.6.beta2 to add the
wonderful save-header-only function, which I have mapped to "T" so as
to infuriate the entire world, which has probably already mapped it to
some other function. It tends to save one too many newlines after each
header depending on various variables; I will fix this someday until
someone else beats me to it.
These diffs also fix a longstanding problem with uudecode file modes.
Also, I changed the "biggest possible article number" constant to a
really huge long integer. I actually found this necessary on one
server.
I'm still not totally sure about the open_mode table. I changed it to
what gives me the best results.
diff -c -r nn-6.6.beta2/decode.c nn-6.6.beta2-jpc/decode.c
*** nn-6.6.beta2/decode.c Mon Apr 9 22:56:46 2001
--- nn-6.6.beta2-jpc/decode.c Tue Jul 10 18:34:50 2001
***************
*** 423,429 ****
goto err;
}
} else {
! if(sscanf(line,"begin%d%s", &mode, arcname) != 2)
continue;
if (target != NULL)
--- 423,429 ----
goto err;
}
} else {
! if(sscanf(line,"begin%o%s", &mode, arcname) != 2)
continue;
if (target != NULL)
diff -c -r nn-6.6.beta2/keymap.c nn-6.6.beta2-jpc/keymap.c
*** nn-6.6.beta2/keymap.c Tue Jun 23 12:18:31 1998
--- nn-6.6.beta2-jpc/keymap.c Tue Jul 10 18:36:35 2001
***************
*** 172,178 ****
/* Q */ K_QUIT,
/* R */ K_REPLY,
/* S */ K_SAVE_FULL_HEADER,
! /* T */ K_UNBOUND,
/* U */ K_UNSUBSCRIBE,
/* V */ K_VERSION,
/* W */ K_SAVE_NO_HEADER,
--- 172,178 ----
/* Q */ K_QUIT,
/* R */ K_REPLY,
/* S */ K_SAVE_FULL_HEADER,
! /* T */ K_SAVE_HEADER_ONLY,
/* U */ K_UNSUBSCRIBE,
/* V */ K_VERSION,
/* W */ K_SAVE_NO_HEADER,
***************
*** 380,386 ****
/* Q */ K_QUIT,
/* R */ K_REPLY,
/* S */ K_SAVE_FULL_HEADER,
! /* T */ K_UNBOUND,
/* U */ K_UNSUBSCRIBE,
/* V */ K_VERSION,
/* W */ K_SAVE_NO_HEADER,
--- 380,386 ----
/* Q */ K_QUIT,
/* R */ K_REPLY,
/* S */ K_SAVE_FULL_HEADER,
! /* T */ K_SAVE_HEADER_ONLY,
/* U */ K_UNSUBSCRIBE,
/* V */ K_VERSION,
/* W */ K_SAVE_NO_HEADER,
***************
*** 538,543 ****
--- 538,544 ----
"save-body", K_SAVE_NO_HEADER, 0,
"save-full", K_SAVE_FULL_HEADER, 0,
+ "save-hdr-only", K_SAVE_HEADER_ONLY, 0,
"save-short", K_SAVE_SHORT_HEADER, 0,
"select", K_SELECT, K_ONLY_MENU,
"select-auto", K_AUTO_SELECT, K_ONLY_MENU,
diff -c -r nn-6.6.beta2/keymap.h nn-6.6.beta2-jpc/keymap.h
*** nn-6.6.beta2/keymap.h Sat Apr 29 00:34:49 1995
--- nn-6.6.beta2-jpc/keymap.h Tue Jul 10 18:37:23 2001
***************
*** 104,109 ****
--- 104,110 ----
#define K_OPEN_SUBJECT 0x0050 /* open subject on menu */
#define K_CLOSE_SUBJECT 0x0051 /* close subject on menu */
+ #define K_SAVE_HEADER_ONLY 0x0052 /* save header only */
#define K_M_TOGGLE 0x0060 /* page with mouse */
#define K_M_CONTINUE 0x0061 /* page with mouse */
diff -c -r nn-6.6.beta2/menu.c nn-6.6.beta2-jpc/menu.c
*** nn-6.6.beta2/menu.c Tue Jul 3 23:49:20 2001
--- nn-6.6.beta2-jpc/menu.c Tue Jul 10 18:38:41 2001
***************
*** 1418,1423 ****
--- 1418,1424 ----
case K_SAVE_NO_HEADER:
case K_SAVE_SHORT_HEADER:
case K_SAVE_FULL_HEADER:
+ case K_SAVE_HEADER_ONLY:
case K_PRINT:
case K_UNSHAR:
case K_PATCH:
diff -c -r nn-6.6.beta2/more.c nn-6.6.beta2-jpc/more.c
*** nn-6.6.beta2/more.c Mon Jul 2 00:21:34 2001
--- nn-6.6.beta2-jpc/more.c Tue Jul 10 18:39:09 2001
***************
*** 1185,1190 ****
--- 1185,1191 ----
case K_SAVE_NO_HEADER:
case K_SAVE_SHORT_HEADER:
case K_SAVE_FULL_HEADER:
+ case K_SAVE_HEADER_ONLY:
case K_PRINT:
case K_UNSHAR:
case K_PATCH:
diff -c -r nn-6.6.beta2/newsrc.c nn-6.6.beta2-jpc/newsrc.c
*** nn-6.6.beta2/newsrc.c Wed Jun 27 14:18:31 2001
--- nn-6.6.beta2-jpc/newsrc.c Tue Jul 10 18:39:35 2001
***************
*** 103,109 ****
#define SEL_END_DIGEST ')' /* end digest list */
#define SEL_NEW '&' /* new group (group.name&nnn) */
! #define END_OF_LIST 10000000L /* Greater than any article number */
/* line buffers */
--- 103,109 ----
#define SEL_END_DIGEST ')' /* end digest list */
#define SEL_NEW '&' /* new group (group.name&nnn) */
! #define END_OF_LIST 0x7fffffffL /* Greater than any article number */
/* line buffers */
diff -c -r nn-6.6.beta2/save.c nn-6.6.beta2-jpc/save.c
*** nn-6.6.beta2/save.c Sat Apr 29 00:35:11 1995
--- nn-6.6.beta2-jpc/save.c Tue Jul 10 18:44:27 2001
***************
*** 68,73 ****
--- 68,74 ----
#define SHORT_HEADER 1 /* save with partial header */
#define FULL_HEADER 2 /* save with full header */
#define SHORT_HEADER_DG 3 /* save with partial header (digest) */
+ #define HEADER_ONLY 4 /* save with *only* the header */
export int print_header_type = SHORT_HEADER;
***************
*** 85,92 ****
static int open_mode[] = {
SKIP_HEADER,
FILL_NEWS_HEADER | SKIP_HEADER | GET_ALL_FIELDS,
! 0,
! FILL_NEWS_HEADER | FILL_DIGEST_HEADER | SKIP_HEADER | GET_ALL_FIELDS
};
static FILE *save_file; /* output stream for saved files */
--- 86,94 ----
static int open_mode[] = {
SKIP_HEADER,
FILL_NEWS_HEADER | SKIP_HEADER | GET_ALL_FIELDS,
! FILL_NEWS_HEADER,
! FILL_NEWS_HEADER | FILL_DIGEST_HEADER | SKIP_HEADER | GET_ALL_FIELDS,
! FILL_NEWS_HEADER,
};
static FILE *save_file; /* output stream for saved files */
***************
*** 201,206 ****
--- 203,213 ----
mode_text = "Output";
goto cont_save;
+ case K_SAVE_HEADER_ONLY:
+ save_mode = HEADER_ONLY;
+ mode_text = "Header_save";
+ goto cont_save;
+
case K_SAVE_NO_HEADER:
save_mode = NO_HEADER;
mode_text = "Write";
***************
*** 530,536 ****
if (with_header)
mailbox_format(save_file, 1);
! if (mode == FULL_HEADER) {
off_t cnt = ah->fpos - ah->hpos;
while (--cnt >= 0) {
if ((c = getc(art)) == EOF) break;
--- 537,543 ----
if (with_header)
mailbox_format(save_file, 1);
! if (mode == FULL_HEADER || mode == HEADER_ONLY) {
off_t cnt = ah->fpos - ah->hpos;
while (--cnt >= 0) {
if ((c = getc(art)) == EOF) break;
***************
*** 550,563 ****
fflush(save_file);
if (s_pipe) goto broken_pipe;
! lcount = 0;
! while (ftell(art) < ah->lpos && fgets(copybuf, 512, art)) {
! lcount++;
! if (rot13_active) rot13_line(copybuf);
! if (saved_header_escape && with_header && is_header_line(copybuf))
! fputs(saved_header_escape, save_file);
! fputs(copybuf, save_file);
! if (s_pipe) goto broken_pipe;
}
if (with_header)
--- 557,572 ----
fflush(save_file);
if (s_pipe) goto broken_pipe;
! if (mode != HEADER_ONLY) {
! lcount = 0;
! while (ftell(art) < ah->lpos && fgets(copybuf, 512, art)) {
! lcount++;
! if (rot13_active) rot13_line(copybuf);
! if (saved_header_escape && with_header && is_header_line(copybuf))
! fputs(saved_header_escape, save_file);
! fputs(copybuf, save_file);
! if (s_pipe) goto broken_pipe;
! }
}
if (with_header)
Technical Details
Message-ID:
<3b4b9c74$0$14440$272ea4a1@news.execpc.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nn.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!newspump.sol.net!169.207.30.12.MISMATCH!posts0.nwblwi.newsops.execpc.com!posts.news.execpc.com!reader0-nwblwi.newsops.execpc.com!not-for-mailReferences:
<nEy07.8008$B7.1494615@ruti.visi.com>Show Full Headers
Complete Article Headers
Message-ID: <3b4b9c74$0$14440$272ea4a1@news.execpc.com> Subject: Re: nn-6.6.beta2 now available Date: Wed, 11 Jul 2001 00:23:17 +0000 From: jpc@suespammers.org (J. Porter Clark) References: <nEy07.8008$B7.1494615@ruti.visi.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nn.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!newspump.sol.net!169.207.30.12.MISMATCH!posts0.nwblwi.newsops.execpc.com!posts.news.execpc.com!reader0-nwblwi.newsops.execpc.com!not-for-mail Newsgroups: news.software.nn Organization: http://members.nbci.com/porterclark/ User-Agent: nn/6.6.beta2 Lines: 247 NNTP-Posting-Host: 64379cf4.news.execpc.com X-Trace: DXC=8_?lj?LnY3CRK32]9ZGcdM2BE>7J@WeMLbCigiU>8_hH4`>8YbCYbkMYLQ7akVn5OId[B2fMM>A]A\K1E[a;YUSL X-Complaints-To: abuse@execpc.com