components/text-utilities/patches/parse.c.patch
author Rich Burridge <rich.burridge@oracle.com>
Fri, 03 Oct 2014 06:49:24 -0700
changeset 2129 bf833e1aa881
child 3897 cd126ba3fdda
permissions -rw-r--r--
PSARC 2014/170 text-utilities version 2.24.2 18307792 request for "column" utility in Userland
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2129
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     1
A printf format specifier of "qx" isn't supported on Solaris.
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     2
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     3
http://man7.org/linux/man-pages/man3/printf.3.html says:
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     4
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     5
  q   ("quad". 4.4BSD and Linux libc5 only.  Don't use.)  This is a
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     6
      synonym for ll.
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     7
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     8
This change will be sent upstream.
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     9
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    10
--- util-linux-2.24.2/text-utils/parse.c.orig	2014-06-04 13:04:47.338346633 -0700
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    11
+++ util-linux-2.24.2/text-utils/parse.c	2014-06-04 14:15:15.476415780 -0700
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    12
@@ -208,7 +208,7 @@
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    13
 	PR *pr, **nextpr;
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    14
 	FU *fu;
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    15
 	char *p1, *p2;
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    16
-	char savech, *fmtp, cs[3];
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    17
+	char savech, *fmtp, cs[4];
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    18
 	int nconv, prec;
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    19
 
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    20
 	nextpr = NULL;
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    21
@@ -282,9 +282,10 @@
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    22
 				goto isint;
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    23
 			case 'o': case 'u': case 'x': case 'X':
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    24
 				pr->flags = F_UINT;
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    25
-isint:				cs[2] = '\0';
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    26
-				cs[1] = cs[0];
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    27
-				cs[0] = 'q';
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    28
+isint:				cs[3] = '\0';
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    29
+				cs[2] = cs[0];
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    30
+				cs[1] = 'l';
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    31
+				cs[0] = 'l';
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    32
 				switch(fu->bcnt) {
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    33
 				case 0: case 4:
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    34
 					pr->bcnt = 4;
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    35
@@ -342,9 +343,10 @@
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    36
 					++p2;
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    37
 					switch(p1[2]) {
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    38
 					case 'd': case 'o': case'x':
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    39
-						cs[0] = 'q';
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    40
-						cs[1] = p1[2];
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    41
-						cs[2] = '\0';
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    42
+						cs[0] = 'l';
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    43
+						cs[1] = 'l';
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    44
+						cs[2] = p1[2];
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    45
+						cs[3] = '\0';
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    46
 						break;
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    47
 					default:
bf833e1aa881 PSARC 2014/170 text-utilities version 2.24.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    48
 						p1[3] = '\0';