summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2016-02-08 12:16:01 +0000
committergjb <gjb@FreeBSD.org>2016-02-08 12:16:01 +0000
commita44dc347a772a938a3a1e624b4809e7b74f58feb (patch)
tree06859f2b48e0d90b7e6715c5a5045b4b24de5822 /bin
parentb0e94739464da6f4e73a5f3e80ec779480d16892 (diff)
parent2ed1e2991e3970aeffef7be33b91401f0aeca84d (diff)
downloadFreeBSD-src-a44dc347a772a938a3a1e624b4809e7b74f58feb.zip
FreeBSD-src-a44dc347a772a938a3a1e624b4809e7b74f58feb.tar.gz
MFH
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'bin')
-rw-r--r--bin/csh/Makefile57
-rw-r--r--bin/dd/args.c90
-rw-r--r--bin/dd/dd.17
3 files changed, 75 insertions, 79 deletions
diff --git a/bin/csh/Makefile b/bin/csh/Makefile
index 51ef3dd..deb6347 100644
--- a/bin/csh/Makefile
+++ b/bin/csh/Makefile
@@ -51,41 +51,40 @@ FILESDIR= ${SHAREDIR}/examples/tcsh
FILES= complete.tcsh csh-mode.el
.endif
-CATALOGS= et:et_EE.ISO8859-15 \
- finnish:fi_FI.ISO8859-1 \
- french:fr_FR.ISO8859-1 \
- german:de_DE.ISO8859-1 \
- greek:el_GR.ISO8859-7 \
- italian:it_IT.ISO8859-1 \
- ja:ja_JP.eucJP \
- russian:ru_RU.KOI8-R \
- spanish:es_ES.ISO8859-1 \
- ukrainian:uk_UA.KOI8-U
-
-NLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
-NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
- fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
- fr_CH.ISO8859-15 fr_FR.ISO8859-15
-NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
- de_CH.ISO8859-15 de_DE.ISO8859-15
-NLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
-NLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
+CATALOGS= et:et_EE.UTF-8 \
+ finnish:fi_FI.UTF-8 \
+ french:fr_FR.UTF-8 \
+ german:de_DE.UTF-8 \
+ greek:el_GR.UTF-8 \
+ italian:it_IT.UTF-8 \
+ ja:ja_JP.UTF-8 \
+ russian:ru_RU.UTF-8 \
+ spanish:es_ES.UTF-8 \
+ ukrainian:uk_UA.UTF-8
+
+NLSLINKS_de_DE.UTF-8 = de_AT.UTF-8 de_CH.UTF-8
+NLSLINKS_fr_FR.UTF-8 = fr_BE.UTF-8 fr_CA.UTF-8 fr_CH.UTF-8
+NLSLINKS_it_IT.UTF-8 = it_CH.UTF-8
.if ${MK_NLS_CATALOGS} == "no" || defined(RESCUE)
CFLAGS+= -DNO_NLS_CATALOGS
.else
CFLAGS+= -DHAVE_ICONV
.if ${MK_ICONV} != "no"
-NLSLINKS_de_DE.ISO8859-1 += de_AT.UTF-8 de_CH.UTF-8 de_DE.UTF-8
-NLSLINKS_el_GR.ISO8859-7 = el_GR.UTF-8
-NLSLINKS_es_ES.ISO8859-1 += es_ES.UTF-8
-NLSLINKS_et_EE.ISO8859-15 = et_EE.UTF-8
-NLSLINKS_fi_FI.ISO8859-1 += fi_FI.UTF-8
-NLSLINKS_fr_FR.ISO8859-1 += fr_BE.UTF-8 fr_CA.UTF-8 fr_CH.UTF-8 fr_FR.UTF-8
-NLSLINKS_it_IT.ISO8859-1 += it_CH.UTF-8 it_IT.UTF-8
-NLSLINKS_ja_JP.eucJP = ja_JP.SJIS ja_JP.UTF-8
-NLSLINKS_ru_RU.KOI8-R = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.UTF-8
-NLSLINKS_uk_UA.KOI8-U = uk_UA.ISO8859-5 uk_UA.UTF-8
+NLSLINKS_de_DE.UTF-8 += de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
+ de_CH.ISO8859-15 de_DE.ISO8859-1 de_DE.ISO8859-15
+NLSLINKS_el_GR.UTF-8 = el_GR.ISO8859-7
+NLSLINKS_es_ES.UTF-8 = es_ES.ISO8859-1 es_ES.ISO8859-15
+NLSLINKS_et_EE.UTF-8 = et_EE.ISO8859-15
+NLSLINKS_fi_FI.UTF-8 = fi_FI.ISO8859-1 fi_FI.ISO8859-15
+NLSLINKS_fr_FR.UTF-8 += fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
+ fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
+ fr_CH.ISO8859-15 fr_FR.ISO8859-1 fr_FR.ISO8859-15
+NLSLINKS_it_IT.UTF-8 += it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-1 \
+ it_IT.ISO8859-15
+NLSLINKS_ja_JP.UTF-8 = ja_JP.SJIS ja_JP.eucJP
+NLSLINKS_ru_RU.UTF-8 = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.KOI8-R
+NLSLINKS_uk_UA.UTF-8 = uk_UA.ISO8859-5 uk_UA.KOI8-U
.else
# Above links can be installed from ports/shells/tcsh_nls
diff --git a/bin/dd/args.c b/bin/dd/args.c
index 2f197f8..1cbf3b3 100644
--- a/bin/dd/args.c
+++ b/bin/dd/args.c
@@ -360,6 +360,46 @@ c_conv(const void *a, const void *b)
((const struct conv *)b)->name));
}
+static uintmax_t
+postfix_to_mult(const char expr)
+{
+ uintmax_t mult;
+
+ mult = 0;
+ switch (expr) {
+ case 'B':
+ case 'b':
+ mult = 512;
+ break;
+ case 'K':
+ case 'k':
+ mult = 1 << 10;
+ break;
+ case 'M':
+ case 'm':
+ mult = 1 << 20;
+ break;
+ case 'G':
+ case 'g':
+ mult = 1 << 30;
+ break;
+ case 'T':
+ case 't':
+ mult = (uintmax_t)1 << 40;
+ break;
+ case 'P':
+ case 'p':
+ mult = (uintmax_t)1 << 50;
+ break;
+ case 'W':
+ case 'w':
+ mult = sizeof(int);
+ break;
+ }
+
+ return (mult);
+}
+
/*
* Convert an expression of the following forms to a uintmax_t.
* 1) A positive decimal number.
@@ -386,31 +426,7 @@ get_num(const char *val)
if (expr == val) /* No valid digits. */
errx(1, "%s: illegal numeric value", oper);
- mult = 0;
- switch (*expr) {
- case 'B':
- case 'b':
- mult = 512;
- break;
- case 'K':
- case 'k':
- mult = 1 << 10;
- break;
- case 'M':
- case 'm':
- mult = 1 << 20;
- break;
- case 'G':
- case 'g':
- mult = 1 << 30;
- break;
- case 'W':
- case 'w':
- mult = sizeof(int);
- break;
- default:
- ;
- }
+ mult = postfix_to_mult(*expr);
if (mult != 0) {
prevnum = num;
@@ -460,29 +476,7 @@ get_off_t(const char *val)
if (expr == val) /* No valid digits. */
errx(1, "%s: illegal numeric value", oper);
- mult = 0;
- switch (*expr) {
- case 'B':
- case 'b':
- mult = 512;
- break;
- case 'K':
- case 'k':
- mult = 1 << 10;
- break;
- case 'M':
- case 'm':
- mult = 1 << 20;
- break;
- case 'G':
- case 'g':
- mult = 1 << 30;
- break;
- case 'W':
- case 'w':
- mult = sizeof(int);
- break;
- }
+ mult = postfix_to_mult(*expr);
if (mult != 0) {
prevnum = num;
diff --git a/bin/dd/dd.1 b/bin/dd/dd.1
index 0908642..4047cdc 100644
--- a/bin/dd/dd.1
+++ b/bin/dd/dd.1
@@ -32,7 +32,7 @@
.\" @(#)dd.1 8.2 (Berkeley) 1/13/94
.\" $FreeBSD$
.\"
-.Dd August 28, 2014
+.Dd February 4, 2016
.Dt DD 1
.Os
.Sh NAME
@@ -332,10 +332,13 @@ If the number ends with a
.Dq Li k ,
.Dq Li m ,
.Dq Li g ,
+.Dq Li t ,
+.Dq Li p ,
or
.Dq Li w ,
the
-number is multiplied by 512, 1024 (1K), 1048576 (1M), 1073741824 (1G)
+number is multiplied by 512, 1024 (1K), 1048576 (1M), 1073741824 (1G),
+1099511627776 (1T), 1125899906842624 (1P)
or the number of bytes in an integer, respectively.
Two or more numbers may be separated by an
.Dq Li x
OpenPOWER on IntegriCloud