From d789a128e8290285eeefd6c4e08585bae55bc20f Mon Sep 17 00:00:00 2001 From: "mauro.giachero" Date: Thu, 21 May 2009 16:34:59 +0000 Subject: [PATCH] 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 --- src/usr/sbin/sbopkg | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 3039b64..d953c40 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -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