Skip to content

Commit

Permalink
patch 8.0.1537: xxd does not skip NUL lines when using ebcdic
Browse files Browse the repository at this point in the history
Problem:    Xxd does not skip NUL lines when using ebcdic.
Solution:   Check for a NUL before converting a character for ebcdic. (Tim
            Sell, closes #2668)
  • Loading branch information
brammool committed Feb 24, 2018
1 parent 791010e commit 085346f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1537,
/**/
1536,
/**/
Expand Down
4 changes: 2 additions & 2 deletions src/xxd/xxd.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,8 @@ main(int argc, char *argv[])
for (i = 7; i >= 0; i--)
l[++c] = (e & (1 << i)) ? '1' : '0';
}
if (e)
nonzero++;
if (ebcdic)
e = (e < 64) ? '.' : etoa64[e-64];
/* When changing this update definition of LLEN above. */
Expand All @@ -837,8 +839,6 @@ main(int argc, char *argv[])
(e > 31 && e < 127)
#endif
? e : '.';
if (e)
nonzero++;
n++;
if (++p == cols)
{
Expand Down

0 comments on commit 085346f

Please sign in to comment.