Skip to content

Commit

Permalink
Merge pull request #142 from kerl/gh141
Browse files Browse the repository at this point in the history
Do not assume writes to list_add/remove succeed
  • Loading branch information
jadeallenx committed Jun 13, 2016
2 parents bb22e63 + ca96e22 commit bcf8d62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kerl
Expand Up @@ -892,16 +892,16 @@ list_add()
return 1
fi
done < "$KERL_BASE_DIR/otp_$1"
echo "$2" >> "$KERL_BASE_DIR/otp_$1"
echo "$2" >> "$KERL_BASE_DIR/otp_$1" || exit 1
else
echo "$2" > "$KERL_BASE_DIR/otp_$1"
echo "$2" > "$KERL_BASE_DIR/otp_$1" || exit 1
fi
}

list_remove()
{
if [ -f "$KERL_BASE_DIR/otp_$1" ]; then
sed $SED_OPT -i -e "/^.*$2$/d" "$KERL_BASE_DIR/otp_$1"
sed $SED_OPT -i -e "/^.*$2$/d" "$KERL_BASE_DIR/otp_$1" || exit 1
fi
}

Expand Down

0 comments on commit bcf8d62

Please sign in to comment.