]> git.pld-linux.org Git - packages/mutt.git/blob - mutt-vvv.quote.patch
- CVE references for 1.5.15
[packages/mutt.git] / mutt-vvv.quote.patch
1 diff -udprP mutt-1.5.9.orig/PATCHES mutt-1.5.9/PATCHES
2 --- mutt-1.5.9.orig/PATCHES     2005-03-13 18:33:06.000000000 +0200
3 +++ mutt-1.5.9/PATCHES  2005-03-13 19:42:58.018681272 +0200
4 @@ -0,0 +1 @@
5 +vvv.quote
6 diff -udprP mutt-1.5.9.orig/globals.h mutt-1.5.9/globals.h
7 --- mutt-1.5.9.orig/globals.h   2005-02-12 22:01:02.000000000 +0200
8 +++ mutt-1.5.9/globals.h        2005-03-13 19:42:58.019681120 +0200
9 @@ -24,6 +24,8 @@ WHERE CONTEXT *Context;
10  WHERE char Errorbuf[STRING];
11  WHERE char AttachmentMarker[STRING];
12  
13 +WHERE char Quotebuf[SHORT_STRING];
14 +
15  #if defined(DL_STANDALONE) && defined(USE_DOTLOCK)
16  WHERE char *MuttDotlock;
17  #endif
18 diff -udprP mutt-1.5.9.orig/handler.c mutt-1.5.9/handler.c
19 --- mutt-1.5.9.orig/handler.c   2005-02-03 20:47:52.000000000 +0200
20 +++ mutt-1.5.9/handler.c        2005-03-13 19:42:58.020680968 +0200
21 @@ -91,6 +91,8 @@ void mutt_convert_to_state(iconv_t cd, c
22        if (ob != bufo)
23         state_prefix_put (bufo, ob - bufo, s);
24      }
25 +    if (Quotebuf[0] != '\0')
26 +      state_prefix_putc ('\n', s);
27      return;
28    }
29  
30 @@ -1725,6 +1727,8 @@ void mutt_decode_attachment (BODY *b, ST
31    int istext = mutt_is_text_part (b);
32    iconv_t cd = (iconv_t)(-1);
33  
34 +  Quotebuf[0] = '\0';
35 +
36    if (istext && s->flags & M_CHARCONV)
37    {
38      char *charset = mutt_get_parameter ("charset", b->parameter);
39 diff -udprP mutt-1.5.9.orig/init.h mutt-1.5.9/init.h
40 --- mutt-1.5.9.orig/init.h      2005-03-01 17:56:02.000000000 +0200
41 +++ mutt-1.5.9/init.h   2005-03-13 19:42:58.023680512 +0200
42 @@ -2124,6 +2124,19 @@ struct option_t MuttVars[] = {
43    ** have no effect, and if it is set to ask-yes or ask-no, you are
44    ** prompted for confirmation when you try to quit.
45    */
46 +  { "quote_empty",     DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
47 +  /*
48 +  ** .pp
49 +  ** Controls whether or not empty lines will be quoted using
50 +  ** ``$indent_string''.
51 +  */
52 +  { "quote_quoted",    DT_BOOL, R_NONE, OPTQUOTEQUOTED, 0 },
53 +  /*
54 +  ** .pp
55 +  ** Controls how quoted lines will be quoted. If set, one quote
56 +  ** character will be added to the end of existing prefix.  Otherwise,
57 +  ** quoted lines will be prepended by ``$indent_string''.
58 +  */
59    { "quote_regexp",    DT_RX,   R_PAGER, UL &QuoteRegexp, UL "^([ \t]*[|>:}#])+" },
60    /*
61    ** .pp
62 diff -udprP mutt-1.5.9.orig/mutt.h mutt-1.5.9/mutt.h
63 --- mutt-1.5.9.orig/mutt.h      2005-02-28 17:13:57.000000000 +0200
64 +++ mutt-1.5.9/mutt.h   2005-03-13 19:42:58.024680360 +0200
65 @@ -404,6 +404,8 @@ enum
66    OPTPRINTDECODE,
67    OPTPRINTSPLIT,
68    OPTPROMPTAFTER,
69 +  OPTQUOTEEMPTY,
70 +  OPTQUOTEQUOTED,
71    OPTREADONLY,
72    OPTREPLYSELF,
73    OPTRESOLVE,
74 diff -udprP mutt-1.5.9.orig/muttlib.c mutt-1.5.9/muttlib.c
75 --- mutt-1.5.9.orig/muttlib.c   2005-02-12 21:30:16.000000000 +0200
76 +++ mutt-1.5.9/muttlib.c        2005-03-13 19:42:58.026680056 +0200
77 @@ -1254,15 +1254,45 @@ void state_prefix_putc (char c, STATE *s
78  {
79    if (s->flags & M_PENDINGPREFIX)
80    {
81 -    state_reset_prefix (s);
82 -    if (s->prefix)
83 -      state_puts (s->prefix, s);
84 -  }
85 +    int i;
86  
87 -  state_putc (c, s);
88 +    i = strlen (Quotebuf);
89 +    Quotebuf[i++] = c;
90 +    Quotebuf[i] = '\0';
91 +    if (i == sizeof (Quotebuf) - 1 || c == '\n')
92 +    {
93 +      char buf[2 * SHORT_STRING];
94 +      int j = 0, offset = 0;
95 +      regmatch_t pmatch[1];
96 +
97 +      state_reset_prefix (s);
98 +      while (regexec ((regex_t *) QuoteRegexp.rx, &Quotebuf[offset], 1, pmatch, 0) == 0)
99 +       offset += pmatch->rm_eo;
100 +
101 +      if (!option (OPTQUOTEEMPTY) && Quotebuf[0] == '\n')
102 +       strcpy (buf, Quotebuf);
103 +      else if (option (OPTQUOTEQUOTED) && offset)
104 +      {
105 +       for (i = 0; i < offset; i++)
106 +         if (Quotebuf[i] != ' ')
107 +           j = i;
108 +       strncpy (buf, Quotebuf, j + 1);
109 +       strcpy (buf + j + 1, Quotebuf + j);
110 +      }
111 +      else
112 +       snprintf (buf, sizeof (buf), "%s%s", NONULL(s->prefix), Quotebuf);
113 +
114 +      state_puts (buf, s);
115 +    }
116 +  }
117 +  else
118 +    state_putc (c, s);
119  
120    if (c == '\n')
121 +  {
122      state_set_prefix (s);
123 +    Quotebuf[0] = '\0';
124 +  }
125  }
126  
127  int state_printf (STATE *s, const char *fmt, ...)
This page took 0.063475 seconds and 3 git commands to generate.