Skip to content

Ghostscript 10.07.0#19

Merged
N6REJ merged 2 commits intomainfrom
april
Apr 19, 2026
Merged

Ghostscript 10.07.0#19
N6REJ merged 2 commits intomainfrom
april

Conversation

@jwaisner
Copy link
Copy Markdown
Contributor

@jwaisner jwaisner commented Apr 12, 2026

PR Type

Enhancement


Description

  • Add Ghostscript 10.07.0 support with configuration files

  • Improve update_cidfmap.bat error handling and robustness

    • Add existence check for gswin64c.exe executable
    • Use pushd/popd for safer directory navigation
    • Capture and propagate exit codes properly
    • Handle paths with spaces using quoted paths
  • Update bundle release version to 2026.4.12

  • Register new release in releases.properties


Diagram Walkthrough

flowchart LR
  A["Ghostscript 10.07.0"] --> B["bearsampp.conf"]
  A --> C["update_cidfmap.bat"]
  C --> D["Error Handling"]
  D --> E["Path Validation"]
  D --> F["Exit Code Propagation"]
  G["build.properties"] --> H["Version 2026.4.12"]
  I["releases.properties"] --> J["10.07.0 Release URL"]
Loading

File Walkthrough

Relevant files
Enhancement
update_cidfmap.bat
Batch script with robust error handling                                   

bin/ghostscript10.07.0/update_cidfmap.bat

  • Add batch script for updating CID font map with Ghostscript
  • Implement existence check for gswin64c.exe before execution
  • Use pushd/popd for safe directory navigation
  • Capture and propagate exit codes to caller
  • Use quoted paths to handle spaces in directory names
+11/-0   
Configuration changes
bearsampp.conf
Ghostscript 10.07.0 configuration file                                     

bin/ghostscript10.07.0/bearsampp.conf

  • Define Ghostscript version 10.07.0 configuration
  • Specify GUI and console executable paths
  • Set bundle release version placeholder
+5/-0     
build.properties
Update bundle release version                                                       

build.properties

  • Update bundle release version from 2026.1.15 to 2026.4.12
+1/-1     
releases.properties
Register Ghostscript 10.07.0 release                                         

releases.properties

  • Add Ghostscript 10.07.0 release entry at top of list
  • Reference new release URL with 2026.4.12 version tag
+1/-0     

@jwaisner jwaisner requested a review from N6REJ as a code owner April 12, 2026 22:50
@jwaisner jwaisner added enhancement ✨ Improve program Security 🔐 Security issue labels Apr 12, 2026
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Add Ghostscript 10.07.0 version support and update release properties
✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add Ghostscript 10.07.0 version support with configuration files
• Update bundle release version to 2026.4.12
• Register new release in releases.properties mapping
Diagram
flowchart LR
  A["Ghostscript 10.07.0"] --> B["Configuration Files"]
  B --> C["bearsampp.conf"]
  B --> D["update_cidfmap.bat"]
  A --> E["Release Properties"]
  E --> F["releases.properties"]
  E --> G["build.properties"]
  F --> H["GitHub Release URL"]
  G --> I["Version 2026.4.12"]
Loading

Grey Divider

File Changes

1. bin/ghostscript10.07.0/update_cidfmap.bat ⚙️ Configuration changes +4/-0

Add CID font map update batch script

• New batch script for updating CID font map
• Executes gswin64c.exe with font directory and CID map configuration
• Runs mkcidfm.ps script for font mapping generation

bin/ghostscript10.07.0/update_cidfmap.bat


2. bin/ghostscript10.07.0/bearsampp.conf ⚙️ Configuration changes +5/-0

Add Ghostscript 10.07.0 configuration file

• New configuration file for Ghostscript 10.07.0
• Specifies executable paths for GUI and console versions
• Defines bundle release version placeholder

bin/ghostscript10.07.0/bearsampp.conf


3. build.properties ⚙️ Configuration changes +1/-1

Update bundle release version number

• Update bundle.release from 2026.1.15 to 2026.4.12
• Reflects new release date for Ghostscript module

build.properties


View more (1)
4. releases.properties ⚙️ Configuration changes +1/-0

Register Ghostscript 10.07.0 release mapping

• Add new entry for Ghostscript 10.07.0 release
• Maps version to GitHub release download URL with 2026.4.12 tag
• Maintains backward compatibility with previous versions

releases.properties


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Apr 12, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Unquoted batch paths🐞 Bug ≡ Correctness
Description
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.
Code

bin/ghostscript10.07.0/update_cidfmap.bat[R3-4]

+cd %~dp0
+bin\gswin64c.exe -q -dBATCH -sFONTDIR=c:/windows/fonts -sCIDFMAP=lib/cidfmap lib/mkcidfm.ps
Evidence
The script changes directory using an unquoted %~dp0 and then invokes the Ghostscript console exe
via a relative path, so correct execution depends on cd succeeding and the current working
directory being the module directory. The build explicitly packages this script into the final
bundle, so end users will run it as-shipped.

bin/ghostscript10.07.0/update_cidfmap.bat[1-4]
build.gradle[689-697]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### 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


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment thread bin/ghostscript10.07.0/update_cidfmap.bat Outdated
- Add existence check for gswin64c.exe before execution
- Use pushd/popd for safer directory navigation
- Capture and propagate exit codes properly
- Use quoted paths to handle spaces in directory names
- Add error message when executable is not found
@qodo-code-review
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Cleanup Bug

The early failure path exits before calling popd, which can leave the caller in a different working directory than expected. Ensure popd runs on all exit paths (e.g., by jumping to a common cleanup label or restructuring the logic).

pushd "%~dp0"
if not exist "%~dp0bin\gswin64c.exe" (
    echo ERROR: gswin64c.exe not found in "%~dp0bin"
    exit /b 1
)
Robustness

Consider using a safer set syntax for capturing the exit code (e.g., set "EXITCODE=%ERRORLEVEL%") and optionally rely on the pushd-set working directory to use relative paths consistently (to reduce dependence on %~dp0 string concatenation).

"%~dp0bin\gswin64c.exe" -q -dBATCH -sFONTDIR=c:/windows/fonts -sCIDFMAP=lib/cidfmap lib/mkcidfm.ps
set EXITCODE=%ERRORLEVEL%
popd
exit /b %EXITCODE%

Copy link
Copy Markdown
Contributor

@N6REJ N6REJ left a comment

Choose a reason for hiding this comment

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

worked well

@N6REJ N6REJ merged commit 444516b into main Apr 19, 2026
4 checks passed
@N6REJ N6REJ deleted the april branch April 19, 2026 03:04
@qodo-code-review
Copy link
Copy Markdown

PR Code Suggestions ✨

CategorySuggestion                                                                                                                                    Impact
Possible issue
Always restore directory stack

Add popd before exit /b 1 to ensure the directory stack is properly restored on
error.

bin/ghostscript10.07.0/update_cidfmap.bat [3-11]

 pushd "%~dp0"
 if not exist "%~dp0bin\gswin64c.exe" (
     echo ERROR: gswin64c.exe not found in "%~dp0bin"
+    popd
     exit /b 1
 )
 "%~dp0bin\gswin64c.exe" -q -dBATCH -sFONTDIR=c:/windows/fonts -sCIDFMAP=lib/cidfmap lib/mkcidfm.ps
 set EXITCODE=%ERRORLEVEL%
 popd
 exit /b %EXITCODE%
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: Calling exit /b without popd leaves the caller's directory stack unbalanced, which can cause unexpected behavior in the calling scripts.

Medium
Make paths portable and quoted

Replace the hardcoded c:/windows/fonts path with the %WINDIR%\Fonts environment
variable and quote paths to improve portability.

bin/ghostscript10.07.0/update_cidfmap.bat [8]

-"%~dp0bin\gswin64c.exe" -q -dBATCH -sFONTDIR=c:/windows/fonts -sCIDFMAP=lib/cidfmap lib/mkcidfm.ps
+"%~dp0bin\gswin64c.exe" -q -dBATCH -sFONTDIR="%WINDIR%\Fonts" -sCIDFMAP="%~dp0lib\cidfmap" "%~dp0lib\mkcidfm.ps"
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: Replacing the hardcoded c:/windows/fonts with %WINDIR%\Fonts improves portability across systems where Windows is installed on a different drive.

Low
  • More

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ Improve program Security 🔐 Security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants