commit 5c6b6847a6138bbf2c8f814313998f41a5bf19a0
parent 94590694e3e634ce005ef07b897795c0c029b815
Author: Christoph Lohmann <20h@r-36.net>
Date: Mon, 13 Feb 2012 08:41:54 +0100
Fixing id handling in argv.
Diffstat:
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/bin/rpdownload b/bin/rpdownload
@@ -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
diff --git a/bin/rppodplay b/bin/rppodplay
@@ -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
diff --git a/imap.c b/imap.c
@@ -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);