File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
uucore/src/lib/features/checksum Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
186186 digest : algo. create_digest ( ) ,
187187 output_format,
188188 line_ending,
189+ binary : false ,
189190 no_names : false ,
190191 } ;
191192
Original file line number Diff line number Diff line change @@ -230,6 +230,7 @@ pub fn uumain(mut args: impl uucore::Args) -> UResult<()> {
230230 /* base64: */ false ,
231231 ) ,
232232 line_ending,
233+ binary,
233234 no_names,
234235 } ;
235236
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ pub struct ChecksumComputeOptions {
3434 /// Whether to finish lines with '\n' or '\0'.
3535 pub line_ending : LineEnding ,
3636
37+ /// On windows, open files as binary instead of text
38+ pub binary : bool ,
39+
3740 /// (non-GNU option) Do not print file names
3841 pub no_names : bool ,
3942}
@@ -290,7 +293,7 @@ where
290293 let ( sum_hex, sz) = digest_reader (
291294 & mut options. digest ,
292295 & mut file,
293- false ,
296+ options . binary ,
294297 options. algo_kind . bitlen ( ) ,
295298 )
296299 . map_err_context ( || translate ! ( "cksum-error-failed-to-read-input" ) ) ?;
You can’t perform that action at this time.
0 commit comments