tavinus / pdfScale

Bash Script to Scale and Resize PDFs using Ghostscript
MIT License
246 stars 37 forks source link

Unquoted $0 in basename $0 - basename: extra operand issues #40

Closed brozkeff closed 1 year ago

brozkeff commented 1 year ago

Variable PDFSCALE_NAME does not properly doublequotes "$0" variable for the subshell running basename command: "$(basename $0)"

When script is run in a folders where some contain spaces or other characters errors such as "basename: extra operand ..." appear due to variable expansion. The correct way is to doublequote also $0: PDFSCALE_NAME="$(basename "$0")"

This PR fixes the issue and bumps the version up to 2.5.6: https://github.com/tavinus/pdfScale/pull/39

tavinus commented 1 year ago

I see.
This variable is only used for printing information on screen, but it still should be fixed to avoid those errors.
I will give a check on the PR now...

tavinus commented 1 year ago

Fixed on https://github.com/tavinus/pdfScale/pull/39