some fixes for hedu #64

Merged
PlexSheep merged 15 commits from devel into master 2024-01-18 13:45:27 +01:00
2 changed files with 7 additions and 1 deletions
Showing only changes of commit fd0d1e3c22 - Show all commits

View File

@ -139,12 +139,17 @@ pub fn dump(data: &mut dyn DataSource, mut config: HeduConfig) -> Result<()> {
);
let start_line = config.data_idx;
while config.buf[0] == config.buf[1] && config.len == BYTES_PER_LINE {
rd_data(data, &mut config)?; // FIXME: incorrect logic #59
rd_data(data, &mut config)?;
}
config.alt_buf ^= 1; // toggle the alt buf (now that we have a not same line)
config.display_buf += &format!(
"^^^^^^^^ {LINE_SEP_VERT} (repeats {} lines)",
(config.data_idx - start_line) / (BYTES_PER_LINE * 2)
);
trace!(
buf = format!("{:X?}", config.buf),
"dumping buf after line skip"
);
config.display();
}
// switch to the second half of the buf, the original half is stored the old buffer

View File

@ -86,6 +86,7 @@ pub struct Cli {
/// a data source, probably a file.
///
/// If left empty or set as "-", the program will read from stdin.
// TODO: take many sources #60
pub data_source: Option<String>,
}