Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
Style cleanups:
Removing whitespaces at end of lines, hopefully reduces git am
warnings
Bug fixes:
fix segfault if file did not exist, now creates one empty line
fix insert mode text not showing on start of line
fix append on empty line
fix cursor move right on empty line
|
|
Now calculates utf-8 rune width properly before trying to print on screen.
works with test1.txt and test2.txt on tests/files/utf8 folder with
0x0300-0x036F combining chars
Uses mbtowc and wcwidth to calculate width of rune. These both should be
implemented on c runtime that conforms POSIX-1.2001. Different c
runtimes might have different level of support to combining char
ranges etc...
I think there is no standard way to calculate utf-8 rune width without
converting it first to widechar. And i think conversion to widechar just
to calculate width is silly, since all write calls can be done with utf8
directly (on utf8 locales ofc), but in order to calculate them yourself
without pointless conversion, one would need to write variable byte lookup
array for binary searching weird ranges and make sure it works with big-endian
systems too...
By the way running ./watch ./cat tests/files/utf8/japan.txt does not print the
text for some reason, but other test data does... I was checking how
well original crunch_str works and noticed it.
-Jarno
|
|
|
|
|
|
implement deferred utime updates (so directory timestamps correct).
|
|
BcVec contains the null at the end, so v->len is greater than
strlen(v->v) by one.
|
|
Variable initialization to start of blocks
Space after if,for,while: if() -> if ()
Space after comma on function calls:
write(fd,buf,count); -> write(fd, buf, count);
Spaces surrounding variable initialization
Pointer * binding to variable instead of type: int* i -> int *i
Spaces surrounding compare operators
No spaces surrounding arimetic operators
Some aligntment whitespace fixes
Still messy and needs more cleanup, but there is bigger issues to solve
first.
|
|
Removed for(int i = 0;....) style loop initializers to be consistant
with project style.
Removed few unused global variables
Added 2 empty white space lines back to CONFIG comment section.
|
|
Has beginnings of reading file, saving file, hjkl movement, insert, ex
(only w, wq, q!), search with /, some other normal mode actions (dd, w, b,
e), some utf8 support
Everything is still very unfinished and partly behaves wrongly comparing
to original vi. But simple tasks like modifying short config files
should be possible.
Some things like draw_page needs serious refactor since it now writes
whole screen after every keypress. Didint bother to refactor yet if
linked list needs to be replaced with something else...
|
|
Two "is never used uninitialized" and one "we don't trust you to get clearly
documented operator precedence right". (The compiler may not "suggest".
Every time I go "abc && def || exit 1" in the shell it means I know the
operator precedence _and_ the short-circuit rules, which are the same as
C here. This is a warning aimed at C++ developers, it should not be enabled
for C.)
|
|
|
|
|
|
|
|
This one with a little cleanup of unnecessary duplication.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dear gcc: if (i || node=blah) x = i ? blah : node; Don't complain "node may
be used uninitialied", it can't be. That warning is a gcc bug. (I should add
a node = node to the initialiation to shut up the warning, but gcc has failed
to emit "may be used uninitialized" reliably for 15 years and it still does.)
|
|
|
|
|
|
|
|
|
|
|
|
Intended to replace Android's toolbox `r`, but behaving more like a
drop-in replacement for busybox's `devmem`.
|
|
|
|
This one actually introduced by my last cleanup. (But helpfully pointed
out by the machines when I tried to upload my last cleanup to the AOSP
gerrit...)
|
|
|
|
|
|
mcookie simply prints out 16 bytes of entropy in hexadecimal; it is typically
used as the source for the "MIT magic cookies" that X11 uses for "secure"
connections.
The only implementation I know of is in util-linux; the problems with its
documented behavior motivated me to write an alternate implementation.
Specifically, getting 128 bytes from the kernel and finding the MD5 sum is
not a sane PRNG, especially when only 16 bytes are needed.
|
|
Inspired by some of the small patches that have gone by recently.
Limited to only things found in `generated/help.h`, plus a wider cleanup
for the more common "milisecond" typo.
|
|
Needed to improve cp(1) testing.
|
|
|
|
|
|
|
|
remove more unnecessary typecasts.
|
|
reversed so the mask is 1<<(x&7) instead of 1<<(7-(x&7)). Can't _quite_
make printString() use unescape() out of lib because \q is a thing?
|
|
|
|
|
|
|
|
I don't know why NDK llvm is complaining about adjtime(), toys.h is #including
<sys/time.h> which http://man7.org/linux/man-pages/man3/adjtime.3.html says
is the right header...?
|
|
|
|
|