bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add support to bash for printf "%'d" etc.


From: Paul Eggert
Subject: Re: add support to bash for printf "%'d" etc.
Date: Fri, 27 Apr 2001 09:49:50 -0700 (PDT)

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.7
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc' 
-DCONF_OSTYPE='solaris2.7' -DCONF_MACHTYPE='sparc-sun-solaris2.7' 
-DCONF_VENDOR='sun' -DSHELL  -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib 
-I/opt/reb/include -g -O2
uname output: SunOS shade.twinsun.com 5.8 Generic_108528-07 sun4u sparc 
SUNW,Ultra-1
Machine Type: sparc-sun-solaris2.7

Bash Version: 2.05
Patch Level: 0
Release Status: release

Description:
        My previous fix to add support to bash for the ' flag
        character in printf specifications was incomplete: it
        did not handle "%'s" correctly.  The ' should be ignored
        in that case.

Repeat-By:
        printf "%'s" foo

Fix:

2001-04-27  Paul Eggert  <address@hidden>

        * builtins/printf.def (printstr):
        Use SKIP1 to test for flags rather than having our own copy
        of the characters in SKIP1.

===================================================================
RCS file: builtins/printf.def,v
retrieving revision 2.5.0.1
retrieving revision 2.5.0.2
diff -pu -r2.5.0.1 -r2.5.0.2
--- builtins/printf.def 2001/04/27 00:13:44     2.5.0.1
+++ builtins/printf.def 2001/04/27 16:43:24     2.5.0.2
@@ -355,7 +355,7 @@ printstr (fmt, string, len, fieldwidth, 
   ljust = fw = pr = 0;
 
   /* skip flags */
-  while (*fmt == '#' || *fmt == '-' || *fmt == '+' || *fmt == ' ' || *fmt == 
'0')
+  while (strchr (SKIP1, *fmt))
     {
       if (*fmt == '-')
        ljust = 1;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]