Merge branch 'bugfix-lune-first-byte'

Fix bugs related to first byte of argument of ++lune
This commit is contained in:
Raymond Pasco 2016-03-03 17:12:01 -05:00
commit 5a0d8af6c8

View File

@ -20,14 +20,26 @@
return u3m_error("noeol");
}
if (pos_w == 0) {
if (u3r_byte(0, lub) == 10) {
return u3nc(u3_nul, lin);
} else {
return u3m_error("noeol");
}
}
while (--pos_w) {
if (u3r_byte(pos_w, lub) == 10) {
lin = u3nc(u3qc_cut(3, (pos_w + 1), (end_w - pos_w - 1), lub), lin);
end_w = pos_w;
continue;
}
}
if (u3r_byte(pos_w, lub) == 10) {
return u3nc(u3_nul,
u3nc(u3qc_cut(3, pos_w, (end_w - pos_w), lub), lin));
}
return u3nc(u3qc_cut(3, pos_w, (end_w - pos_w), lub), lin);
}
}