Bug 299551 - Thousand separator flag in format string is sticky
Thousand separator flag in format string is sticky
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gawk (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Stepan Kasal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-20 20:18 EDT by Ulrich Drepper
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-31 13:03:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch to unstick thousands separator flag (298 bytes, patch)
2007-09-20 20:18 EDT, Ulrich Drepper
no flags Details | Diff

  None (edit)
Description Ulrich Drepper 2007-09-20 20:18:06 EDT
Description of problem:
When using code like

   printf "%'d %d"

in a script currently both numbers are printed using thousand separators (given
the numbers are large enough).  This is not correct, the flag should not be sticky.


Version-Release number of selected component (if applicable):
gawk-3.1.5-15.fc7

How reproducible:
always

Steps to Reproduce:
1.store this in a file:

env LC_ALL=en_US.UTF-8 \
./gawk < /dev/null -f /dev/fd/3 3<<'EOF'
END { printf "%'d %d\n", 1000000000000, 1000000000000 }
EOF

2. run using bash or so
3.
  
Actual results:
1,000,000,000,000 1,000,000,000,000


Expected results:
1,000,000,000,000 1000000000000


Additional info:
I'll attach a patch.
Comment 1 Ulrich Drepper 2007-09-20 20:18:06 EDT
Created attachment 201551 [details]
Patch to unstick thousands separator flag
Comment 2 Stepan Kasal 2007-10-31 13:03:14 EDT
Applied in gawk-3.1.5-16.fc9, together with a patch for a new test case which
checks for this bug.

Note You need to log in before you can comment on or make changes to this bug.