Thread View: news.software.readers
2 messages
2 total messages
Started by Olaf Titz
Sun, 12 Nov 1995 00:00
Another trn mini-patch
Author: Olaf Titz
Date: Sun, 12 Nov 1995 00:00
Date: Sun, 12 Nov 1995 00:00
26 lines
1435 bytes
1435 bytes
Some uuencoding/posting software from the DOS world puts out
Control-Ms at the end of each line. trn 3.6 doesn't handle (i.e.
ignore) these correctly. The following patch fixes that.
olaf
--- uudecode.c.orig Sat Oct 28 15:05:21 1995
+++ uudecode.c Sat Oct 28 15:07:35 1995
@@ -85,6 +85,11 @@
while ((state & NO_ADVANCE) || fgets(buff, sizeof buff, in) != Nullch) {
numl++;
+ lens = strlen(buff)-2;
+ if (buff[lens] == '\r') {
+ buff[lens] = buff[lens+1];
+ buff[lens+1] = '\0';
+ }
switch (state) {
case NEW_BEGIN:
--
___ Olaf.Titz@inka.de or @{stud,informatik}.uni-karlsruhe.de ____
__ o <URL:http://www.inka.de/~bigred/> <IRC:praetorius>
__/<_ >> Just as long as the wheels keep on turning round
_)>(_)______________ I will live for the groove 'til the sun goes down << ____
Re: Another trn mini-patch (Correction)
Author: Olaf Titz
Date: Mon, 13 Nov 1995 00:00
Date: Mon, 13 Nov 1995 00:00
26 lines
1519 bytes
1519 bytes
As Thomas Roessler <Thomas.Roessler@sobolev.rhein.de> has pointed out
to me, my patch has the potential to bomb out if a line of input is
empty. Better use the following sanity-checked version.
Olaf
--- uudecode.c.orig Sat Oct 28 15:05:21 1995
+++ uudecode.c Tue Nov 14 00:20:18 1995
@@ -85,6 +85,11 @@
while ((state & NO_ADVANCE) || fgets(buff, sizeof buff, in) != Nullch) {
numl++;
+ lens = strlen(buff)-2;
+ if ((lens>=0) && (buff[lens] == '\r')) {
+ buff[lens] = buff[lens+1];
+ buff[lens+1] = '\0';
+ }
switch (state) {
case NEW_BEGIN:
--
___ Olaf.Titz@inka.de or @{stud,informatik}.uni-karlsruhe.de ____
__ o <URL:http://www.inka.de/~bigred/> <IRC:praetorius>
__/<_ >> Just as long as the wheels keep on turning round
_)>(_)______________ I will live for the groove 'til the sun goes down << ____
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads