Article View: news.software.readers
Article #26227slrn: patch to fix decoding problems when using local spool backend
From: Olly Betts
Date: Sun, 22 Sep 1996 00:00
Date: Sun, 22 Sep 1996 00:00
63 lines
2914 bytes
2914 bytes
The slrn local spool backend changes directory to the spool directory for
the current group (I did it like this on the thinking that it would be more
efficient than using absolute paths). However, decoding uucode/base64
postings also changes the current directory, with the result that you have
to exit the group after decoding, as otherwise you can't read any more
articles.
Here's a patch for slrn 0.9.0.0 to fix this. It simply changes the current
directory before opening an article, which isn't terribly clever, but works.
Before I fix this better, I want to look into whether it's worth changing
directory onto the spool or not.
There's another bug related to using the local spool -- paths relative to
spool_inn_root don't get resolved correctly if you set spool_inn_root in
your .slrnrc. This is caused by things getting initialised in the wrong
order, and John tells me he believes it to be fixed in his development
version. In the meantime, the workaround is to give absolute paths for
spool_active_file, etc.
Olly
--- spool.c.orig Sun Sep 22 13:54:09 1996
+++ spool.c Sun Sep 22 13:57:35 1996
@@ -259,6 +259,9 @@
/* ugly temporary use of buffer !HACK! */
p = buf;
+ /* Quick fix for problem of uudecode.c changing current directory */
+ if (chdir (Spool_Group)) return ERR_NOARTIG; /* No such article in this group */
+
Spool_fh_local = fopen (p,"r");
if (NULL == Spool_fh_local)
{
@@ -864,6 +867,10 @@
Spool_cur_artnum = n;
sprintf (num,"%d",n);
spool_fclose_local();
+
+ /* Quick fix for problem of uudecode.c changing current directory */
+ if (chdir (Spool_Group)) return -1;
+
Spool_fh_local = fopen (num,"rb"); /* fopen the article in question */
if (Spool_fh_local == NULL)
return -1;
@@ -1093,6 +1100,10 @@
if ((msgid == NULL) || (*msgid == 0)) return NULL;
id=spool_find_artnum_from_msgid(msgid);
sprintf(buf,"%d",id); /* !HACK! brief buf abuse */
+
+ /* Quick fix for problem of uudecode.c changing current directory */
+ if (chdir (Spool_Group)) return NULL;
+
Spool_fh_local=fopen(buf,"r");
if (!Spool_fh_local)
return NULL;
--
cool wet grass cool wet grass cool wet grass cool wet grass cool wet grass
Technical Details
Message-ID:
<slrn54af4i.foc.olly@mantis.co.uk>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!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <slrn54af4i.foc.olly@mantis.co.uk> Subject: slrn: patch to fix decoding problems when using local spool backend Date: Sun, 22 Sep 1996 00:00:00 +0000 From: olly@mantis.co.uk (Olly Betts) 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!not-for-mail X-Deja-AN: 184574010 Content-type: text/plain; charset=iso-8859-1 Organization: Mantis Consultants Ltd, Cambridge. UK. Mime-version: 1.0 Newsgroups: news.software.readers