feat: add gerbv_create_excellon_image_from_filename() to public API#302
Merged
spe-ciellt merged 1 commit intodevelopfrom Feb 28, 2026
Merged
feat: add gerbv_create_excellon_image_from_filename() to public API#302spe-ciellt merged 1 commit intodevelopfrom
spe-ciellt merged 1 commit intodevelopfrom
Conversation
cc61ceb to
6acbe07
Compare
rampageservices
added a commit
to SourceParts/gerbv
that referenced
this pull request
Mar 1, 2026
Callers of gerb_fopen() use strerror(errno) to report why a file failed to open, but the cleanup calls inside gerb_fopen() (fclose, g_free, munmap) could clobber errno before it was returned to the caller, producing misleading error messages. Save errno immediately after the failing call and restore it after cleanup, before returning NULL. This affects all six error paths: g_fopen failure, fstat failure, mmap failure, g_malloc failure, calloc failure, and fread failure. Also fixes a latent NULL pointer dereference on the mmap failure path, which previously set fd = NULL and fell through to fd->filename = g_strdup(...) instead of returning. Ref: gerbv#302
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gerbv_create_excellon_image_from_filename()to the public libgerbv API, the missing counterpart togerbv_create_rs274x_image_from_filename()Files changed
src/gerbv.h— public function declarationsrc/gerbv.c— implementationTest plan
cmake --build build -j$(nproc)— clean, 0 errorsnm -D libgerbv.so | grep excellon_image_from_filename— present as globalT.excfile, netlist + tools present, destroyed cleanly