Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin/ghostscript10.07.0/bearsampp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ghostscriptVersion = "10.07.0"
ghostscriptExe = "bin/gswin64.exe"
ghostscriptExeConsole = "bin/gswin64c.exe"

bundleRelease = "@RELEASE_VERSION@"
4 changes: 4 additions & 0 deletions bin/ghostscript10.07.0/update_cidfmap.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@ECHO OFF

cd %~dp0
bin\gswin64c.exe -q -dBATCH -sFONTDIR=c:/windows/fonts -sCIDFMAP=lib/cidfmap lib/mkcidfm.ps
Comment on lines +3 to +4
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Unquoted batch paths 🐞 Bug ≡ Correctness

update_cidfmap.bat uses cd %~dp0 (no quotes, no /d) and then runs a relative
bin\gswin64c.exe; if the module lives in a path with spaces or on a different drive, cd can fail
and the script may fail or run an unintended executable. This can prevent CIDF map generation and is
risky because execution depends on the caller’s working directory.
Agent Prompt
### Issue description
`bin/ghostscript10.07.0/update_cidfmap.bat` uses `cd %~dp0` (no quotes, no `/d`) and calls a relative `bin\gswin64c.exe`. This breaks when the script directory contains spaces or is on a different drive than the current working directory, and can accidentally execute the wrong binary.

### Issue Context
This script is copied into the final packaged bundle and is intended to be executed by end users to regenerate `lib/cidfmap`.

### Fix Focus Areas
- bin/ghostscript10.07.0/update_cidfmap.bat[1-4]

### Suggested change
- Use `pushd "%~dp0"` (or `cd /d "%~dp0"`) to reliably change drive + directory.
- Quote the executable path (e.g., `"%~dp0bin\gswin64c.exe" ...`) and consider guarding with `if not exist` plus `exit /b 1`.
- Optionally `popd` at the end and propagate `%ERRORLEVEL%`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bundle.name = ghostscript
bundle.release = 2026.1.15
bundle.release = 2026.4.12
bundle.type = tools
bundle.format = 7z

Expand Down
1 change: 1 addition & 0 deletions releases.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
10.07.0 = https://github.com/Bearsampp/module-ghostscript/releases/download/2026.4.12/bearsampp-ghostscript-10.07.0-2026.4.12.7z
10.06.0 = https://github.com/Bearsampp/module-ghostscript/releases/download/2026.1.15/bearsampp-ghostscript-10.06.0-2026.1.15.7z
10.05.1 = https://github.com/Bearsampp/module-ghostscript/releases/download/2025.7.31/bearsampp-ghostscript-10.05.1-2025.7.31.7z
10.05.0 = https://github.com/Bearsampp/module-ghostscript/releases/download/2025.4.26/bearsampp-ghostscript-10.05.0-2025.4.26.7z
Expand Down
Loading