mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-29 14:00:29 +00:00
Fix bugs and make code tinier
- Fixed bug where stdio eof wasn't being sticky - Fixed bug where fseeko() wasn't clearing eof state - Removed assert() usage from libc favoring _unassert() / _npassert()
This commit is contained in:
parent
9b7c8db846
commit
d5910e2673
115 changed files with 510 additions and 290 deletions
6
third_party/linenoise/linenoise.c
vendored
6
third_party/linenoise/linenoise.c
vendored
|
@ -588,7 +588,7 @@ static size_t GetMonospaceWidth(const char *p, size_t n, char *out_haswides) {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
unreachable;
|
||||
}
|
||||
}
|
||||
if (out_haswides) {
|
||||
|
@ -1558,7 +1558,7 @@ static void linenoiseEditTranspose(struct linenoiseState *l) {
|
|||
p = q = malloc(c - a);
|
||||
p = mempcpy(p, l->buf + b, c - b);
|
||||
p = mempcpy(p, l->buf + a, b - a);
|
||||
assert(p - q == c - a);
|
||||
_unassert(p - q == c - a);
|
||||
memcpy(l->buf + a, q, p - q);
|
||||
l->pos = c;
|
||||
free(q);
|
||||
|
@ -1579,7 +1579,7 @@ static void linenoiseEditTransposeWords(struct linenoiseState *l) {
|
|||
p = mempcpy(p, l->buf + yi, yj - yi);
|
||||
p = mempcpy(p, l->buf + xj, yi - xj);
|
||||
p = mempcpy(p, l->buf + xi, xj - xi);
|
||||
assert(p - q == yj - xi);
|
||||
_unassert(p - q == yj - xi);
|
||||
memcpy(l->buf + xi, q, p - q);
|
||||
l->pos = yj;
|
||||
free(q);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue