Skip to content

ppd-filter: fix & typo in the filter-streaming-mode check - #102

Merged
tillkamppeter merged 1 commit into
OpenPrinting:masterfrom
Ar-maan05:filter-streaming-mode-and
Nov 3, 2026
Merged

tillkamppeter merged 1 commit into
OpenPrinting:masterfrom
Ar-maan05:filter-streaming-mode-and

Conversation

@Ar-maan05

Copy link
Copy Markdown
Contributor

one-character fix: ppdFilterEmitJCL() has a & where && was ment in the filter-streaming-mode check.

with glibc, strcasecmp("on", "off") & strcasecmp("on", "no") comes out as 8 & 1 == 0, so filter-streaming-mode=on is treated like "off" and the job still goes through full pdftopdf processing. "true", "yes" and "1" happen to work just by luck of the bit patterns.

value   before  after
on      0       1
true    1       1
yes     1       1
off     0       0
no      0       0
false   0       0

checked with a small program running the old and new expressions over those values.

the check for filter-streaming-mode used & instead of && between the "off" and "no" comparisons. strcasecmp("on", "off") & strcasecmp("on", "no") is 8 & 1 == 0 with glibc, so filter-streaming-mode=on never actualy turned Streaming mode on.
@tillkamppeter
tillkamppeter merged commit d76784e into OpenPrinting:master Nov 3, 2026
15 checks passed
@Ar-maan05
Ar-maan05 deleted the filter-streaming-mode-and branch November 3, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants