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:
@@ -2050,7 +2050,7 @@ for scanner in "${available_scanners[@]}"; do
|
||||
esac
|
||||
|
||||
echo "" | tee -a "$SUMMARY_FILE"
|
||||
((SCANNERS_COMPLETED++))
|
||||
SCANNERS_COMPLETED=$((SCANNERS_COMPLETED + 1))
|
||||
|
||||
# Wait between scanners
|
||||
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
|
||||
if pgrep -f "bash $dir/scan.sh" > /dev/null 2>&1 || [ -f "$dir/.scan_running" ]; then
|
||||
echo -e " ${GREEN}●${NC} $session_name [RUNNING]"
|
||||
((running_count++))
|
||||
running_count=$((running_count + 1))
|
||||
|
||||
# Show progress if available
|
||||
if [ -f "$dir/logs/session.log" ]; then
|
||||
@@ -2785,7 +2785,7 @@ check_standalone_status() {
|
||||
# Check if completed successfully
|
||||
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]"
|
||||
((completed_count++))
|
||||
completed_count=$((completed_count + 1))
|
||||
|
||||
# Show infected count if available
|
||||
if [ -f "$dir/results/infected_files.txt" ] && [ -s "$dir/results/infected_files.txt" ]; then
|
||||
@@ -2794,7 +2794,7 @@ check_standalone_status() {
|
||||
fi
|
||||
else
|
||||
echo -e " ${RED}✗${NC} $session_name [ERROR/INCOMPLETE]"
|
||||
((error_count++))
|
||||
error_count=$((error_count + 1))
|
||||
fi
|
||||
else
|
||||
echo -e " ${YELLOW}?${NC} $session_name [UNKNOWN - no results yet]"
|
||||
@@ -2851,7 +2851,7 @@ delete_standalone_sessions() {
|
||||
fi
|
||||
|
||||
echo -e " $i. $session_name [$status]"
|
||||
((i++))
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
echo ""
|
||||
@@ -2873,7 +2873,7 @@ delete_standalone_sessions() {
|
||||
if ! pgrep -f "$dir/scan.sh" > /dev/null 2>&1; then
|
||||
echo "Deleting: $(basename "$dir")"
|
||||
rm -rf "$dir"
|
||||
((deleted++))
|
||||
deleted=$((deleted + 1))
|
||||
fi
|
||||
done
|
||||
echo ""
|
||||
@@ -3204,7 +3204,7 @@ view_scan_results() {
|
||||
local i=1
|
||||
for scanner in "${available_scanners[@]}"; do
|
||||
echo " $i. ${scanner^}"
|
||||
((i++))
|
||||
i=$((i + 1))
|
||||
done
|
||||
echo ""
|
||||
|
||||
@@ -3272,7 +3272,7 @@ view_scan_results() {
|
||||
fi
|
||||
|
||||
echo " $i. $session_name [$status]"
|
||||
((i++))
|
||||
i=$((i + 1))
|
||||
done
|
||||
echo ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user