tFixing id handling in argv. - rohrpost - A commandline mail client to change the world as we see it.
 (HTM) git clone git://r-36.net/rohrpost
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 5c6b6847a6138bbf2c8f814313998f41a5bf19a0
 (DIR) parent 94590694e3e634ce005ef07b897795c0c029b815
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Mon, 13 Feb 2012 08:41:54 +0100
       
       Fixing id handling in argv.
       
       Diffstat:
         bin/rpdownload                      |       2 +-
         bin/rppodplay                       |       2 +-
         imap.c                              |      17 ++++++++++++++---
       
       3 files changed, 16 insertions(+), 5 deletions(-)
       ---
 (DIR) diff --git a/bin/rpdownload b/bin/rpdownload
       t@@ -20,7 +20,7 @@ fi
        
        msgid="$*"
        
       -url=`rpview $msgid | awk '/URL:/ {print $2}' | tr -d '\r'`
       +url=`rpview -- $msgid | awk '/URL:/ {print $2}' | tr -d '\r'`
        cd $DOWNLOADDIR
        for i in $url
        do
 (DIR) diff --git a/bin/rppodplay b/bin/rppodplay
       t@@ -46,7 +46,7 @@ fi
        
        msgid="$*"
        
       -url=`rpview $msgid | awk '/Enclosure:/ {print $2}' | tr -d '\r'`
       +url=`rpview -- $msgid | awk '/Enclosure:/ {print $2}' | tr -d '\r'`
        for i in $url
        do
                echo $i
 (DIR) diff --git a/imap.c b/imap.c
       t@@ -220,11 +220,22 @@ imap_str2ids(char *mailbox, char *str)
        llist_t *
        imap_argv2ids(char *mailbox, int argc, char *argv[])
        {
       -        llist_t *llist, *ids;
       +        llist_t *allist, *llist, *ids, *nids;
       +        llistelem_t *argelem;
        
       -        llist = llist_splitargv(argc, argv);
       -        if (llist == NULL)
       +        allist = llist_splitargv(argc, argv);
       +        if (allist == NULL)
                        return NULL;
       +
       +        llist = llist_new();
       +        forllist(allist, argelem) {
       +                nids = llist_splitstr(argelem->key, " ,");
       +                if (nids != NULL)
       +                        llist_listadd(llist, nids);
       +                llist_free(nids);
       +        }
       +        llist_free(allist);
       +
                ids = imap_llist2ids(mailbox, llist);
                llist_free(llist);