Fix: Replace remaining C-style increment operators

ISSUE: Found 8 additional instances of C-style ((var++)) syntax that
weren't caught in previous comprehensive checks.

FIXES:
- Line 2053: SCANNERS_COMPLETED++ → var=$((var + 1))
- Line 2777: running_count++ → var=$((var + 1))
- Line 2788: completed_count++ → var=$((var + 1))
- Line 2797: error_count++ → var=$((var + 1))
- Line 2854: i++ → var=$((var + 1))
- Line 2876: deleted++ → var=$((var + 1))
- Line 3207: i++ → var=$((var + 1))
- Line 3275: i++ → var=$((var + 1))

All instances replaced using replace_all to ensure consistency.
These were missed in earlier comprehensive scans.

VERIFIED: bash -n syntax check passes
This commit is contained in:
Developer
2026-04-21 21:20:40 -04:00
parent cc89b2ffed
commit a4868091d3
+8 -8
View File
@@ -2050,7 +2050,7 @@ for scanner in "${available_scanners[@]}"; do
esac esac
echo "" | tee -a "$SUMMARY_FILE" echo "" | tee -a "$SUMMARY_FILE"
((SCANNERS_COMPLETED++)) SCANNERS_COMPLETED=$((SCANNERS_COMPLETED + 1))
# Wait between scanners # Wait between scanners
if [ "${SCANNERS_COMPLETED:-0}" -lt "$TOTAL_SCANNERS" ]; then if [ "${SCANNERS_COMPLETED:-0}" -lt "$TOTAL_SCANNERS" ]; then
@@ -2774,7 +2774,7 @@ check_standalone_status() {
# Use pgrep with exact match to avoid false positives from viewers/editors # Use pgrep with exact match to avoid false positives from viewers/editors
if pgrep -f "bash $dir/scan.sh" > /dev/null 2>&1 || [ -f "$dir/.scan_running" ]; then if pgrep -f "bash $dir/scan.sh" > /dev/null 2>&1 || [ -f "$dir/.scan_running" ]; then
echo -e " ${GREEN}${NC} $session_name [RUNNING]" echo -e " ${GREEN}${NC} $session_name [RUNNING]"
((running_count++)) running_count=$((running_count + 1))
# Show progress if available # Show progress if available
if [ -f "$dir/logs/session.log" ]; then if [ -f "$dir/logs/session.log" ]; then
@@ -2785,7 +2785,7 @@ check_standalone_status() {
# Check if completed successfully # Check if completed successfully
if grep -q "Multi-Scanner Session Complete\|Scan session ended" "$dir/results/summary.txt" 2>/dev/null; then if grep -q "Multi-Scanner Session Complete\|Scan session ended" "$dir/results/summary.txt" 2>/dev/null; then
echo -e " ${CYAN}${NC} $session_name [COMPLETED]" echo -e " ${CYAN}${NC} $session_name [COMPLETED]"
((completed_count++)) completed_count=$((completed_count + 1))
# Show infected count if available # Show infected count if available
if [ -f "$dir/results/infected_files.txt" ] && [ -s "$dir/results/infected_files.txt" ]; then if [ -f "$dir/results/infected_files.txt" ] && [ -s "$dir/results/infected_files.txt" ]; then
@@ -2794,7 +2794,7 @@ check_standalone_status() {
fi fi
else else
echo -e " ${RED}${NC} $session_name [ERROR/INCOMPLETE]" echo -e " ${RED}${NC} $session_name [ERROR/INCOMPLETE]"
((error_count++)) error_count=$((error_count + 1))
fi fi
else else
echo -e " ${YELLOW}?${NC} $session_name [UNKNOWN - no results yet]" echo -e " ${YELLOW}?${NC} $session_name [UNKNOWN - no results yet]"
@@ -2851,7 +2851,7 @@ delete_standalone_sessions() {
fi fi
echo -e " $i. $session_name [$status]" echo -e " $i. $session_name [$status]"
((i++)) i=$((i + 1))
done done
echo "" echo ""
@@ -2873,7 +2873,7 @@ delete_standalone_sessions() {
if ! pgrep -f "$dir/scan.sh" > /dev/null 2>&1; then if ! pgrep -f "$dir/scan.sh" > /dev/null 2>&1; then
echo "Deleting: $(basename "$dir")" echo "Deleting: $(basename "$dir")"
rm -rf "$dir" rm -rf "$dir"
((deleted++)) deleted=$((deleted + 1))
fi fi
done done
echo "" echo ""
@@ -3204,7 +3204,7 @@ view_scan_results() {
local i=1 local i=1
for scanner in "${available_scanners[@]}"; do for scanner in "${available_scanners[@]}"; do
echo " $i. ${scanner^}" echo " $i. ${scanner^}"
((i++)) i=$((i + 1))
done done
echo "" echo ""
@@ -3272,7 +3272,7 @@ view_scan_results() {
fi fi
echo " $i. $session_name [$status]" echo " $i. $session_name [$status]"
((i++)) i=$((i + 1))
done done
echo "" echo ""