Re: [PATCH 4/4] version.sh: Get detailed version info from git

2012-12-15 Thread Oswald Buddenhagen
On Fri, Dec 14, 2012 at 06:10:21PM -0600, David Champion wrote:
> [...] note that the ${a#b} and ${a%b} family of parameter expressions
> is nonportable.  These are commonly accepted bashisms [...]
> 
wrong.
http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
section 2.6.2

or to quote
http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Shell-Substitutions.html#Shell-Substitutions
"Posix requires support for these usages, but they do not work with many
traditional shells, e.g., Solaris 10 /bin/sh."

iow, throwing around "bashism" is just FUD.
if mutts wants to keep supporting utterly retarded systems from the last
millenium that's fine with me, but get your facts straight.


Re: [PATCH 4/4] version.sh: Get detailed version info from git

2012-12-15 Thread David Champion
* On 15 Dec 2012, Oswald Buddenhagen wrote: 
> On Fri, Dec 14, 2012 at 06:10:21PM -0600, David Champion wrote:
> > [...] note that the ${a#b} and ${a%b} family of parameter expressions
> > is nonportable.  These are commonly accepted bashisms [...]
> > 
> wrong.
> http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
> section 2.6.2
> 
> or to quote
> http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Shell-Substitutions.html#Shell-Substitutions
> "Posix requires support for these usages, but they do not work with many
> traditional shells, e.g., Solaris 10 /bin/sh."
> 
> iow, throwing around "bashism" is just FUD.
> if mutts wants to keep supporting utterly retarded systems from the last
> millenium that's fine with me, but get your facts straight.

Facts now straightened.  We do support "utterly retarded" systems.  Have
a better day tomorrow.

-- 
David Champion • d...@bikeshed.us


Re: [PATCH] Make imap_free_header_data type-safe

2012-12-15 Thread Michael Elkins

On Sun, Sep 09, 2012 at 08:00:38PM -0700, Andrew Gaul wrote:

# HG changeset patch
# User Andrew Gaul 
# Date 1347245686 25200
# Branch HEAD
# Node ID 4fa799cbf296ebd8fc7ce0eacb05807fcfa30c4d
# Parent  70810a88ce9feb66d5c74e7ec3f2a633bd8b5312
Make imap_free_header_data type-safe

Also push conditional into function for safety and consistency with
other free functions.


I've committed this, followed by another patch since it was 
generating compiler warnings when passing &ctx->data to 
imap_free_header_data()


Re: [PATCH 4/4] version.sh: Get detailed version info from git

2012-12-15 Thread David Laight
On Fri, Dec 14, 2012 at 07:59:13PM -0500, Aaron Schrab wrote:
> +
> + commit=`  echo $version|sed -e's/.*-//'`
> + version=` echo $version|sed -e's/-[^-]*$//'`
> +
> + distance=`echo $version|sed -e's/.*-//'`
> + version=` echo $version|sed -e's/-[^-]*$//'`
> +
> + version=` echo $version|sed -e's/^mutt-//' -e's/-rel$//' -e'y/-/./'`

You can probably achieve the required fied separation by setting IFS=-
and getting the shell to split the string.
Maybe something like (untested):
save_ifs="$IFS"
IFS=-
set -- x-$version
shift   # remove the 'x' added in case $version empty
IFS="$save_ifs"
# I think the script now wants the last two subfield removed,
# an inital "mutt-" removed and the '-' replaced with '.'
[ "$1" = mutt ] && shift
ver="$1"
while [ $# -gt 2 ]; do
[ "$1" != rel ] && ver="$ver.$1"
shift
done
distance="$1"
commit="$2"

Removing the last two fields is the tricky part!
The '-' could be replaced with '.' by just doing:
IFS=-
set -- $version
IFS=.
version="$*"

David

-- 
David Laight: da...@l8s.co.uk


Re: [PATCH] Guard against NULL dereference in mutt_parent_message

2012-12-15 Thread Michael Elkins

On Sun, Sep 23, 2012 at 10:29:57PM -0700, Andrew Gaul wrote:

# HG changeset patch
# User Andrew Gaul 
# Date 1348464567 25200
# Branch HEAD
# Node ID 3d3f1fb09ef6dcb52393e4d68b0a8d1e2242efea
# Parent  70810a88ce9feb66d5c74e7ec3f2a633bd8b5312
Guard against NULL dereference in mutt_parent_message

Seen when switching IMAP accounts:

Program terminated with signal 11, Segmentation fault.
#0  0x0048dbfa in mutt_parent_message (ctx=0x2cb9870, hdr=0x0)
   at thread.c:1087
1087  for (thread = hdr->thread->parent; thread; thread = thread->parent)

(gdb) bt
#0  0x0048dbfa in mutt_parent_message (ctx=0x2cb9870, hdr=0x0)
   at thread.c:1087
#1  0x004236a9 in resort_index (menu=0x271bed0) at curs_main.c:396
#2  0x0042384e in mutt_index_menu () at curs_main.c:456
#3  0x00449b13 in main (argc=1, argv=0x7fff68a4e528) at main.c:1020

(gdb) print hdr
$1 = (HEADER *) 0x0


This looks like a bug elsewhere, and I think this patch is just 
covering up the symptom.  There is a NULL pointer in Context->hdrs 
where there should not be, so something did not get cleaned up 
properly.  resort_index() is only called when we are in a 
non-empty mailbox.


Re: [Mutt] #3608: Character Š wrong in index and status on Mac OS X

2012-12-15 Thread Mutt
#3608: Character Š wrong in index and status on Mac OS X
+---
 Reporter:  kolcon  |   Owner:  me  
 Type:  defect  |  Status:  accepted
 Priority:  minor   |   Milestone:  1.6 
Component:  mutt| Version:  1.5.21  
 Keywords:  |  
+---
Changes (by me):

  * owner:  mutt-dev => me
  * status:  new => accepted
  * milestone:  => 1.6


Comment:

 It appears the problem is that the rfc822 parsing code is not unicode-
 aware.  In particular, the next_token() function using ISSPACE, and what
 is likely happening is that the second byte of the Š character is being
 stripped, which causes mutt_paddstr() to substitute the replacement char �
 when mbrtowc() fails.

 Since non-ascii characters are not permitted to appear in header fields,
 this is normally not a problem (and if it is, we blame the sender's broken
 software for not rfc2047-encoding it).

 However, in this case, the user's muttrc has an alias with utf-8.  And
 this is probably similar to the situation in #2956 when the user edits the
 message header, because we are not cruel enough to let the user directly
 edit the RFC2047 encoding.

 More thought is required here.

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3608: Character Š wrong in index and status on Mac OS X

2012-12-15 Thread Mutt
#3608: Character Š wrong in index and status on Mac OS X
+---
 Reporter:  kolcon  |   Owner:  me  
 Type:  defect  |  Status:  accepted
 Priority:  minor   |   Milestone:  1.6 
Component:  mutt| Version:  1.5.21  
 Keywords:  |  
+---

Comment(by me):

 Rereading RFC5322, white space (WSP) is defined as only ASCII SPACE and
 HTAB, so the rfc822 parser should really not be using isspace() at all in
 that situation.  This is probably the correct solution, as it will avoid
 the need to use mbtowc().

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent