🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #70516

Re: [slrn] Bug?: Charset is changed when editing a rejected posting

#70516
From: Thomas Schultz
Date: Mon, 15 Jan 2001 18:23
88 lines
4224 bytes
On 24 December 2000, Bernd Nawothnig <Bernd.Nawothnig@tu-clausthal.de> wrote:

> When reediting a rejected posting (because one newsgroup isn't
> available on my local server) under Win32 the article is presented as
> an Ansi-Textfile instead of a Dos-Textfile (which it was before).
[...]
> Any Idea? Or is it a bug?

It's a bug in slrn and I will attach an ad hoc fix for it. The other
problem you mentioned might be a bug in s-lang, but I currently cannot
verify this, sorry.

#v+
diff -ur slrn-0.9.6.3.orig/src/chmap.c slrn-0.9.6.3/src/chmap.c
--- slrn-0.9.6.3.orig/src/chmap.c	Mon Sep 18 00:35:25 2000
+++ slrn-0.9.6.3/src/chmap.c	Mon Jan 15 18:56:39 2001
@@ -116,7 +116,7 @@
 #endif
 }
 
-int slrn_chmap_fix_file (char *file)
+int slrn_chmap_fix_file (char *file, int reverse)
 {
 #if SLRN_HAS_CHARACTER_MAP
    FILE *fp, *tmpfp;
@@ -161,7 +161,8 @@
    ret = 0;
    while (NULL != fgets (buf, sizeof (buf), fp))
      {
-	chmap_map_string_to_iso (buf);
+	if (reverse) chmap_map_string_from_iso (buf);
+	else chmap_map_string_to_iso (buf);
 	if (EOF == fputs (buf, tmpfp))
 	  {
 	     slrn_error ("Write Error. Disk Full? %s", Not_Posted);
diff -ur slrn-0.9.6.3.orig/src/chmap.h slrn-0.9.6.3/src/chmap.h
--- slrn-0.9.6.3.orig/src/chmap.h	Mon Sep 18 00:35:25 2000
+++ slrn-0.9.6.3/src/chmap.h	Mon Jan 15 18:55:56 2001
@@ -20,7 +20,7 @@
 #ifndef _SLRN_CHMAP_H
 #define _SLRN_CHMAP_H
 extern int slrn_set_charset (char *);
-extern int slrn_chmap_fix_file (char *);
+extern int slrn_chmap_fix_file (char *, int);
 extern void slrn_chmap_fix_body (Slrn_Article_Type *);
 extern void slrn_chmap_fix_headers (void);
 
diff -ur slrn-0.9.6.3.orig/src/misc.c slrn-0.9.6.3/src/misc.c
--- slrn-0.9.6.3.orig/src/misc.c	Mon Sep 18 00:35:27 2000
+++ slrn-0.9.6.3/src/misc.c	Mon Jan 15 18:55:45 2001
@@ -772,7 +772,7 @@
    if (-1 == slrn_save_file_to_mail_file (file, Slrn_Save_Replies_File, NULL))
      return -1;
 
-   slrn_chmap_fix_file (file);
+   slrn_chmap_fix_file (file, 0);
 
 #ifdef VMS
    sprintf(buf, "%s\"%s\"", MAIL_PROTOCOL, to);
diff -ur slrn-0.9.6.3.orig/src/post.c slrn-0.9.6.3/src/post.c
--- slrn-0.9.6.3.orig/src/post.c	Mon Sep 18 00:35:28 2000
+++ slrn-0.9.6.3/src/post.c	Mon Jan 15 19:03:45 2001
@@ -819,7 +819,7 @@
    if (-1 == slrn_save_file_to_mail_file (file, Slrn_Save_Posts_File, msgid))
      return -1;
 
-   slrn_chmap_fix_file (file);
+   slrn_chmap_fix_file (file, 0);
 
    if ((fp = fopen (file, "r")) == NULL)
      {
@@ -1003,7 +1003,8 @@
 	if ((rsp == 7)
 	    || (rsp == 'c') || (rsp == 'C')
 	    || (((rsp == 'e') || (rsp == 'E'))
-		&& (slrn_edit_file (Slrn_Editor_Post, file, 1, 0) < 0)))
+		&& ((slrn_chmap_fix_file (file, 1) < 0)
+		    || (slrn_edit_file (Slrn_Editor_Post, file, 1, 0) < 0))))
 	  {
 	     (void) saved_failed_post (file);
 	     return -1;
#v-
-- 
Thomas Schultz <tststs@gmx.de> * Recent news from http://slrn.sourceforge.net/
 -> [2000-12-21] slrn 0.9.6.3pl3 released
 -> [2000-10-22] Matthias Friedrich joins the team
 -> [2000-09-27] Initial release of the slrn reference manual
Technical Details
Message-ID: <slrn966g05.1n5.tststs@starflower.tststs.ddns.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.skycache.com!Cidera!news-hub.cableinet.net!newspeer.clara.net!news.clara.net!colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!do.de.uu.net!innmaster.de.uu.net!news.cityweb.de!tststs.ddns.org!not-for-mail
References: <slrn94c1gf.3vv1bll.Bernd.Nawothnig@Asterix.schacht.clz.de>

Show Full Headers
Complete Article Headers
Message-ID: <slrn966g05.1n5.tststs@starflower.tststs.ddns.org>
Subject: Re: [slrn] Bug?: Charset is changed when editing a rejected posting
Date: Mon, 15 Jan 2001 18:23:01 +0000
From: tststs@gmx.de (Thomas Schultz)
References: <slrn94c1gf.3vv1bll.Bernd.Nawothnig@Asterix.schacht.clz.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.skycache.com!Cidera!news-hub.cableinet.net!newspeer.clara.net!news.clara.net!colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!do.de.uu.net!innmaster.de.uu.net!news.cityweb.de!tststs.ddns.org!not-for-mail
Newsgroups: news.software.readers
Organization: Pinguin online.
Lines: 87
NNTP-Posting-Host: 149.225.119.0
NNTP-Posting-Date: 15 Jan 2001 19:01:05 GMT
X-Complaints-To: abuse@cityweb.de
X-Server-Date: 15 Jan 2001 18:59:04 GMT
User-Agent: slrn/0.9.6.3pl4 (Linux)