More OsSplit windows fixing

This commit is contained in:
Félix Saparelli 2022-01-18 23:14:08 +13:00
parent 881e8f4047
commit 9f67ec35b1
1 changed files with 3 additions and 4 deletions

View File

@ -174,12 +174,11 @@ impl Iterator for OsSplit {
cur.push(wide);
}
let res = OsString::from_wide(&cur);
self.pos = cur.len() + 1;
if res.is_empty() && self.pos >= self.os.len() {
self.pos += cur.len() + 1;
if cur.is_empty() && self.pos >= self.os.len() {
None
} else {
Some(res)
Some(OsString::from_wide(&cur))
}
}
}