commit 0e6571ee5ad59b6a395ff3f65f40d1545ef84f1c
parent bb0da8a4ed076ebe21547f0e789ae27f1f83047d
Author: hhvn <hayden@haydenvh.com>
Date: Tue, 2 Feb 2021 16:52:00 +0000
bin/interface.sh: fix bug where first reply gets given mainid of 1
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/interface.sh b/bin/interface.sh
@@ -200,8 +200,8 @@ menu_read(){
lnum=$(echo "$(awk -v "file=$(echo "$ofile" | sed 's/ .*//')" -F" " '$6 == file' < $datadir/boards/$board/list | wc -l) - 1" | bc)
lock $datadir/boards/$board/list
awk -v "n=1" -v "file=$(basename "$file")" -v "lnum=$lnum" -v "user=$user" -v "date=$(date +%d-%b-%Y)" -v "ofile=$(echo "$ofile" | sed 's/ .*//')" -F" " '
- $6 == ofile && $2 != lnum {print; n = $1}
- $6 == ofile && $2 == lnum {print; print n "\t" lnum + 1 "\t" date "\t" user "\t_\t" ofile "\t" file}
+ $6 == ofile && $2 != lnum {print}
+ $6 == ofile && $2 == lnum {print; print $1 "\t" lnum + 1 "\t" date "\t" user "\t_\t" ofile "\t" file}
$6 != ofile
' < $datadir/boards/$board/list > $datadir/boards/$board/list.new
mv $datadir/boards/$board/list.new $datadir/boards/$board/list