summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-09-19 16:52:50 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-09-19 16:52:50 +0000
commit83100c448bcae8123de07a3a167c9da028152173 (patch)
tree23cfda345b3b61db97391709026c028619901a58 /src
parente165ffef18040a143757d936954da5707d32022a (diff)
downloadcoreutils-83100c448bcae8123de07a3a167c9da028152173.tar.xz
(STRING_OPTION): Remove.
(long_options, main): Remove support for undocumented and obsolete --string option, as suggested in the 1996-09-26 patch.
Diffstat (limited to 'src')
-rw-r--r--src/md5sum.c47
1 files changed, 2 insertions, 45 deletions
diff --git a/src/md5sum.c b/src/md5sum.c
index 9a9bdb223..d2efd5e2c 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -105,8 +105,7 @@ char *program_name;
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
{
- STATUS_OPTION = CHAR_MAX + 1,
- STRING_OPTION
+ STATUS_OPTION = CHAR_MAX + 1
};
static const struct option long_options[] =
@@ -114,7 +113,6 @@ static const struct option long_options[] =
{ "binary", no_argument, 0, 'b' },
{ "check", no_argument, 0, 'c' },
{ "status", no_argument, 0, STATUS_OPTION },
- { "string", required_argument, 0, STRING_OPTION },
{ "text", no_argument, 0, 't' },
{ "warn", no_argument, 0, 'w' },
{ GETOPT_HELP_OPTION_DECL },
@@ -558,8 +556,6 @@ main (int argc, char **argv)
unsigned char bin_buffer[MAX_DIGEST_BIN_BYTES];
bool do_check = false;
int opt;
- char **string = NULL;
- size_t n_strings = 0;
bool ok = true;
bool file_type_specified = false;
@@ -584,13 +580,6 @@ main (int argc, char **argv)
while ((opt = getopt_long (argc, argv, "bctw", long_options, NULL)) != -1)
switch (opt)
{
- case STRING_OPTION:
- {
- if (string == NULL)
- string = xnmalloc (argc - 1, sizeof *string);
- string[n_strings++] = optarg;
- }
- break;
case 'b':
file_type_specified = true;
binary = true;
@@ -626,13 +615,6 @@ main (int argc, char **argv)
usage (EXIT_FAILURE);
}
- if (n_strings > 0 && do_check)
- {
- error (0, 0,
- _("the --string and --check options are mutually exclusive"));
- usage (EXIT_FAILURE);
- }
-
if (status_only & !do_check)
{
error (0, 0,
@@ -647,32 +629,7 @@ main (int argc, char **argv)
usage (EXIT_FAILURE);
}
- if (n_strings > 0)
- {
- size_t i;
-
- if (optind < argc)
- {
- error (0, 0, _("extra operand %s"), quote (argv[optind]));
- fprintf (stderr, "%s\n",
- _("File operands cannot be combined with --string."));
- usage (EXIT_FAILURE);
- }
- for (i = 0; i < n_strings; ++i)
- {
- size_t cnt;
- if (algorithm == ALG_MD5)
- md5_buffer (string[i], strlen (string[i]), bin_buffer);
- else
- sha1_buffer (string[i], strlen (string[i]), bin_buffer);
-
- for (cnt = 0; cnt < (digest_hex_bytes / 2); ++cnt)
- printf ("%02x", bin_buffer[cnt]);
-
- printf (" \"%s\"\n", string[i]);
- }
- }
- else if (do_check)
+ if (do_check)
{
if (optind + 1 < argc)
{