dmc

dynamic mail client
git clone git://git.suckless.org/dmc
Log | Files | Refs | README | LICENSE

commit 14138b3923ba0d41913d7331e9adc51040df063e
parent e5cf9f79e1e5a31dcfcfd310160fb0f05ced9bda
Author: pancake@flubox <unknown>
Date:   Mon,  2 Nov 2009 11:44:43 +0100

* Use POSIX function definition instead of the
  bash one in all shellscripts
* Fix a warning in pack.c
Diffstat:
dmc | 18+++++++++---------
dmc-mdir | 2+-
dmc-tag | 4++--
pack.c | 2+-
4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/dmc b/dmc @@ -12,7 +12,7 @@ mkdir -p ~/.dmc/tmp mkdir -p ~/.dmc/acc [ -e ~/.dmc/acc.default ] && . ~/.dmc/acc.default -function acc_daemon { +acc_daemon () { LOCK=~/.dmc/tmp/${NAME}.lock INPUT=~/.dmc/tmp/${NAME}.input OUTPUT=~/.dmc/tmp/${NAME}.output @@ -28,13 +28,13 @@ function acc_daemon { rm -f "${LOCK}" "${INPUT}" "${OUTPUT}" } -function dmc_cmd { +dmc_cmd () { echo "$@" > ~/.dmc/tmp/${NAME}.input head -n 1 ~/.dmc/tmp/${NAME}.lock > /dev/stderr cat ~/.dmc/tmp/${NAME}.output } -function start_account_daemons { +start_account_daemons () { i=0 for a in ~/.dmc/acc/* ; do ( . $a ; acc_daemon ) & @@ -47,7 +47,7 @@ function start_account_daemons { fi } -function print_account_template { +print_account_template () { echo "NAME='test'" echo "SSL=0" echo "LIMIT=50 # get only 50 mails for each folder" @@ -61,7 +61,7 @@ function print_account_template { echo "PASS='password'" } -function edit_message { +edit_message () { OUTDIR=~/.dmc/box/${NAME}/out mkdir -p ${OUTDIR} OUT="`mktemp ${OUTDIR}/mail.XXXXXX`" @@ -89,7 +89,7 @@ function edit_message { fi } -function add_attachment { +add_attachment () { OUT="`readlink ~/.dmc/mail.last`" if [ -z "${OUT}" ]; then echo "No ~/.dmc/mail.last found. 'dmc -m' or manual symlink required." @@ -104,7 +104,7 @@ function add_attachment { fi } -function send_message { +send_message () { FILE=$1 if [ ! -e "${FILE}" ]; then echo "Cannot find '${FILE}'" @@ -128,7 +128,7 @@ function send_message { return 0 } -function pull_mails { +pull_mails () { echo "Pulling mails from account '${NAME}'" # This is pop3-only i=1 @@ -147,7 +147,7 @@ function pull_mails { done } -function ign { : ; } +ign () { : ; } case "$1" in "start") diff --git a/dmc-mdir b/dmc-mdir @@ -9,7 +9,7 @@ if [ -z "${MD}" ]; then exit 1 fi -function mdir_ls { +mdir_ls () { echo "cur $(ls $1/cur | wc -l)" > /dev/stderr echo "new $(ls $1/new | wc -l)" > /dev/stderr echo "tmp $(ls $1/tmp | wc -l)" > /dev/stderr diff --git a/dmc-tag b/dmc-tag @@ -14,7 +14,7 @@ if [ ! -d "${DMCTAG_ROOT}" ]; then fi cd ${DMCTAG_ROOT} -function set_file { +set_file () { FILE=$1 if [ -e "${OLDPWD}/${FILE}" ]; then if [ ! "`echo ${FILE} | cut -c 1`" = / ]; then @@ -30,7 +30,7 @@ function set_file { # untag this file . this is highly suboptimal. in C will be much faster # XXX: Only used with $FILE.. set_file is required -function untag { +untag () { for TAG in `$0 -l` ; do grep -v $1 $TAG > $TAG.tmp mv $TAG.tmp $TAG diff --git a/pack.c b/pack.c @@ -69,7 +69,7 @@ void mime_pack(char **files, int nfiles) { memset(bd,'\0',1024); for(in=out=0;in<len;in+=3,out+=4) b64_encode((unsigned char*)b+in,bd+out,len-in>3?3:len-in); - puts (bd); + puts ((char *)bd); } } fclose (fd);