From b9c9e06856ebfeb7971ce5c5023cc6460e6044ea Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 30 Dec 2023 20:05:37 +0100 Subject: fix(hm/pkgs/con2pdf): Don't reassing `name` variable as it's global --- hm/soispha/pkgs/scripts/apps/con2pdf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hm/soispha/pkgs/scripts/apps/con2pdf b/hm/soispha/pkgs/scripts/apps/con2pdf index 56ed613f..b4d88712 100644 --- a/hm/soispha/pkgs/scripts/apps/con2pdf +++ b/hm/soispha/pkgs/scripts/apps/con2pdf @@ -90,7 +90,7 @@ process_images_adf() { if [ "$counter" = "$number_of_pages" ]; then dbg "$counter == $number_of_pages" counter=0; - convert_images_flatbed "$image_cache" "${name}_$pdf_counter" "$output_directory" + convert_images "$image_cache" "${name}_$pdf_counter" "$output_directory" : $((pdf_counter += 1)) printf "" > "$image_cache" fi @@ -123,14 +123,14 @@ process_images_flatbed() { : $((counter += 1)) if [ "$counter" = "$number_of_pages" ]; then counter=0; - convert_images_flatbed "$image_cache" "$name" "$output_directory" + convert_images "$image_cache" "$name" "$output_directory" printf "" > "$image_cache" fi done < "$(tmp_pipe fd . "$tiff_temp_path" "|" sort -V)" } -convert_images_flatbed() { +convert_images() { image_cache="$1"; - name="$2"; + pdf_name="$2"; output_dir="$3"; set -- @@ -139,11 +139,11 @@ convert_images_flatbed() { set -- "$@" "$image" done < "$image_cache" - while [ -e "$output_dir/${name}.pdf" ]; do - name="${name}_$(tr -dc 'A-Za-z0-9'