Skip to content

Commit

Permalink
Fix off-by-one counting bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostwords committed Oct 3, 2024
1 parent 021d262 commit 66b7293
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion search_log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ show_most_recent_matches() {
sites_sample=$(echo "$sites" | cut -d ',' -f '1-3')
dotdotdot=
if [ "$sites_sample" != "$sites" ]; then
dotdotdot=", ...$(($(echo "$sites" | tr -dc ',' | wc -c) - 3)) more"
dotdotdot=", ...$(($(echo "$sites" | tr -dc ',' | wc -c) + 1 - 3)) more"
fi
printf '%s|%s%s\n' \
"$(echo "$line" | cut -d '|' -f '1-4')" \
Expand Down

0 comments on commit 66b7293

Please sign in to comment.