From: Leandro Lucarella Date: Sun, 7 May 2006 20:35:11 +0000 (+0000) Subject: Bugfix: add a starting 1 to channel calculation. X-Git-Tag: darcs_import~2 X-Git-Url: https://git.llucax.com/software/wpe.git/commitdiff_plain/01de99d3ab3170ab6323a6c5ef29081d85e35e62?hp=17971e5fbd22725d9cc9ba889ff49fd1b8ee9de1 Bugfix: add a starting 1 to channel calculation. When the base number to calculate the channel started with 0, the number was interpreted as octal and if there any digit bigger than 7 it got a syntax error. This patch adds a digit 1 to the begining of the base channel number to avoid the octal interpretation. --- diff --git a/rotate-key b/rotate-key index e834ae8..14e20f1 100644 --- a/rotate-key +++ b/rotate-key @@ -59,7 +59,7 @@ key=`echo "$str" | $HASH_PROG | cut -c-$size` # Compute the new channel if [ -n "$ROTATE_CHANNEL" ] then - chan=`echo $key | tr abcdef 847502 | cut -c-6` + chan=1`echo $key | tr abcdef 847502 | cut -c-6` chan=$(($chan % $MAX_CHANNEL + 1)) channel="channel $chan" fi