func.sh: Fix a potential infinite loop in mendel_readsym_target

This commit is contained in:
Ben Jackson 2011-03-05 22:12:50 -08:00 committed by Michael Moon
parent 7198021f4a
commit da2a9c3d56
1 changed files with 1 additions and 1 deletions

View File

@ -283,7 +283,7 @@ mendel_readsym_target() {
local val=$(mendel_readsym "$sym") local val=$(mendel_readsym "$sym")
if [ -n "$val" ] if [ -n "$val" ]
then then
perl -e '@a = qw/X Y Z E F/; $c = 0; while (length $ARGV[0]) { $ARGV[0] =~ s#^(..)(..)(..)(..)##; printf "%s: %d\n", $a[$c], hex "0x$4$3$2$1"; $c++; }' "$val" perl -e '@a = qw/X Y Z E F/; $c = 0; while (length $ARGV[0]) { last unless $ARGV[0] =~ s#^(..)(..)(..)(..)##; printf "%s: %d\n", $a[$c], hex "0x$4$3$2$1"; $c++; }' "$val"
fi fi
} }