less(1): pass errret to setupterm(3)

2016-06-11 Thread Anton Lindqvist
The setupterm(3) manual states: > If errret is not null, then setupterm returns OK or ERR and stores a > status value in the integer pointed to by errret. > ... > If errret is null, setupterm prints an error message upon finding an > error and exits. Since less(1) passes NULL, it will

Re: less(1): pass errret to setupterm(3)

2016-07-08 Thread Anton Lindqvist
On Sat, Jun 11, 2016 at 03:03:14PM +0200, Anton Lindqvist wrote: > The setupterm(3) manual states: > > > If errret is not null, then setupterm returns OK or ERR and stores a > > status value in the integer pointed to by errret. > > ... > > If errret is null, set

man.cgi(8): add unique HTML titles

2017-02-05 Thread Anton Lindqvist
Here's a proposal to add unique HTML titles to man-pages served using man.cgi. The name of the man-page is used as a title prefix (inspired by NetBSD's adoption of mandoc). There might be a more elegant way to produce the title given the filename. Index: cgi.c

ksh(1): fix $RANDOM documentation

2017-02-18 Thread Anton Lindqvist
Usage of rand was replaced with arc4random (var.c, r1.17) and later documented (ksh.1, r1.70). The change was later on reverted (var.c, r1.39) back to using rand and srand_deterministic. The patch below removes the explicit mention of arc4random and documents the current behavior. Index: ksh.1

Re: ksh(1): fix $RANDOM documentation

2017-02-20 Thread Anton Lindqvist
parts of the patch! On Sun, Feb 19, 2017 at 06:33:59PM +0100, Ingo Schwarze wrote: > Hi Anton, > > Anton Lindqvist wrote on Sun, Feb 19, 2017 at 08:29:31AM +0100: > > > Usage of rand was replaced with arc4random (var.c, r1.17) and later > > documented (ksh.1, r1.70). The chan

Re: ksh(1): preserve xtrace option

2017-01-16 Thread Anton Lindqvist
On Fri, Jan 13, 2017 at 10:56:51AM +0100, Otto Moerbeek wrote: > On Fri, Jan 13, 2017 at 10:20:19AM +0100, Otto Moerbeek wrote: > > > On Fri, Jan 13, 2017 at 09:51:51AM +0100, Otto Moerbeek wrote: > > > > > On Fri, Jan 13, 2017 at 09:46:54AM +0100, Anton Lindqvist wro

gprof(1): remove reference to prof(1)

2016-10-06 Thread Anton Lindqvist
The prof(1) reference in the See Also section was removed back in 1998 (r1.10). Index: gprof.1 === RCS file: /cvs/src/usr.bin/gprof/gprof.1,v retrieving revision 1.22 diff -u -p -r1.22 gprof.1 --- gprof.1 23 Dec 2011 17:00:47

acpivout(4): brightness adjustment quirk

2016-10-30 Thread Anton Lindqvist
I'm trying to fix the brightness hotkeys on my Dell Latitude 3160. Adjusting the brightness using wsconsctl(1) works, as opposed of the keys. Turns out it's not possible to move the next or previous BCL level relative to the current one on this particular machine. Instead four steps is the minimum

efifb(4): WSDISPLAYIO_{GET,SET}PARAM ioctl support

2016-12-11 Thread Anton Lindqvist
This allows the brightness on my Dell Latitude 3160 to be adjusted through wsconsctl(1). Index: arch/amd64/amd64/efifb.c === RCS file: /cvs/src/sys/arch/amd64/amd64/efifb.c,v retrieving revision 1.9 diff -u -p -r1.9 efifb.c ---

ksh(1): preserve xtrace option

2017-01-13 Thread Anton Lindqvist
Consider the following script which calculates the sum of the first N integers recursively: $ cat >sum.sh

doas.conf(5): clarify args

2016-12-02 Thread Anton Lindqvist
Make it clear that args is a keyword followed by zero or more arguments. Unfortunately, the grammar format no longer fits on a single line even with the offset removed. Index: doas.conf.5 === RCS file:

ftp(1): anonymous login and .netrc

2017-01-04 Thread Anton Lindqvist
I'm running a script as root which drops privileges while fetching files using ftp(1) with anonymous login enabled: # doas -u unpriv ftp -a URL ... and was surprised to see the following error: ftp: /root/.netrc: Permission denied I'm not sure if the .netrc file should be considered when

SHA1(3): remove usage of No macro

2017-01-09 Thread Anton Lindqvist
The following paragraph from the SHA1(3) man-page looks odd in its HTML representation: $ sed -n 214p /usr/src/lib/libcrypto/man/SHA1.3 .Pq Fa len No bytes at Fa data . The No macro causes "bytes at" to be wrapped inside a code-tag and not be rendered as unformatted text. Splitting the line

dsdt: redundant assignment

2017-03-26 Thread Anton Lindqvist
Hi, An assignment introduced in r1.219 looks redundant. Index: dsdt.c === RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v retrieving revision 1.231 diff -u -p -r1.231 dsdt.c --- dsdt.c 16 Feb 2017 18:02:22 - 1.231 +++ dsdt.c

bioctl(8): redundant mention of command line in man-page

2017-04-06 Thread Anton Lindqvist
Hi, The bioctl man-page uses the phrase "The following command, executed from the command line, ..." in the examples section. A convention I haven't seen before. I would argue that mentioning the command line is redundant since it's implied by the actual examples and could therefore be removed.

acpicpu(4): simplify len argument to memset

2017-04-06 Thread Anton Lindqvist
Hi, Instead of passing sizeof(struct aml_value)*4 as the len argument to memset when writing zeros to osc_cmd, pass sizeof(osc_cmd) since osc_cmd already is declared as 'struct aml_value osc_cmd[4]'. Tested on amd64. Index: acpicpu.c

Re: wsconsctl(8): mention decrement assignment in man-page

2017-04-06 Thread Anton Lindqvist
On Wed, Apr 05, 2017 at 10:03:08PM +0100, Jason McIntyre wrote: > On Wed, Apr 05, 2017 at 04:37:04PM +0200, Anton Lindqvist wrote: > > Hi, > > Support for decrementing a variable using the '-=' operator with > > wsconsctl was added in r1.11 of wsconsctl.c. It never ended up

wsconsctl(8): mention decrement assignment in man-page

2017-04-05 Thread Anton Lindqvist
Hi, Support for decrementing a variable using the '-=' operator with wsconsctl was added in r1.11 of wsconsctl.c. It never ended up being documented. One might deduce that '-=' works since '+=' does. However, I think adding documentation would be helpful. Index: wsconsctl.8

httpd.conf(5): sync default media types

2017-04-09 Thread Anton Lindqvist
Hi, SVG was added as a default media type in revision 1.10 of http.h. Index: httpd.conf.5 === RCS file: /cvs/src/usr.sbin/httpd/httpd.conf.5,v retrieving revision 1.81 diff -u -p -r1.81 httpd.conf.5 --- httpd.conf.525 Mar

dsdt: error while compiling with ACPI_MEMDEBUG

2017-04-14 Thread Anton Lindqvist
Hi, While compiling the GENERIC.MP kernel on amd64 with ACPI_MEMDEBUG defined, I get the following error: dsdt.c:411: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'long int' Adding the 'l' modifier fixes the error. Index: dsdt.c

Re: pledge(2): prof promise

2017-04-20 Thread Anton Lindqvist
On Thu, Apr 20, 2017 at 09:52:58AM +0200, Sebastien Marie wrote: > Could you send two separated diffs ? One for uint64_t stuff and another > for profil(2) ? Coming up, first off the uint64_t diff. While at it, I propose changing the type of code in `struct ktr_pledge` to uint64_t for consistency

Re: pledge(2): prof promise

2017-04-20 Thread Anton Lindqvist
On Thu, Apr 20, 2017 at 09:52:58AM +0200, Sebastien Marie wrote: > Could you send two separated diffs ? One for uint64_t stuff and another > for profil(2) ? Here's the prof diff. Thanks for the feedback, I will review it more closely later today. Index: lib/libc/sys/pledge.2

pledge(2): prof promise

2017-04-20 Thread Anton Lindqvist
Hi, Profiling a pledged program using gprof(1) is not possible since the profil(2) syscall is not allowed. I have previously temporally removed the pledge-calls as a work-around. But I thought it would be an exercise worthwhile to try implementing a new pledge promise. In addition to allowing

Re: dsdt: redundant assignment

2017-04-07 Thread Anton Lindqvist
Ping On Sun, Mar 26, 2017 at 07:10:29PM +1100, Jonathan Gray wrote: > On Sun, Mar 26, 2017 at 09:33:44AM +0200, Otto Moerbeek wrote: > > On Sun, Mar 26, 2017 at 06:31:41PM +1100, Jonathan Gray wrote: > > > > > On Sun, Mar 26, 2017 at 09:14:26AM +0200, Anton Lin

Re: less(1) - segmentation fault with '-g'

2017-07-28 Thread Anton Lindqvist
On Fri, Jul 28, 2017 at 01:19:39PM +0200, Theo Buehler wrote: > On Thu, Jul 27, 2017 at 10:31:51AM +0100, Larry Hynes wrote: > > Hi > > > > $ env | grep LESS > > LESSHISTFILE=- > > LESS="-i -M -R -g -c" > > LESSCHARSET=utf-8 > > > > $ unset LESS > > $ unset LESSCHARSET > > $ unset LESSHISTFILE >

Re: less(1) - segmentation fault with '-g'

2017-07-30 Thread Anton Lindqvist
Any OKs for the diff below? On Fri, Jul 28, 2017 at 01:32:34PM +0200, Anton Lindqvist wrote: > On Fri, Jul 28, 2017 at 01:19:39PM +0200, Theo Buehler wrote: > > On Thu, Jul 27, 2017 at 10:31:51AM +0100, Larry Hynes wrote: > > > Hi > > > > > > $ env | grep LESS

ftp(1): remove self assignment

2017-08-01 Thread Anton Lindqvist
Hi, Discovered while compiling with `-Wall`. My guess is that this line was added back in 2004 in order to silence a compiler warning since the parameter is not used. Unfortunately it can't be removed since the function prototype is dictated by el_set(3). Comments? OK? Index: complete.c

Re: less(1) - segmentation fault with '-g'

2017-08-02 Thread Anton Lindqvist
On Wed, Aug 02, 2017 at 08:46:26PM +0200, Martijn van Duren wrote: > You're right. Maybe I should read up on my less. :-) > > OK martijn@ for the full diff. Thanks, committed. > On 08/02/17 19:55, Anton Lindqvist wrote: > > On Wed, Aug 02, 2017 at 07:19:50PM +0200, Marti

Re: less(1) - segmentation fault with '-g'

2017-08-03 Thread Anton Lindqvist
On Wed, Aug 02, 2017 at 09:39:25PM +0200, Anton Lindqvist wrote: > On Wed, Aug 02, 2017 at 08:46:26PM +0200, Martijn van Duren wrote: > > You're right. Maybe I should read up on my less. :-) > > > > OK martijn@ for the full diff. > > Thanks, committed. The fix

install.sub: zap space between function name and parens

2017-07-20 Thread Anton Lindqvist
Hi, Minor inconsistency noticed in install.sub. No intended functional change. Comments? OK? Index: install.sub === RCS file: /cvs/src/distrib/miniroot/install.sub,v retrieving revision 1.1024 diff -u -p -r1.1024 install.sub ---

getdelim(3): perror -> err in example

2017-07-22 Thread Anton Lindqvist
Hi, This changes the behavior of the example but makes it consistent with the example in fgetln(3) and many other manuals. Comments? OK? Index: getdelim.3 === RCS file: /cvs/src/lib/libc/stdio/getdelim.3,v retrieving revision 1.4

Re: time(1): use monotonic clock for computing elapsed time

2017-07-22 Thread Anton Lindqvist
On Fri, Jul 21, 2017 at 04:34:53PM -0500, Scott Cheloha wrote: > ~1 week bump. Changes to time(1) were committed by tedu@. > > Any feedback on the ksh/csh portions of the patch? Looks good. I'm willing to commit this diff if I can get another ok.

Re: time(1): use monotonic clock for computing elapsed time

2017-07-22 Thread Anton Lindqvist
On Sat, Jul 22, 2017 at 10:19:22AM +0200, Anton Lindqvist wrote: > On Fri, Jul 21, 2017 at 04:34:53PM -0500, Scott Cheloha wrote: > > ~1 week bump. Changes to time(1) were committed by tedu@. > > > > Any feedback on the ksh/csh portions of the patch? > > Looks

csh(1): postpone prompt

2017-07-25 Thread Anton Lindqvist
Hi, In csh with filec enabled the prompt is displayed prior enabling noncanonical mode on the tty. ksh on the other hand ensures the desired mode is entered prior doing any I/O on the tty. This diff displays the prompt after noncanonical mode has been enabled which also makes the regress tests

apm(8): static and __dead

2017-07-23 Thread Anton Lindqvist
Hi, Flag functions as static and __dead when appropriate. Allows apm to be compiled using `clang -Wall`. While here, sort and align function declarations. Comments? OK? Index: apm.c === RCS file: /cvs/src/usr.sbin/apm/apm.c,v

apm(8): remove TRUE/FALSE defines

2017-07-23 Thread Anton Lindqvist
Hi, Fairly straightforward and no intended functional change. If changes like this one is not encouraged I would advocate on at least using stdbool.h instead. Comments? OK? Index: apm.c === RCS file: /cvs/src/usr.sbin/apm/apm.c,v

Re: apm(8): remove TRUE/FALSE defines

2017-07-24 Thread Anton Lindqvist
Hi, On Sun, Jul 23, 2017 at 03:53:14PM +0200, Otto Moerbeek wrote: > On Sun, Jul 23, 2017 at 03:04:54PM +0200, Anton Lindqvist wrote: > > > Hi, > > Fairly straightforward and no intended functional change. If changes > > like this one is not encouraged I would ad

sys/net/rtsock.c: typo in comment

2017-07-26 Thread Anton Lindqvist
Hi, Looks like a typo to me. Comments? OK? Index: rtsock.c === RCS file: /cvs/src/sys/net/rtsock.c,v retrieving revision 1.241 diff -u -p -r1.241 rtsock.c --- rtsock.c24 Jul 2017 09:20:32 - 1.241 +++ rtsock.c26 Jul

vi(1): strtol -> strtonum

2017-07-19 Thread Anton Lindqvist
Hi, Fairly straightforward, replace usage of strtol with strtonum. No intended functional change. Comments? OK? Index: cl/cl_term.c === RCS file: /cvs/src/usr.bin/vi/cl/cl_term.c,v retrieving revision 1.27 diff -u -p -r1.27

macppc: initialize brightness

2017-07-22 Thread Anton Lindqvist
Hi, The brightness on my PowerBook6,4 prior pressing either the brightness down/up key looks odd: $ wsconsctl display.brightness display.brightness=4294967271.4294967235% Since cons_brightness is initialized to 0 and MIN_BRIGHTNESS is greater than 0, the percentage calculation performed by

tty(4): mention TIOCSTAT

2017-06-28 Thread Anton Lindqvist
Hi, A first stab at documenting the TIOCSTAT ioctl. The paragraph is taken from termios(4) as is and could might be reworked. The parameter is as stated unused but consistent with the definition of TIOCSTAT in sys/sys/ttycom.h. Comments? OK? Index: tty.4

Re: [patch] increase command buffer ksh

2017-06-28 Thread Anton Lindqvist
On Wed, Jun 28, 2017 at 07:36:54PM +0200, Martijn van Duren wrote: > On 06/28/17 19:00, Theo de Raadt wrote: > > Sounds good. > > > > It might be nice to determine if these two variables should be one, > > ie. tied together better. > > I was thinking the same thing. Both are used for input line

csh(1): remove size parameter from tenex()

2017-06-29 Thread Anton Lindqvist
Hi, Both the old (prior getting rid of TIOCSTI) and the new implementation of tenex() makes assumptions about the capacity of the input buffer without respect to the inputline_size parameter. A more correct handling would be to set `cl.size = MIN(BUFSIZ, inputline_size)` but since tenex() only has

Re: tty(4): mention TIOCSTAT

2017-06-29 Thread Anton Lindqvist
On Wed, Jun 28, 2017 at 03:41:29PM -0600, Todd C. Miller wrote: > On Wed, 28 Jun 2017 15:35:36 -0600, "Theo de Raadt" wrote: > > > Nope. It requires a parameter. lukem messed this up two decades ago, > > he should have used _IO but used the wrong one. > > Ah right, I missed that it is _IOW.

csh(1): restore tty on SIGINT

2017-07-07 Thread Anton Lindqvist
Hi, This one is crucial, aborting loops in csh is done upon receiving SIGINT. The signal handler will eventually call longjmp() and re-enter the input loop if all went well. The tty should therefore be restored prior sending the SIGINT. Strange behavior discovered by the regress suite. Comments?

vi(1): minor nit

2017-04-26 Thread Anton Lindqvist
Hi, In revision 1.41 of usr.bin/vi/common/exf.c the msg_cat function was removed but it looks like an extraneous argument from one of the removed function calls didn't end up being removed. Found while compiling with clang(1). Index: common/exf.c

make(1): minor manual tweaks

2017-07-30 Thread Anton Lindqvist
Hi, I count six operators so instead stop mentioning the total number of operators. While here, add a missing `Pp` to make the display block consistent with the one above. Comments? OK? Index: make.1 === RCS file:

dhclient.conf(5): manual tweaks

2017-07-31 Thread Anton Lindqvist
Hi, Some suggestions on how to improve the dhclient.conf(5) manual: - Shorten initial description, inspired by httpd.conf(5). - No need to mention the choice of parser implementation (recursive descent). - Do not use the word `end` twice in the sentence on comments, instead borrow a

Re: dhclient.conf(5): manual tweaks

2017-07-31 Thread Anton Lindqvist
On Mon, Jul 31, 2017 at 07:53:21AM +0100, Jason McIntyre wrote: > On Mon, Jul 31, 2017 at 08:34:02AM +0200, Anton Lindqvist wrote: > > Hi, > > Some suggestions on how to improve the dhclient.conf(5) manual: > > > > - Shorten initial description, inspired by httpd.

Re: less(1) - segmentation fault with '-g'

2017-08-02 Thread Anton Lindqvist
s unnecessary churn. The changes to pattern.c do solve the initial problem as reported by Larry. However, I'm experiencing a crash if I remove the changes to search.c: $ cat in foo bar bar $ less in # type: /!foo > > On 07/28/17 13:32, Anton Lindqvist wrote: > > On Fri, Jul 28,

uplcom(4): add adapter to manual

2017-08-07 Thread Anton Lindqvist
Hi, I recently got an Aten UC232A (Prolific chipset) adapter which is supported by uplcom. Comments? OK? Index: uplcom.4 === RCS file: /cvs/src/share/man/man4/uplcom.4,v retrieving revision 1.26 diff -u -p -r1.26 uplcom.4 ---

Re: less(1): plug memory leak

2017-05-03 Thread Anton Lindqvist
On Mon, May 01, 2017 at 01:36:51PM +0100, Nicholas Marriott wrote: > > looks good, ok nicm Anyone willing to commit? > On Mon, May 01, 2017 at 10:35:59AM +0200, Tobias Stoeckmann wrote: > > Hi, > > > > On Mon, May 01, 2017 at 09:15:45AM +0200, Anton Lindqvist wro

ksh(1): UTF-8 column count bug

2017-05-11 Thread Anton Lindqvist
Hi, I recently encountered a bug in ksh(1)'s emacs mode while running from xterm(1). How-to reproduce: 1. Insert a sequence containing at least one UTF-8 character until the line exceeds the last column, triggering horizontal scroll. 2. Moving backwards using any motion (^A, ^B, ^[b) fails

event(3): mention bufferevent_setwatermark

2017-05-15 Thread Anton Lindqvist
Hi, The bufferevent_setwatermark function is not mentioned in event(3). Maybe the function deserves to be documented under the "BUFFERED EVENTS" section but I know too little about the API to determine if that would be useful. Some docs regarding the function can however be found in the event.h

Re: csh(1): stop blocking SIGINT while calling free()

2017-06-21 Thread Anton Lindqvist
On Wed, Jun 21, 2017 at 09:50:39PM +0200, Anton Lindqvist wrote: > Hi, > Here's a pattern I haven't seen before. This macro is especially hideous > since it make use of the local variable numitems as opposed of items > which is passed as an argument. The previous diff was too agg

csh(1): minor cleanup

2017-06-21 Thread Anton Lindqvist
Hi, Some minor nits discovered while getting rid of TIOCSTI: - Sort and split includes according to style(9) - Get rid of unused stdarg.h - Join defines - Fix indent for COMMAND typedef Comments? OK? Index: file.c === RCS file:

csh(1): stop blocking SIGINT while calling free()

2017-06-21 Thread Anton Lindqvist
Hi, Here's a pattern I haven't seen before. This macro is especially hideous since it make use of the local variable numitems as opposed of items which is passed as an argument. Comments? OK? Index: file.c === RCS file:

Re: ksh(1): don't output invalid UTF-8 characters

2017-06-25 Thread Anton Lindqvist
For reference, I just committed the fix, see message below. Thanks to all who helped out. > CVSROOT: /cvs > Module name: src > Changes by: an...@cvs.openbsd.org 2017/06/25 02:51:53 > > Modified files: > bin/ksh: emacs.c > > Log message: > Don't output partial UTF-8

Re: ksh ^T transpose-chars

2017-06-20 Thread Anton Lindqvist
On Tue, Jun 20, 2017 at 12:51:38PM -0400, Bryan Steele wrote: > In ksh(1), ^T is documented to be bounded to transpose-chars while > in emacs mode, not "x_stuff". While here, remove these poorly > described functions as well.. This change would break any existing user defined binding to either

Re: ksh(1): don't output invalid UTF-8 characters

2017-05-19 Thread Anton Lindqvist
On Fri, May 19, 2017 at 09:33:33AM -0300, Lucas Gabriel Vuotto wrote: > Hi, > > On 19/05/17 03:42, Anton Lindqvist wrote: > > Hi, > > I did submit this problem[1] earlier but with an incomplete analysis and > > fix. Here's a second attempt. > > > >

ksh(1): vi mode UTF-8 bug

2017-05-19 Thread Anton Lindqvist
Hi, Another UTF-8 related bug reported by tb@. How to re-produce: 1. Enable vi mode: $ set -o vi 2. Input the following characters: öa 3. Press escape and then x twice. 4. An invalid UTF-8 character is displayed. Similar to one of my previous diffs, looks like the column counter is wrong.

Re: dsdt: redundant assignment

2017-05-28 Thread Anton Lindqvist
Hi, On Fri, Apr 07, 2017 at 08:06:47AM +0200, Anton Lindqvist wrote: > Ping > > On Sun, Mar 26, 2017 at 07:10:29PM +1100, Jonathan Gray wrote: > > On Sun, Mar 26, 2017 at 09:33:44AM +0200, Otto Moerbeek wrote: > > > On Sun, Mar 26, 2017 at 06:31:41PM +1

Re: ksh(1): vi mode UTF-8 bug

2017-05-28 Thread Anton Lindqvist
Hi Walter, On Sun, May 28, 2017 at 10:56:19AM +0200, Walter Alejandro Iglesias wrote: > > I forgot to Cc this here. > > > - Forwarded message from Walter Alejandro Iglesias <w...@roquesor.com> > - > > From: Walter Alejandro Iglesias <w...@ro

Re: event(3): mention bufferevent_setwatermark

2017-05-19 Thread Anton Lindqvist
Ping On Mon, May 15, 2017 at 07:41:56PM +0200, Anton Lindqvist wrote: > Hi, > The bufferevent_setwatermark function is not mentioned in event(3). > Maybe the function deserves to be documented under the "BUFFERED EVENTS" > section but I know too little about the API to d

ksh(1): don't output invalid UTF-8 characters

2017-05-19 Thread Anton Lindqvist
Hi, I did submit this problem[1] earlier but with an incomplete analysis and fix. Here's a second attempt. This does only occur when running ksh with emacs mode under tmux. How to re-produce: 1. Run ksh under tmux. 2. Input the following characters, without spaces: a (any character) ^B

Re: ksh(1): vi mode UTF-8 bug

2017-05-30 Thread Anton Lindqvist
Hi, On Mon, May 29, 2017 at 04:16:06PM +0200, Ingo Schwarze wrote: > Hi, > > Anton Lindqvist wrote on Sun, May 28, 2017 at 06:07:00PM +0200: > > On Sun, May 28, 2017 at 10:56:19AM +0200, Walter Alejandro Iglesias wrote: > > >> There is still a similar issue when y

Re: KSH bug: case inside command substitution

2017-05-30 Thread Anton Lindqvist
Hi Vadim, On Mon, May 29, 2017 at 05:09:11AM +0300, Vadim Zhukov wrote: > It looks like I've just found a bug in (our) ksh. Not to be brave > enough to fix it right now, but I think it's still worths adding > regression test. > > Bash and zsh pass this test without problem. > > The idea is

Re: ksh(1): vi mode UTF-8 bug

2017-05-31 Thread Anton Lindqvist
On Tue, May 30, 2017 at 04:16:15PM +0200, Theo Buehler wrote: > On Tue, May 30, 2017 at 03:39:50PM +0200, Ingo Schwarze wrote: > > Hi Anton, > > > > OK schwarze@ for the diff below (which, i think, is sufficient for > > commit in this case). > > I agree. This is good for commit. ok tb Thanks,

make tags

2017-05-31 Thread Anton Lindqvist
Hi, The `-t` option was passed to ctags(1) in bsd.dep.mk revision 1.9 2010/03/27. However, the same option was later turned into a no-op but kept around for backwards compatibility (usr.bin/ctags/ctags.c revision 1.23 2010/11/03). OK to drop the option from bsd.dep.mk? Index: bsd.dep.mk

ksh(1): custom completion for command containing hyphens

2017-06-02 Thread Anton Lindqvist
Hi, Custom completions in ksh is currently limited to commands that does not contain hyphens since such a character cannot be part of an identifier. We could cheat and replace hyphens with underscores upon performing completions. The motivation behind this is that I want to add completions for

Re: ksh(1): don't output invalid UTF-8 characters

2017-06-04 Thread Anton Lindqvist
Hi, Although this discussion hasn't settled, here's a new diff trying to address the previously raised issues: - The new function x_e_getu8() tries to read a complete UTF-8 character. When a continuation byte is expected but not received, it resets its state and retries. The fix to u8len()

Re: m4(1): add -E flag support

2017-06-13 Thread Anton Lindqvist
On Tue, Jun 13, 2017 at 03:35:54PM -0400, Brian Callahan wrote: > This diff comes with man page additions explaining the new flag, > as well as a regress test for -E -E behavior. I could not figure > out how to write a regress test that checks for exit status, so > there is no test for single -E

csh(1): move win variable

2017-06-17 Thread Anton Lindqvist
Hi, Tiny diff, move the win variable into print_by_column() since it's the only function using it. Comments? OK? Index: file.c === RCS file: /cvs/src/bin/csh/file.c,v retrieving revision 1.23 diff -u -p -r1.23 file.c --- file.c

csh(1): close less file descriptors

2017-06-14 Thread Anton Lindqvist
Hi, While studying the behavior of csh using ktrace I did notice it trying to close every single fd up to _SC_OPEN_MAX except for the ones in use. This seems a bit excessive, here's a different approach: since the fds in use can vary one can't make assumptions about the largest fd in use. Instead

mailwrapper(8): remove main() prototype

2017-06-14 Thread Anton Lindqvist
Hi, The prototype for main() is inherited from the import of mailwrapper back in 1999. While at it, my understanding is that the envp argument can also be removed since the environ is unaltered. This however requires changing the calls from execve() to execv(). Where execv() is appropriate since

less(1): tab completion for tags

2017-05-04 Thread Anton Lindqvist
Hi, The ability to jump to a tag in less is such a powerful feature that deserves a better interface. Especially in combination with mandoc which emits tags. Here's a diff that adds tab completion for tags, similar to the existing completion for file names. Some notes about the diff: - As I read

Re: less(1): plug memory leak

2017-05-01 Thread Anton Lindqvist
Hi, On Mon, May 01, 2017 at 10:35:59AM +0200, Tobias Stoeckmann wrote: > Hi, > > On Mon, May 01, 2017 at 09:15:45AM +0200, Anton Lindqvist wrote: > > While freeing tag entries, make sure to free the copied strings. > > this patch looks good to me. > > Have you re

less(1): plug memory leak

2017-05-01 Thread Anton Lindqvist
Hi, While freeing tag entries, make sure to free the copied strings. Index: tags.c === RCS file: /cvs/src/usr.bin/less/tags.c,v retrieving revision 1.18 diff -u -p -r1.18 tags.c --- tags.c 17 Sep 2016 15:06:41 - 1.18

Re: [patch] ftp(1): change mtime for http/https links

2017-09-23 Thread Anton Lindqvist
On Fri, Sep 22, 2017 at 11:56:51PM +0100, Raf Czlonka wrote: > On Fri, Sep 22, 2017 at 11:01:57PM BST, Jesper Wallin wrote: > > Hi all, > > > > My morning routine consists of downloading the latest snapshot files and > > running the upgrade. To avoid wasting bandwidth and time, I check the > >

ctags(1): missing space between tag and line number

2017-10-05 Thread Anton Lindqvist
Hi, Running `ctags -x` on a file including a tag which satisfies strlen(tag) >= 16 and line number >= 1000 corrupts the output since there's no space between the tag and line number. Therefore, add a space between them just like ectags and uctags in ports does. $ ctags -x /sys/dev/usb/umass.c |

Re: ctags(1): missing space between tag and line number

2017-10-10 Thread Anton Lindqvist
Ping On Thu, Oct 05, 2017 at 10:41:09AM +0200, Anton Lindqvist wrote: > Hi, > Running `ctags -x` on a file including a tag which satisfies strlen(tag) > >= 16 and line number >= 1000 corrupts the output since there's no space > between the tag and line number. Therefore, add a

Re: dirty1, for those w/vanishing memory to keep up w/multiple cu's

2017-10-16 Thread Anton Lindqvist
On Sun, Oct 15, 2017 at 10:45:53AM +0300, Artturi Alm wrote: > Hi, > > i've been saving time+frustration for having had this, but i'm not proposing > anything, i'm aware how this what most likely exists only because of how badly > scripts stick w/me across reinstalls/need of backups, compared to

Re: apmd: manual tweak

2017-10-16 Thread Anton Lindqvist
On Mon, Oct 16, 2017 at 03:57:22PM +0100, Jason McIntyre wrote: > On Mon, Oct 16, 2017 at 04:06:59PM +0200, Anton Lindqvist wrote: > > Hi, > > A proposal on improving the `-t` option documentation. Most importantly, > > remove the recursive reference to the op

Re: apmd: manual tweak

2017-10-16 Thread Anton Lindqvist
On Mon, Oct 16, 2017 at 06:10:02PM +0100, Jason McIntyre wrote: > On Mon, Oct 16, 2017 at 06:38:31PM +0200, Anton Lindqvist wrote: > > > > Good call. Without knowing too much about the apmd internals, here's a > > first stab. As I read the code, the period polling is also use

acpi: free() size

2017-10-11 Thread Anton Lindqvist
Hi, Add missing size to free(), tested on amd64. Comments? OK? Index: dsdt.c === RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v retrieving revision 1.234 diff -u -p -r1.234 dsdt.c --- dsdt.c 28 May 2017 15:36:45 - 1.234 +++

apmd: manual tweak

2017-10-16 Thread Anton Lindqvist
Hi, A proposal on improving the `-t` option documentation. Most importantly, remove the recursive reference to the option being documented. Comments? OK? Index: apmd.8 === RCS file: /cvs/src/usr.sbin/apmd/apmd.8,v retrieving

csh(1): zap redundant assignment

2017-08-30 Thread Anton Lindqvist
Comments? OK? Index: lex.c === RCS file: /cvs/src/bin/csh/lex.c,v retrieving revision 1.24 diff -u -p -r1.24 lex.c --- lex.c 23 Jan 2017 04:53:15 - 1.24 +++ lex.c 30 Aug 2017 07:09:50 - @@ -1426,7 +1426,6 @@

clang-local(1): typo

2017-09-13 Thread Anton Lindqvist
undesriable -> undesirable; ok? Index: clang-local.1 === RCS file: /cvs/src/share/man/man1/clang-local.1,v retrieving revision 1.9 diff -u -p -r1.9 clang-local.1 --- clang-local.1 29 Jul 2017 21:01:13 - 1.9 +++

csh(1): paste long lines

2017-08-28 Thread Anton Lindqvist
Hi, deraadt@ discovered that pasting long lines in csh with filec enabled is currently broken. NUL-terminating the input buffer from tenex() instructs csh that the buffer contains a complete command. This is wrong and should only happen when buffer is not full, otherwise more data has to be read

Re: libfuse: signal handler doesn't cater for "Device busy" and other errors

2017-11-10 Thread Anton Lindqvist
On Fri, Nov 10, 2017 at 09:36:25AM +0100, Martin Pieuchot wrote: > On 09/11/17(Thu) 09:02, Helg Bredow wrote: > > The current libfuse signal handling assumes that the file system will > > always be unmounted by the child. One obvious case where this is not true > > is if the file system is busy.

csh(1): minor tweaks

2017-11-14 Thread Anton Lindqvist
Hi, In revision 1.35 of file.c tenex() was modified to respect the inputline_size argument. I did miss one conditional which depends on the size of the input buffer. This change does not cause any functional change since tenex() only has one call site where `inputline_size == sizeof(buf)` but for

Re: ksh(1): kill the "version" function

2017-11-26 Thread Anton Lindqvist
On Sun, Nov 26, 2017 at 07:27:37PM +0100, Jeremie Courreges-Anglas wrote: > On Tue, Nov 21 2017, Anton Lindqvist <an...@openbsd.org> wrote: > > Hi, > > While writing tests for the Emacs editing mode in ksh I discovered some > > potential errors in the manual: >

Re: csh: NULL checks before free()

2017-12-16 Thread Anton Lindqvist
On Fri, Dec 15, 2017 at 05:03:40PM +0800, Michael W. Bombardieri wrote: > Hello, > > Previously in csh(1) the xfree() function was removed in favour > of regular free(). This patch removes a couple of NULL checks > before free(). Committed, thanks!

Re: one XXX in ksh(1)

2017-12-18 Thread Anton Lindqvist
On Mon, Dec 18, 2017 at 03:18:37PM +0800, Michael W. Bombardieri wrote: > Hello, > > In my understanding the reason why texec had to be static was > because the struct member ioact was never initialised. > The call tree is execute() -> comexec() -> exchild() -> execute() > and a fork happens in

Re: one XXX in ksh(1)

2017-12-18 Thread Anton Lindqvist
On Mon, Dec 18, 2017 at 08:37:17PM +0100, Anton Lindqvist wrote: > On Mon, Dec 18, 2017 at 03:18:37PM +0800, Michael W. Bombardieri wrote: > > Hello, > > > > In my understanding the reason why texec had to be static was > > because the struct member ioact was never ini

Re: csh dounsetenv()

2017-12-18 Thread Anton Lindqvist
On Sun, Dec 17, 2017 at 05:54:23PM +0800, Michael W. Bombardieri wrote: > Hello, > > The free() at the top of dounsetenv() in csh(1) isn't needed > because name is always freed before returning at bottom of function. > Also, name itself is never returned so it doesn't need to be static. > >

Re: ksh: make home & end keys work out-of-the-box in the console

2017-12-18 Thread Anton Lindqvist
On Sat, Dec 16, 2017 at 01:58:49PM +0200, Lari Rasku wrote: > Tested with vt220 and wsvt25. Hopefully we're close to exhausting > all the different ways to encode these keys by now. > > diff --git bin/ksh/emacs.c bin/ksh/emacs.c > index 07bfbd914..4291ce656 100644 > --- bin/ksh/emacs.c > +++

Re: ksh: make home & end keys work out-of-the-box in the console

2017-12-18 Thread Anton Lindqvist
On Mon, Dec 18, 2017 at 06:29:46PM +0100, Anton Lindqvist wrote: > On Sat, Dec 16, 2017 at 01:58:49PM +0200, Lari Rasku wrote: > > Tested with vt220 and wsvt25. Hopefully we're close to exhausting > > all the different ways to encode these keys by now. > > > > diff --

ksh: stop emitting carriage return twice

2017-12-12 Thread Anton Lindqvist
Hi, Here's a little nit that has been bugging me while writing tests for Emacs editing mode in ksh. Since the map-CR-to-NL (ONLCR) output mode is enabled by default on the tty, emitting a newline gets translated into a carriage return (CR) followed by newline (NL). Parts of the Emacs related code

ksh(1): manual tweaks

2017-11-21 Thread Anton Lindqvist
Hi, While writing tests for the Emacs editing mode in ksh I discovered some potential errors in the manual: - Sync the order of key bindings in emacs.c with the manual - ^W is bound to delete-word-backward and not kill-region which is mentioned in emacs.c. I don't know the full history here...

  1   2   >