Age | Commit message (Collapse) | Author |
|
Rename the existing xbind/xconnect to xbindany/xconnectany, to make room
for new xbind/xconnect that are more like 'x' versions of the regular
bind and connect. Move explicit bind/connect callers over to
xbind/xconnect.
Of the affected commands, only netcat is actually used by Android. It
was the most recent patch to netcat that made the lack of a more
traditional xbind/xconnect apparent.
|
|
Investigating why the toybox tar tests fail on Android with toybox dd, I
realized I was rewriting a part of dd I'd rewritten before!
This is a re-send of my 2019-02-22 patch, rebased against the current
ToT...
This patch was originally motivated because after suggesting to the author of
https://stackoverflow.com/questions/17157820/access-vdsolinux/54797221#54797221
that he could tell dd to work in bytes rather than blocks, I realized
that our dd doesn't actually support that. But the rewrite of the main
loop is necessary to fix the incorrect output from the dd calls in the
tar test.
Without this patch, `yes | dd bs=65536 count=1 > fweep` basically gives
random output, based on how many bytes the pipe feels like giving you in
your first read. (As far as I know, dd *without* bs= was fine, but I
can't guarantee that that's true, just that I haven't seen it fail.)
Also switch to TAGGED_ARRAY and comma_* for conv rather than add two more
copies of an undesired idiom. It turned out -- contrary to the belief of
cp(1) -- that comma_scan isn't suitable for this because of its magic
handling of "no" prefixes. (It's actually harmless in cp because none
of the --preserve options begin with "no", but some dd options do.) To
this end, comma_remove is a less-magic comma_scan.
I've also changed an `if` to a `while` because other implementations
allow things like `--preserve=mode,mode` or `conv=sync,sync`. (If we
decide this is a bug rather than a feature, we should at least fix the
error message to be clear that we're rejecting the *duplication*, not
the option itself.)
I've also fixed the ^C behavior by simply adding a direct SIGINT handler
rather than trying to be clever inside the read loop (which is why we
weren't handling the SIGINT until the read returned).
I've also removed `strstarteq` and just added the '=' to each literal
when calling regular `strstart`.
Plus basic tests.
|
|
|
|
|
|
Basic line continuation logic (to prompt with $PS2). Doesn't use result yet.
|
|
xtempfile() alreay does the right thing, so switch to that.
Also use xsendfile() for the actual copying.
Fixes the cat tests on Android.
|
|
|
|
locally defining the single constant definition ip.c uses (IP_DF) if not already defined.
|
|
I put the check into the wrong if. That was my bad. Again.
|
|
This bug is that an error should be returned when the user tries to take
0 to a negative power, since that is undefined, but bc would return 0.
|
|
Iterate over MANPATH and ordered sections using a manpath() helper
equivalent of indenting logic of man x, man 1 x, and man -k each with a
strsep loop.
|
|
(This and `git clone` is how I use the latest man7.org pages all the
time instead of my system's man pages.)
|
|
Exec -k value as regex on basename, and on the first content line
outside a tag or on a referenced see-other, whichever appears earlier.
Reuse zcat choice as a function when looping over files. Fix \-\- and
glob.h include leftover. Handle man-pages example newlines. Clarify the
todos, naming package and issue. Remaining items are more of a wishlist
than a plan. Remove `<1>2` because it doesn't let `-k .` work, please
look into that.
|
|
|
|
|
|
Also fix the non-tty output.
Also tweak our output so the tests pass with TEST_HOST=1 too.
|
|
Reimplemented to command mode execution to follow vi cmd pattern.
(REG)[COUNT0]{CMD}[COUNT1]<MOV>(SYM)
Most of the moves can be executed intependently or before command,
some require character after. (possibly with utf8)
Some of the commands do not require move, such as D, J, dd, yy, x...
There is also tons of special cases where move behaves differently
depending on command. For example 1cw and 1ce appear to be the same
but 1dw and 1de are not...
Most of the operations still need reimplementing and lots of cleanup
in order them to behave correctly
refactored word move to work with utf-8
|
|
|
|
|
|
There's probably more to do, but it seems usable at this point.
|
|
|
|
|
|
To look up docs on my netbook and server. Practically deroff.1, with
heuristic for where to put spaces and newlines. How would you simplify
file resolution and bzcat? What have I got wrong when escaping slashes,
because while \-\^\- is -- ok, \-\- becomes -\-, e.g. in git-pull.1?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented basic cursor movements and char delete.
In order to work more correctly with utf-8 data.
x,h,j,k,l seems to work now with test data such as
tests/files/utf8/test2.txt
hjkl now accept count parameter so 1000j will scroll file 1000 lines
relative move to bottom
word movements w,e,b... still need to be still reimplemented in order to
step correctly on utf-8 data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.)
|
|
|