diff --git a/members/libpt-bintols/src/hedu/mod.rs b/members/libpt-bintols/src/hedu/mod.rs index fa32521..efe0bf0 100644 --- a/members/libpt-bintols/src/hedu/mod.rs +++ b/members/libpt-bintols/src/hedu/mod.rs @@ -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 diff --git a/src/hedu/mod.rs b/src/hedu/mod.rs index 4e72881..84cf0e6 100644 --- a/src/hedu/mod.rs +++ b/src/hedu/mod.rs @@ -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, }