/* Terminate tag, and lookup. */
char sep = s[i];
s[i] = '\0';
- ptrdiff_t algo = argmatch (s, algorithm_tags, NULL, 0);
+ ptrdiff_t algo = argmatch_exact (s, algorithm_tags);
s[i] = sep;
return algo;
{
#if HASH_ALGO_CKSUM
case 'a':
- cksum_algorithm = XARGMATCH ("--algorithm", optarg,
- algorithm_args, algorithm_types);
+ cksum_algorithm = XARGMATCH_EXACT ("--algorithm", optarg,
+ algorithm_args, algorithm_types);
algorithm_specified = true;
break;
done < input_options
compare out out-a || fail=1
+# Ensure --check not allowed with older (non tagged) algorithms
returns_ 1 cksum -a bsd --check </dev/null || fail=1
+# Ensure abbreviations not supported for algorithm selection
+returns_ 1 cksum -a sha22 </dev/null || fail=1
+
Exit $fail