mirror of
https://github.com/sbopkg/sbopkg
synced 2024-12-28 09:58:58 +01:00
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:
parent
b43772cb7a
commit
d789a128e8
1 changed files with 4 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue