Skip to content

Commit 3cb97c8

Browse files
committed
codablockf: ignore 2nd byte of FNC4 when counting digits in
`numsscr`
1 parent cd9e39e commit 3cb97c8

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/codablockf.ps.src

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Barcode Writer in Pure PostScript
22
% https://bwipp.terryburton.co.uk
33
%
4-
% Copyright (c) 2004-2024 Terry Burton
4+
% Copyright (c) 2004-2025 Terry Burton
55
%
66
% $Id$
77
%
@@ -170,6 +170,9 @@ begin
170170
/n 0 def /s 0 def
171171
/p exch def {
172172
p msglen ge {exit} if
173+
p 0 ne { % Check not 2nd byte of FNC4
174+
msg p 1 sub get fn4 eq {exit} if
175+
} if
173176
msg p get
174177
dup setc exch known not {pop exit} if
175178
fn1 eq {

tests/ps_tests/codablockf.ps.test

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Barcode Writer in Pure PostScript
22
% https://bwipp.terryburton.co.uk
33
%
4-
% Copyright (c) 2004-2024 Terry Burton
4+
% Copyright (c) 2004-2025 Terry Burton
55

66
% AIM Europe ISS-X-24 - Uniform Symbology Specification - Codablock F (1995)
77

@@ -31,6 +31,9 @@
3131
(@g\(^194^194^194^194^1945555^194^194^194^194^194^194^194^194) (debugcws parse columns=18) codablockf
3232
} [103 100 64 32 71 8 100 34 100 34 100 34 100 34 100 34 99 55 55 100 99 75 104 103 100 11 100 34 100 34 100 34 100 34 100 34 100 34 100 34 100 34 52 35 30 104] debugIsEqual
3333

34+
{ % Ignore 2nd byte of FNC4 when counting digits in `numsscr`
35+
(^238^159V^200^182767) (debugcws parse columns=8) codablockf
36+
} [103 100 64 100 78 100 101 95 54 101 40 26 104 103 100 11 100 22 23 22 23 99 60 63 99 104] debugIsEqual
3437

3538
% Example
3639

0 commit comments

Comments
 (0)