Skip to content

Commit

Permalink
Merge pull request #194 from mknos/printf-cfmt
Browse files Browse the repository at this point in the history
printf: standard meaning of %c
  • Loading branch information
briandfoy committed Jul 7, 2023
2 parents f7f4542 + 4ca8f78 commit f0e76fd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bin/printf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ unless (@ARGV) {

my $format = shift;
$format =~ s/\\v/\x0b/g; # escape \v not available in printf()
$format =~ s/\%c/\%\.1s/g; # standard printf: %c == 1st char
eval qq(printf "$format", \@ARGV);
die if $@;

Expand Down

0 comments on commit f0e76fd

Please sign in to comment.