diff options
author | Jim Meyering <jim@meyering.net> | 1993-08-05 02:20:48 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1993-08-05 02:20:48 +0000 |
commit | 410da16d0250bcf31c51a160de9eccb92667c7fe (patch) | |
tree | fb530f65b6ee0bc13a6cc8c1e9f576d9d92d447f /src/dd.c | |
parent | 08701d38a4c4e746e79132651c4577a6c03b02f6 (diff) | |
download | coreutils-410da16d0250bcf31c51a160de9eccb92667c7fe.tar.xz |
merge with 3.8.1
Diffstat (limited to 'src/dd.c')
-rw-r--r-- | src/dd.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -20,7 +20,7 @@ /* Options: Numbers can be followed by a multiplier: - b=512, k=1024, w=2, xm=number m + b=512, c=1, k=1024, w=2, xm=number m if=FILE Read from FILE instead of stdin. of=FILE Write to FILE instead of stdout; don't @@ -309,15 +309,15 @@ static unsigned char const ebcdic_to_ascii[] = }; /* If non-zero, display usage information and exit. */ -static int flag_help; +static int show_help; /* If non-zero, print the version on standard error. */ -static int flag_version; +static int show_version; static struct option const long_options[] = { - {"help", no_argument, &flag_help, 1}, - {"version", no_argument, &flag_version, 1}, + {"help", no_argument, &show_help, 1}, + {"version", no_argument, &show_version, 1}, {0, 0, 0, 0} }; @@ -340,13 +340,13 @@ main (argc, argv) /* Decode arguments. */ scanargs (argc, argv); - if (flag_version) + if (show_version) { fprintf (stderr, "%s\n", version_string); exit (0); } - if (flag_help) + if (show_help) usage (); apply_translations (); @@ -905,6 +905,8 @@ loop: case 'b': n *= 512; goto loop; + case 'c': + goto loop; case 'k': n *= 1024; goto loop; @@ -1032,7 +1034,7 @@ print_stats () fprintf (stderr, "%u+%u records in\n", r_full, r_partial); fprintf (stderr, "%u+%u records out\n", w_full, w_partial); if (r_truncate > 0) - fprintf (stderr, "%u truncated block%s\n", r_truncate, + fprintf (stderr, "%u truncated record%s\n", r_truncate, r_truncate == 1 ? "" : "s"); } @@ -1064,7 +1066,7 @@ Usage: %s [if=file] [of=file] [ibs=bytes] [obs=bytes] [bs=bytes] [cbs=bytes]\n\ [conv={ascii,ebcdic,ibm,block,unblock,lcase,ucase,swab,noerror,notrunc,\n\ sync}] [--help] [--version]\n\ Numbers can be followed by a multiplier:\n\ -b=512, k=1024, w=2, xm=number m\n", +b=512, c=1, k=1024, w=2, xm=number m\n", program_name); exit (1); } |