Subject: a patch for pine4.30

From: Ivan Zakharyaschev <[email-masked]>
Date: Thu, 9 Nov 2000 00:24:25 +0300 (MSK)

Hello, dear pine-developers and pine-users!

I have been building the new pine release (4.30) for Linux-Mandrake RE
(Russian Edition) distribution and...

I wonder whether anyone has tried to run PINE with no DEBUG compiled-in?!
(I mean passing DEBUG='' to make when building.)

If not, I'll tell you: it aborts on almost any action.

The problem isn't as serious as it might seem to be: just a stupid
misprint in the code (an important line was placed inside a "DEBUG-block",
but it shouldn't). A small patch fixes it, my PINE is working excellently
now! Thanks to the authors.

Perhaps it has been already corrected, in that case I'm sorry for
bothering you. By the way, is this mailing list the right place for a
bugfix? Should I have sent it somewhere else?

Best regards,

Ivan Zakharyaschev
IPLabs Linux Team (http://www.linux.iplabs.ru/)
--- pine4.30/pine/pine.c.orig	Fri Oct 20 00:10:18 2000
+++ pine4.30/pine/pine.c	Fri Nov  3 19:13:34 2000
@@ -328,8 +328,6 @@
     if(ps_global->debug_malloc)
       mal_debug(ps_global->debug_malloc);
 #endif
-
-    init_pinerc(pine_state);
     init_debug();
 
 #ifdef	_WINDOWS
@@ -339,6 +337,8 @@
     mswin_enableimaptelemetry(ps_global->debug_imap != 0);
 #endif
 #endif  /* DEBUG */
+
+    init_pinerc(pine_state);
 
 #ifdef	_WINDOWS
     mswin_setsortcallback(index_sort_callback);

---

From: [email-masked] (Trond Eivind Glomsrød)
Date: 08 Nov 2000 16:54:12 -0500

> (I mean passing DEBUG='' to make when building.)

Of course. Where do you think Mandrake got their build procedure from? ;)

Anyway, the following patch includes a patch from one of the pine team
and a patch of my own (extra check for NULL pointers) and should make
it work:

diff -uNr pine4.30.orig/pine/osdep/lstcmpnt pine4.30/pine/osdep/lstcmpnt
--- pine4.30.orig/pine/osdep/lstcmpnt	Mon Oct 30 17:34:40 2000
+++ pine4.30/pine/osdep/lstcmpnt	Mon Oct 30 17:34:36 2000
@@ -1,3 +1,4 @@
+
 /*----------------------------------------------------------------------
       Return pointer to last component of pathname.
 
@@ -9,8 +10,10 @@
 last_cmpnt(filename)
     char *filename;
 {
-    register char *p = NULL, *q = filename;
-
+    char *p = NULL, *q = filename;
+	
+    if(filename == 0)
+      return 0;
     while(q = strchr(q, '/'))
       if(*++q)
 	p = q;
diff -uNr pine4.30.orig/pine/pine.c pine4.30/pine/pine.c
--- pine4.30.orig/pine/pine.c	Mon Oct 30 17:30:27 2000
+++ pine4.30/pine/pine.c	Mon Oct 30 17:36:39 2000
@@ -316,6 +316,7 @@
     }
 #endif
 
+    init_pinerc(pine_state);
 #ifdef DEBUG
     /* Since this is specific debugging we don't mind if the
        ifdef is the type of system.
@@ -329,7 +330,6 @@
       mal_debug(ps_global->debug_malloc);
 #endif

 #ifdef	_WINDOWS

-- 
Trond Eivind Glomsrød
Red Hat, Inc.