[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] Patch für mutt 1.2.3.4



From: Alexander Hartmut Kluth <alexanderkluth@xxxxxx>

+ lbuilds: Patch für mutt, baut erfolgreich, mutt -h geht auch ;-)

Signed-off-by: Alexander Hartmut Kluth <hartmut@xxxxxxxxxx>
---
 .../mutt/1.4.2.3/files/mutt_1.4.3.2_tyndur.patch   |  619 ++++++++++++++++++++
 1 files changed, 619 insertions(+), 0 deletions(-)
 create mode 100644 lbuilds/mutt/1.4.2.3/files/mutt_1.4.3.2_tyndur.patch

diff --git a/lbuilds/mutt/1.4.2.3/files/mutt_1.4.3.2_tyndur.patch b/lbuilds/mutt/1.4.2.3/files/mutt_1.4.3.2_tyndur.patch
new file mode 100644
index 0000000..d512153
--- /dev/null
+++ b/lbuilds/mutt/1.4.2.3/files/mutt_1.4.3.2_tyndur.patch
@@ -0,0 +1,619 @@
+Index: mutt-1.4.2.3/sendlib.c
+===================================================================
+--- mutt-1.4.2.3.orig/sendlib.c	2007-05-23 03:17:54.000000000 +0200
++++ mutt-1.4.2.3/sendlib.c	2009-08-24 09:03:54.000000000 +0200
+@@ -55,6 +55,11 @@
+ #include <assert.h>
+ #endif
+ 
++void execv(const char*, const char*);
++void setsid(void);
++
++#define SIGTSTP 1
++
+ extern char RFC822Specials[];
+ 
+ static struct sysexits
+@@ -1775,6 +1780,7 @@
+   sigset_t set;
+   int fd, st;
+   pid_t pid, ppid;
++  char *syscmd;
+ 
+   mutt_block_signals_system ();
+ 
+@@ -1801,7 +1807,8 @@
+     /* we want the delivery to continue even after the main process dies,
+      * so we put ourselves into another session right away
+      */
+-    setsid ();
++    // No, we don't want to create a new session in tyndur (yet)
++    //setsid ();
+   
+     /* next we close all open files */
+ #if defined(OPEN_MAX)
+@@ -1844,7 +1851,12 @@
+ 	  _exit (S_ERR);
+       }
+ 
+-      execv (path, args);
++      syscmd = malloc(256);
++
++      strcpy(syscmd, path);
++      strcat(syscmd, args);
++
++      system(syscmd);
+       _exit (S_ERR);
+     }
+     else if (pid == -1)
+Index: mutt-1.4.2.3/resize.c
+===================================================================
+--- mutt-1.4.2.3.orig/resize.c	2007-05-23 03:17:54.000000000 +0200
++++ mutt-1.4.2.3/resize.c	2009-08-24 09:03:54.000000000 +0200
+@@ -32,6 +32,11 @@
+ # endif
+ #endif
+ 
++struct winsize
++{
++    int ws_row, ws_col;
++};
++
+ /* this routine should be called after receiving SIGWINCH */
+ void mutt_resize_screen (void)
+ {
+@@ -46,12 +51,12 @@
+   SLtt_Screen_Cols = -1;
+   if ((fd = open ("/dev/tty", O_RDONLY)) != -1)
+   {
+-    if (ioctl (fd, TIOCGWINSZ, &w) != -1)
++    /*if (ioctl (fd, TIOCGWINSZ, &w) != -1)
+     {
+       SLtt_Screen_Rows = w.ws_row;
+       SLtt_Screen_Cols = w.ws_col;
+     }
+-    close (fd);
++    close (fd);*/
+   }
+   if (SLtt_Screen_Rows <= 0)
+   {
+Index: mutt-1.4.2.3/mutt_tunnel.c
+===================================================================
+--- mutt-1.4.2.3.orig/mutt_tunnel.c	2007-05-23 03:17:53.000000000 +0200
++++ mutt-1.4.2.3/mutt_tunnel.c	2009-08-24 09:03:54.000000000 +0200
+@@ -27,6 +27,8 @@
+ #include <sys/wait.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <stdlib.h>
++#include <string.h>
+ 
+ /* -- data types -- */
+ typedef struct
+@@ -89,9 +91,14 @@
+     close (STDERR_FILENO);
+ 
+     /* Don't let the subprocess think it can use the controlling tty */
+-    setsid ();
++    //setsid ();
+ 
+-    execl (EXECSHELL, "sh", "-c", Tunnel, NULL);
++    char *sysstr;
++
++    strcpy(sysstr, "sh -c");
++    strncpy(sysstr, Tunnel, 255);
++
++    system(sysstr);
+     _exit (127);
+   }
+   mutt_unblock_signals_system (1);
+@@ -108,8 +115,11 @@
+   if (close (pin[1]) < 0 || close (pout[0]) < 0)
+     mutt_perror ("close");
+ 
+-  fcntl (pin[0], F_SETFD, FD_CLOEXEC);
+-  fcntl (pout[1], F_SETFD, FD_CLOEXEC);
++ // fcntl (pin[0], F_SETFD, FD_CLOEXEC);
++ // fcntl (pout[1], F_SETFD, FD_CLOEXEC);
++ fclose(pin[0]);
++ fclose(pout[1]);
++
+ 
+   tunnel->readfd = pin[0];
+   tunnel->writefd = pout[1];
+Index: mutt-1.4.2.3/regex.c
+===================================================================
+--- mutt-1.4.2.3.orig/regex.c	2007-05-23 03:17:54.000000000 +0200
++++ mutt-1.4.2.3/regex.c	2009-08-24 09:03:54.000000000 +0200
+@@ -34,6 +34,8 @@
+  * 	                             tlr, 1999-02-25
+  */
+ 
++#include <wchar.h>
++#include <wctype.h>
+ /* The following doesn't mix too well with autoconfiguring
+  * the use of alloca.  So let's disable it for AIX.
+  */
+@@ -2211,7 +2213,9 @@
+ #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
+                         boolean is_lower = STREQ (str, "lower");
+                         boolean is_upper = STREQ (str, "upper");
+-			wctype_t wt;
++
++    
++			wchar_t wt;
+                         int ch;
+ 
+ 			wt = wctype (str);
+Index: mutt-1.4.2.3/mbox.c
+===================================================================
+--- mutt-1.4.2.3.orig/mbox.c	2007-05-23 03:17:53.000000000 +0200
++++ mutt-1.4.2.3/mbox.c	2009-08-24 09:03:54.000000000 +0200
+@@ -937,7 +937,7 @@
+     if (i == 0)
+     {
+       ctx->size = ftell (ctx->fp); /* update the size of the mailbox */
+-      ftruncate (fileno (ctx->fp), ctx->size);
++      //ftruncate (fileno (ctx->fp), ctx->size);
+     }
+   }
+ 
+Index: mutt-1.4.2.3/filter.c
+===================================================================
+--- mutt-1.4.2.3.orig/filter.c	2007-05-23 03:17:53.000000000 +0200
++++ mutt-1.4.2.3/filter.c	2009-08-24 09:03:54.000000000 +0200
+@@ -30,6 +30,7 @@
+ 		       int fdin, int fdout, int fderr)
+ {
+   int pin[2], pout[2], perr[2], thepid;
++  char *syscmd;
+ 
+   if (in)
+   {
+@@ -113,7 +114,12 @@
+       close (fderr);
+     }
+ 
+-    execl (EXECSHELL, "sh", "-c", cmd, NULL);
++    syscmd = malloc(255);
++
++    strcpy(syscmd, "sh -c");
++    strcat(syscmd, cmd);
++
++    system(syscmd);
+     _exit (127);
+   }
+   else if (thepid == -1)
+Index: mutt-1.4.2.3/system.c
+===================================================================
+--- mutt-1.4.2.3.orig/system.c	2007-05-23 03:17:54.000000000 +0200
++++ mutt-1.4.2.3/system.c	2009-08-24 09:03:54.000000000 +0200
+@@ -30,6 +30,7 @@
+ 
+ int _mutt_system (const char *cmd, int flags)
+ {
++  char *syscmd;
+   int rc = -1;
+   struct sigaction act;
+   struct sigaction oldtstp;
+@@ -72,7 +73,7 @@
+       int fd;
+ 
+       /* give up controlling terminal */
+-      setsid ();
++      //setsid ();
+ 
+       switch (fork ())
+       {
+@@ -110,8 +111,13 @@
+     sigaction (SIGTSTP, &act, NULL);
+     sigaction (SIGCONT, &act, NULL);
+ 
+-    execl (EXECSHELL, "sh", "-c", cmd, NULL);
+-    _exit (127); /* execl error */
++    syscmd = malloc(256);
++    
++    strcpy(syscmd, "sh -c");
++    strcat(syscmd, cmd);
++
++    system(syscmd);
++    //_exit (127); /* execl error */
+   }
+   else if (thepid != -1)
+   {
+Index: mutt-1.4.2.3/mx.c
+===================================================================
+--- mutt-1.4.2.3.orig/mx.c	2007-05-23 03:17:53.000000000 +0200
++++ mutt-1.4.2.3/mx.c	2009-08-24 09:03:54.000000000 +0200
+@@ -1491,7 +1491,7 @@
+   }
+   
+   if (r == 0 && (ctx->magic == M_MBOX || ctx->magic == M_MMDF || ctx->magic == M_KENDRA)
+-      && (fflush (msg->fp) == EOF || fsync (fileno (msg->fp)) == -1))
++      && (fflush (msg->fp) == EOF))
+   {
+     mutt_perror _("Can't write message");
+     r = -1;
+Index: mutt-1.4.2.3/mbyte.c
+===================================================================
+--- mutt-1.4.2.3.orig/mbyte.c	2007-05-23 03:17:53.000000000 +0200
++++ mutt-1.4.2.3/mbyte.c	2009-08-24 09:03:54.000000000 +0200
+@@ -76,7 +76,7 @@
+ #endif
+ }
+ 
+-#ifndef HAVE_WC_FUNCS
++#ifdef HAVE_WC_FUNCS
+ 
+ /*
+  * For systems that don't have them, we provide here our own
+Index: mutt-1.4.2.3/main.c
+===================================================================
+--- mutt-1.4.2.3.orig/main.c	2007-05-23 03:17:53.000000000 +0200
++++ mutt-1.4.2.3/main.c	2009-08-24 09:03:54.000000000 +0200
+@@ -441,6 +441,7 @@
+ 
+ int main (int argc, char **argv)
+ {
++
+   char folder[_POSIX_PATH_MAX] = "";
+   char *subject = NULL;
+   char *includeFile = NULL;
+@@ -466,6 +467,7 @@
+     exit(1);
+   }
+ 
++
+ #ifdef ENABLE_NLS
+   /* FIXME what about init.c:1439 ? */
+   setlocale (LC_ALL, "");
+@@ -480,12 +482,16 @@
+   SRAND (time (NULL));
+   umask (077);
+ 
++
+   memset (Options, 0, sizeof (Options));
+   memset (QuadOptions, 0, sizeof (QuadOptions));
+-  
++
++
+   while ((i = getopt (argc, argv, "a:b:F:f:c:d:e:H:s:i:hm:npRvxyzZ")) != EOF)
+     switch (i)
+     {
++
++
+       case 'a':
+ 	attach = mutt_add_list (attach, optarg);
+ 	break;
+@@ -577,6 +583,7 @@
+ 	mutt_usage ();
+     }
+ 
++
+   switch (version)
+   {
+     case 0:
+@@ -591,6 +598,7 @@
+       exit (0);
+   }
+ 
++
+   /* Check for a batch send. */
+   if (!isatty (0))
+   {
+@@ -598,18 +606,22 @@
+     sendflags = SENDBATCH;
+   }
+ 
++
+   /* This must come before mutt_init() because curses needs to be started
+      before calling the init_pair() function to set the color scheme.  */
+   if (!option (OPTNOCURSES))
+     start_curses ();
+ 
++
+   /* set defaults and read init files */
+   mutt_init (flags & M_NOSYSRC, commands);
+   mutt_free_list (&commands);
+ 
++
+   if (newMagic)
+     mx_set_magic (newMagic);
+ 
++
+   if (!option (OPTNOCURSES))
+   {
+     SETCOLOR (MT_COLOR_NORMAL);
+@@ -618,6 +630,7 @@
+     mutt_message = mutt_curses_message;
+   }
+ 
++
+   /* Create the Maildir directory if it doesn't exist. */
+   if (!option (OPTNOCURSES) && Maildir)
+   {
+@@ -642,6 +655,7 @@
+     }
+   }
+ 
++
+   if (sendflags & SENDPOSTPONED)
+   {
+     if (!option (OPTNOCURSES))
+@@ -649,9 +663,11 @@
+     ci_send_message (SENDPOSTPONED, NULL, NULL, NULL, NULL);
+     mutt_endwin (NULL);
+   }
++
+   else if (subject || msg || sendflags || draftFile || includeFile || attach ||
+ 	   optind < argc)
+   {
++
+     FILE *fin = NULL;
+     char buf[LONG_STRING];
+     char *tempfile = NULL, *infile = NULL;
+@@ -660,16 +676,23 @@
+     if (!option (OPTNOCURSES))
+       mutt_flushinp ();
+ 
++
++
+     if (!msg)
+       msg = mutt_new_header ();
+ 
++
+     if (draftFile)
+       infile = draftFile;
+     else
+     {
++
++
+       if (!msg->env)
+ 	msg->env = mutt_new_envelope ();
+ 
++
++
+       for (i = optind; i < argc; i++)
+       {
+ 	if (url_check_scheme (argv[i]) == U_MAILTO)
+@@ -678,25 +701,36 @@
+ 	  msg->env->to = rfc822_parse_adrlist (msg->env->to, argv[i]);
+       }
+ 
++
++
+       if (option (OPTAUTOEDIT) && !msg->env->to && !msg->env->cc)
+       {
++
++
+ 	if (!option (OPTNOCURSES))
+ 	  mutt_endwin (NULL);
+ 	fputs (_("No recipients specified.\n"), stderr);
+ 	exit (1);
+       }
+ 
++
++
+       if (subject)
+ 	msg->env->subject = safe_strdup (subject);
+ 
++
++
+       if (includeFile)
+ 	infile = includeFile;
+     }
+ 
+     if (infile || bodytext)
+     {
++
++
+       if (infile)
+       {
++
+ 	if (mutt_strcmp ("-", infile) == 0)
+ 	  fin = stdin;
+ 	else 
+@@ -709,24 +743,34 @@
+ 	  {
+ 	    if (!option (OPTNOCURSES))
+ 	      mutt_endwin (NULL);
+-	    perror (path);
++	    
++
++        
++        perror (path);
++
+ 	    exit (1);
+ 	  }
+ 	}
++
++
+       }
+       else
+ 	fin = NULL;
+ 
++
+       mutt_mktemp (buf);
+       tempfile = safe_strdup (buf);
+ 
++
++
+       if (draftFile)
+ 	msg->env = mutt_read_rfc822_header (fin, NULL, 1, 0);
+ 
+       /* is the following if still needed? */
+-      
++
+       if (tempfile)
+       {
++
+ 	FILE *fout;
+ 
+ 	if ((fout = safe_fopen (tempfile, "w")) == NULL)
+@@ -735,9 +779,15 @@
+ 	    mutt_endwin (NULL);
+ 	  perror (tempfile);
+ 	  fclose (fin);
++
+ 	  FREE (&tempfile);
+ 	  exit (1);
++
++   
+ 	}
++
++
++
+ 	if (fin)
+ 	  mutt_copy_stream (fin, fout);
+ 	else if (bodytext)
+@@ -748,10 +798,14 @@
+       }
+     }
+ 
++
+     safe_free ((void **) &bodytext);
+     
++
+     if (attach)
+     {
++
++
+       LIST *t = attach;
+       BODY *a = NULL;
+ 
+@@ -759,15 +813,25 @@
+       {
+ 	if (a)
+ 	{
++        
+ 	  a->next = mutt_make_file_attach (t->data);
++      
+ 	  a = a->next;
++
++
+ 	}
+ 	else
+ 	  msg->content = a = mutt_make_file_attach (t->data);
+-	if (!a)
++
++
++if (!a)
+ 	{
++
++
+ 	  if (!option (OPTNOCURSES))
+ 	    mutt_endwin (NULL);
++
++        
+ 	  fprintf (stderr, _("%s: unable to attach file.\n"), t->data);
+ 	  mutt_free_list (&attach);
+ 	  exit (1);
+@@ -777,15 +841,22 @@
+       mutt_free_list (&attach);
+     }
+ 
++
++
+     ci_send_message (sendflags, msg, tempfile, NULL, NULL);
+ 
++
++
+     if (!option (OPTNOCURSES))
+       mutt_endwin (NULL);
+   }
+   else
+   {
++
++
+     if (flags & M_BUFFY)
+     {
++     
+       if (!mutt_buffy_check (0))
+       {
+ 	mutt_endwin _("No mailbox with new mail.");
+@@ -793,17 +864,24 @@
+       }
+       folder[0] = 0;
+       mutt_buffy (folder, sizeof (folder));
++     
+     }
+     else if (flags & M_SELECT)
+     {
++
++       
+       if (!Incoming) {
+ 	mutt_endwin _("No incoming mailboxes defined.");
+ 	exit (1);
+       }
+       folder[0] = 0;
++
+       mutt_select_file (folder, sizeof (folder), M_SEL_FOLDER | M_SEL_BUFFY);
++      
++    
+       if (!folder[0])
+       {
++          
+ 	mutt_endwin (NULL);
+ 	exit (0);
+       }
+@@ -822,12 +900,14 @@
+       /* check to see if there are any messages in the folder */
+       if (stat (folder, &st) != 0)
+       {
++
+ 	mutt_endwin (strerror (errno));
+ 	exit (1);
+       }
+ 
+       if (st.st_size == 0)
+       {
++          printf("Spack?\n");
+ 	mutt_endwin _("Mailbox is empty.");
+ 	exit (1);
+       }
+@@ -835,6 +915,7 @@
+ 
+     mutt_folder_hook (folder);
+ 
++
+     if((Context = mx_open_mailbox (folder, ((flags & M_RO) || option (OPTREADONLY)) ? M_READONLY : 0, NULL))
+        || !explicit_folder)
+     {
+@@ -842,6 +923,7 @@
+       if (Context)
+ 	safe_free ((void **)&Context);
+     }
++
+     mutt_endwin (Errorbuf);
+   }
+ 
+Index: mutt-1.4.2.3/send.c
+===================================================================
+--- mutt-1.4.2.3.orig/send.c	2007-05-23 03:17:54.000000000 +0200
++++ mutt-1.4.2.3/send.c	2009-08-24 09:03:54.000000000 +0200
+@@ -1144,17 +1144,17 @@
+     if (option (OPTTEXTFLOWED))
+       mutt_set_parameter ("format", "flowed", &msg->content->parameter);
+     
+-    if (!tempfile)
+-    {
++   // if (!tempfile)
++   // {
+       mutt_mktemp (buffer);
+       tempfp = safe_fopen (buffer, "w+");
+       msg->content->filename = safe_strdup (buffer);
+-    }
+-    else
+-    {
+-      tempfp = safe_fopen (tempfile, "a+");
+-      msg->content->filename = safe_strdup (tempfile);
+-    }
++   // }
++   // else
++   // {
++    //  tempfp = safe_fopen (tempfile, "a+");
++     // msg->content->filename = safe_strdup (tempfile);
++   // }
+ 
+     if (!tempfp)
+     {
-- 
1.6.0.4