diff --git a/bb.sh b/bb.sh
index 1694830..d9b852c 100755
--- a/bb.sh
+++ b/bb.sh
@@ -720,7 +720,7 @@ all_tags() {
echo "
$template_tags_title
" >> "$contentfile"
echo "" >> "$contentfile"
- for i in ./$prefix_tags*.html; do
+ for i in $(ls ./$prefix_tags*.html 2>/dev/null || echo ''); do
echo -n "."
nposts="$(grep -c "<\!-- text begin -->" $i)"
tagname="$(echo $i | cut -c $((${#prefix_tags}+3))- | sed 's/\.html//g')"
@@ -784,6 +784,7 @@ tags_in_post() {
# Arguments are tags
# Prints one line with space-separated tags to stdout
posts_with_tags() {
+ [ $# -lt 1 ] && return
tag_files="$(echo "$@" | sed "s/\S\+/tag_&.html/g")"
sed -n '/^