Invert can_skip_line() return value logic.

Code reading suggests that if "can_skip_line $FOO" is true,
the line can be skipped. Unfortunately, the code acts
backwards (if the function returns 0, the line _can't_ be
skipped).
Invert the function return logic so to make the code less
confusing.

Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This commit is contained in:
mauro.giachero 2009-05-21 16:34:59 +00:00
parent b43772cb7a
commit d789a128e8

View file

@ -1329,12 +1329,12 @@ can_skip_line() {
echo $1 | grep "^#" > /dev/null
if [[ $? == 0 ]]; then
return 1
return 0
fi
if [[ "$1" == "" ]]; then
return 1
return 0
fi
return 0
return 1
}
load_user_queue() {
@ -1355,8 +1355,7 @@ load_user_queue() {
touch $USERQUEUE_LOCK
# Reading from $FILE...
while read PICK; do
can_skip_line $PICK
if [[ $? == 1 ]]; then
if can_skip_line $PICK; then
continue
fi
add_item_to_queue $PICK