Source-Changes-HG archive

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

[src/trunk]: src/bin/sh support %ll (as synonym for %q) in doformat(), since ...



details:   https://anonhg.NetBSD.org/src/rev/405add0971da
branches:  trunk
changeset: 501813:405add0971da
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Jan 07 22:19:53 2001 +0000

description:
support %ll (as synonym for %q) in doformat(), since my changes to %q -> %ll
broke this :/
problem reported in private email by Witold J. Wnuk.
<witek%pd37.warszawa.sdi.tpnet.pl@localhost>.

diffstat:

 bin/sh/output.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r a1d34c1ac583 -r 405add0971da bin/sh/output.c
--- a/bin/sh/output.c   Sun Jan 07 21:47:24 2001 +0000
+++ b/bin/sh/output.c   Sun Jan 07 22:19:53 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: output.c,v 1.21 1998/01/31 12:37:55 christos Exp $     */
+/*     $NetBSD: output.c,v 1.22 2001/01/07 22:19:53 lukem Exp $        */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)output.c   8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: output.c,v 1.21 1998/01/31 12:37:55 christos Exp $");
+__RCSID("$NetBSD: output.c,v 1.22 2001/01/07 22:19:53 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -322,7 +322,7 @@
  * Formatted output.  This routine handles a subset of the printf formats:
  * - Formats supported: d, u, o, p, X, s, and c.
  * - The x format is also accepted but is treated like X.
- * - The l and q modifiers are accepted.
+ * - The l, ll and q modifiers are accepted.
  * - The - and # flags are accepted; # only works with the o format.
  * - Width and precision may be specified with any format except c.
  * - An * may be given for the width or precision.
@@ -404,8 +404,12 @@
                        }
                }
                if (*f == 'l') {
-                       islong++;
                        f++;
+                       if (*f == 'l') {
+                               isquad++;
+                               f++;
+                       } else
+                               islong++;
                } else if (*f == 'q') {
                        isquad++;
                        f++;



Home | Main Index | Thread Index | Old Index