Re: ports vs mandoc, the links

2016-05-09 Thread Ingo Schwarze
Hi Marc, Marc Espie wrote on Mon, May 09, 2016 at 04:06:06PM +0200: > Source has been wiped out of extraneous links... looks like some ports > could be too (just took a random sample: bzip2) > > No idea whether we need some automated tool, or just @commenting out > the extra entry in PLIST

Re: sqlite c api manpages?

2016-05-05 Thread Ingo Schwarze
Hi Kristaps, Kristaps Dzonsons wrote on Tue, May 03, 2016 at 09:24:49PM +0200: > Ingo Schwarze wrote: >> Ted Unangst wrote: >>> We should provide documentation for at least the programmatic >>> aspects of it. (The full extent of SQL language documentation >>

Re: vm.conf.5 - number of sections

2016-05-05 Thread Ingo Schwarze
Hi, Mike Larkin wrote on Wed, May 04, 2016 at 06:44:24AM -0700: > On Wed, May 04, 2016 at 02:21:50PM +0200, Michal Mazurek wrote: >> It seems that there are only two sections. It looks like this mistake >> was introduced when copying a different .conf.5 file to use as a template. >> >> Index:

Re: mklocale(1): TODIGIT > 255 clobbers type and width data

2016-05-03 Thread Ingo Schwarze
Hi, here is an alternative patch simply removing the pointless and buggy code. No functional change on OpenBSD, except that unrelated functionality is no longer clobbered, of course. Do you prefer that? Yours, Ingo Index: yacc.y

Re: sqlite c api manpages?

2016-05-03 Thread Ingo Schwarze
Hi Ted, Ted Unangst wrote on Mon, May 02, 2016 at 02:46:43PM -0400: > Kristaps Dzonsons wrote: >> If you're on OpenBSD, you started with "apropos -s3 sqlite3", were >> shocked that there's nothing there, then moved on to Google with a >> wounding confusion in your heart. > Indeed. I see this

Re: mklocale(1): TODIGIT > 255 clobbers type and width data

2016-05-02 Thread Ingo Schwarze
Hi, Andrew Fresh wrote on Mon, May 02, 2016 at 11:55:52AM -0700: > On Mon, May 02, 2016 at 08:34:43PM +0200, Ingo Schwarze wrote: >> The following patch fixes the bug by limiting digit values to >> the range 0x00 to 0xff that our LC_CTYPE file format can actually >> store.

mklocale(1): TODIGIT > 255 clobbers type and width data

2016-05-02 Thread Ingo Schwarze
Hi, when mklocale(1) input - the only relevant input file for us being /usr/src/share/locale/ctype/en_US.UTF-8.src - contains a line TODIGIT < character(s) digit > where digit is greater than 0xff, mklocale(1) clobbers character type and character width data for the specified character(s).

Re: tmux(1): dealing with broken wcwidth(3)

2016-04-29 Thread Ingo Schwarze
Hi Nic, Nicholas Marriott wrote on Fri, Apr 29, 2016 at 10:08:18AM +0100: > If this was just guaranteed nonprintable characters, there would be no > issue. But the problem is that some platforms are missing genuine UTF-8 > characters and since many terminals do not use wcwidth(), it means that >

Re: httpd: httpd.conf(5): text/plain for .txt

2016-04-28 Thread Ingo Schwarze
Hi, Hiltjo Posthuma wrote on Wed, Apr 27, 2016 at 03:13:38PM +0200: > For text content the response HTTP header "Content-Type: text/plain" > is commonly used. This patch changes it in the httpd.conf(5) > documentation: Committed, thanks. Ingo > Index: httpd.conf.5 >

Re: tmux(1): dealing with broken wcwidth(3)

2016-04-28 Thread Ingo Schwarze
Hi Nic, Nicholas Marriott wrote on Thu, Apr 28, 2016 at 01:11:44PM +0100: > tmux is not some sort of terminal firewall. Of course we try to avoid > anything obviously stupid, but we also want stuff that works outside > tmux to also work inside. [...] > Assuming a width of 1 where we can't get a

Re: tmux(1): dealing with broken wcwidth(3)

2016-04-28 Thread Ingo Schwarze
Hi Nic, Nicholas Marriott wrote on Wed, Apr 27, 2016 at 03:36:25AM -0600: > CVSROOT: /cvs > Module name: src > Changes by: n...@cvs.openbsd.org2016/04/27 03:36:25 > > Modified files: > usr.bin/tmux : utf8.c > > Log message: > Loads of platforms appear to have old or broken

libedit: delete vi-histedit editor command

2016-04-16 Thread Ingo Schwarze
Hi, in vi command mode, libedit provides the editor command vi-histedit (bound to the 'v' key by default) to fork and exec vi(1) on the line being edited. That is pretty much pointless in the first place because the line can just as well be edited with libedit itself, without any fork and exec.

Re: manual section search order

2016-04-12 Thread Ingo Schwarze
Hi, Ted Unangst wrote on Tue, Apr 12, 2016 at 03:37:42PM -0400: > Marc Espie wrote: >> I think that in this day and age, the query? syntax is cumbersome I fully agree, the query syntax is obsolete for deep linking. It is supported for the HTML form frontend and for backward compatibility only.

Re: manual section search order

2016-04-12 Thread Ingo Schwarze
Hi Mike, Mike Belopuhov wrote on Tue, Apr 12, 2016 at 08:41:16PM +0200: > why is 3p still on the "sections" list in the fs_search? > Just a lookup optimization? No. The purpose of the function fs_search() is not optimization, but fallback. If the requested manual is found in a database, that

Re: mg - sentence-end-double-space

2016-04-12 Thread Ingo Schwarze
Hi Mark, Mark Lumsden wrote on Tue, Apr 12, 2016 at 06:47:40PM +: > This diff allows a single space for sentence delimitation. > ok/comments/objections? No objection, but a comment. Note that *using* the option is destructive. Once you have replaced double spaces at the ends of sentences

Re: manual section search order

2016-04-12 Thread Ingo Schwarze
Hi Mike, Mike Belopuhov wrote on Tue, Apr 12, 2016 at 08:01:23PM +0200: > IMO it's a very bad idea to hardcode "3p/" like that. > Aren't there packages using other funny section names? Packages are in a different manual tree /usr/local/man/, which gets lower priority than /usr/share/man/ in the

manual section search order

2016-04-12 Thread Ingo Schwarze
[moved to tech@, source-changes is not ideal for discussions] Marc Espie wrote on Tue, Apr 12, 2016 at 03:44:34PM +0200: > On Tue, Apr 12, 2016 at 11:24:40PM +1000, Jonathan Gray wrote: >> On Tue, Apr 12, 2016 at 02:36:09PM +0200, Marc Espie wrote: >>> On Tue, Apr 12, 2016 at 08:18:33PM +1000,

Re: pledge: document "mcast" promise

2016-04-12 Thread Ingo Schwarze
Hi Sebastien, Sebastien Marie wrote on Tue, Apr 12, 2016 at 05:09:45PM +0200: > "mcast" promise isn't documented (used in eigrpd, ldpd, ospfd, and > route6d). > > This promise allows only some options with getsockopt(2)/setsockopt(2): > > - IPV6_MULTICAST_IF : Get or set the interface from

Re: pledge.2: sync list of syscalls with kern_pledge.c

2016-04-11 Thread Ingo Schwarze
Hi Philip, Philip Guenther wrote on Sun, Apr 10, 2016 at 08:16:21PM -0700: > On Sun, Apr 10, 2016 at 9:16 AM, Ingo Schwarze <schwa...@usta.de> wrote: >> By the way, since sendsyslog(2) is only intended to be called by >> syslog(3) and not directly by application cod

Re: add "route" promise to pledge.2

2016-04-11 Thread Ingo Schwarze
Hi Sebastien, Sebastien Marie wrote on Mon, Apr 11, 2016 at 11:18:34AM +0200: > Comments ? OK schwarze@. You may want to consider the nits below, but my OK doesn't depend on them. By the way, the sysctl(3) manual seems to be lacking information about NET_RT_TABLE, if somebody wants to look

Re: pledge.2: sync list of syscalls with kern_pledge.c

2016-04-10 Thread Ingo Schwarze
Hi, Theo Buehler wrote on Sun, Apr 10, 2016 at 01:43:17PM +0200: > This is a first stab at updating the list of syscalls in the pledge(2) > manpage and at the same time I'd like to clarify some simple things. I sympathise a lot with the idea to make this page as accurate as possible. To me,

Re: scp(1), sftp(1): unsafe terminal output string handling

2016-04-04 Thread Ingo Schwarze
err = -1; break; } - printf("Local working directory: %s\n", path_buf); + mprintf("Local working directory: %s\n", path_buf); break; case I_QUIT: /* Processed below

Re: Aq macro replacements

2016-03-31 Thread Ingo Schwarze
Hi Christian, Christian Heckendorf wrote on Sun, Mar 27, 2016 at 11:03:02PM -0400: > - spamd-setup(8) is referring to pf tables. syslogd(8) and tcpdump(8) >use Aq to format program I/O examples. None of these instances use >mathematical unicode symbols in practice. Fixed differently.

Re: www.openbsd.org/cgi-bin/man.cgi

2016-03-25 Thread Ingo Schwarze
Hi Gilles, Gilles Chehade wrote on Fri, Mar 25, 2016 at 03:34:02PM +0100: > maybe we could provide MaaS (man as a service, copyright eric@) > > if user issues `man` and the man page is not found locally, man > would transparently ssh to gu...@man.openbsd.org ? Hilarious on so many levels...

Re: www.openbsd.org/cgi-bin/man.cgi

2016-03-25 Thread Ingo Schwarze
Hi Craig, Craig Skinner wrote on Wed, Mar 23, 2016 at 10:07:10AM +: > On 2016-03-22 Tue 22:49 PM |, Bob Beck wrote: >> A few years back, Ingo moved it to the new mandoc based man.cgi, and >> now we've actually moved this to a dedicated place - "man.openbsd.org" > Superb. > > What's next? >

Re: www.openbsd.org/cgi-bin/man.cgi

2016-03-23 Thread Ingo Schwarze
Hi, Bob Beck wrote on Tue, Mar 22, 2016 at 10:49:37PM -0600: > This has been our constant friend for many many years. I babied some > truly horrible perl that did this, along with some nasty things to > extract the old man pages for many years. > > It is now no more. > > A few years back,

Re: [patch] NULL check in libedit

2016-03-22 Thread Ingo Schwarze
Hi Martijn, Martijn van Duren wrote on Tue, Mar 22, 2016 at 09:57:33AM +0100: > I found this one by exiting bc -l via ^D. > It should be fine since ct_encode_string also returns NULL > when tmp is NULL. Oops, indeed, sorry for overlooking that edge case. Completely correct. > OK? OK

scp(1), sftp(1): unsafe terminal output string handling

2016-03-15 Thread Ingo Schwarze
mbsprintf("%-*s", colspace, tmp); if (m >= columns) { printf("\n"); m = 1; @@ -2036,7 +2042,7 @@ interactive_loop(struct sftp_conn *conn, if (remote_is_dir(conn, dir) && file2 ==

Re: remove 'returns no value' from man pages

2016-03-12 Thread Ingo Schwarze
Hi Michael, Michael McConville wrote on Fri, Mar 11, 2016 at 05:18:52PM -0800: > This is specified only irregularly, and people who don't know what a > void return type means are beyond help anyway. I don't feel strongly either way, but i certainly don't object. Usually shorter with the same

Re: head(1) -c

2016-03-12 Thread Ingo Schwarze
Hi, Daniel Dickman wrote on Thu, Mar 10, 2016 at 02:11:49PM -0500: > ps. if I'm reading things right, "head -c" will be in Posix, Issue 8. > http://austingroupbugs.net/view.php?id=407#c743 Oh indeed, thanks for digging up that decision, useful indeed. Well, that definitely settles the matter.

Re: head(1) -c

2016-03-10 Thread Ingo Schwarze
Hi, two general remarks: 1) The head(1) utility is supposed to handle text files. Our manual page doesn't mention that technicality - in general, our manuals avoid excessive technicality in favour of readability - but POSIX is explicit: "Input files shall be text files, but

Re: improve xterm(1) resilience against control code attacks

2016-03-07 Thread Ingo Schwarze
Hi Christian, Christian Weisgerber wrote on Mon, Mar 07, 2016 at 03:51:41PM +: > On 2016-03-07, Ingo Schwarze <schwa...@usta.de> wrote: >> Consequently, in the interest of safe and sane defaults, i propose >> switching our xterm(1) to enable UTF-8 mode by default. >

Re: ptrace.2: document PT_GET_THREAD_FIRST and PT_GET_THREAD_NEXT

2016-03-07 Thread Ingo Schwarze
Hi Philip, Philip Guenther wrote on Sat, Mar 05, 2016 at 09:35:58PM -0800: > Side note: best practice is to run "mandoc -Tlint -Wwarning" > on manpages after making changes. True. In case you are still training your finger memory, just mandoc -Tlint is enough, it already implies -Wall ==

improve xterm(1) resilience against control code attacks

2016-03-06 Thread Ingo Schwarze
Hi, if two programs communicating encoded character strings to each other disagree about the encoding, that can result in problems. One particular example of such communication is an application program passing output text to a terminal emulator program. If the terminal uses a different

Re: [patch] add UTF-8 support to column(1)

2016-02-28 Thread Ingo Schwarze
Hi Nicholas, Nicholas Marriott wrote on Sun, Feb 28, 2016 at 04:21:15PM +: > I don't know why it is off in xterm but oxtabs is the default in > ttydefaults.h and appears to on for mostly everything else, > including ssh and tmux (which just uses what forkpty gives it). That means that even

Re: [patch] add UTF-8 support to column(1)

2016-02-28 Thread Ingo Schwarze
Hi Martijn, Martijn van Duren wrote on Sat, Feb 27, 2016 at 01:22:53PM +0100: > Here's my attempt to implement UTF-8 support in column(1). > Besides the general UTF-8 conversions it does several other things > to make it behave properly. Two general remarks: 1. This column(1) code seems to be

libedit audit

2016-02-26 Thread Ingo Schwarze
Hi, i have begun an audit of libedit. I will post a selection of the most important diffs here, but in order to not overwhelm the list, not all of them. If you like to see all of them, please tell me privately and you'll be in the loop. Actually, i'd love it if one or two additional people

Re: hexdump(1) - bug when skip == sb.st_size

2016-02-08 Thread Ingo Schwarze
Hi, Michal Mazurek wrote on Mon, Feb 08, 2016 at 02:11:19PM +0100: > When running > hexdump -s $NUM file > where NUM is the size of the file, hexdump will print the entire file, > instead of skipping over the content. This looks correct and works for me. OK to commit? Ingo > "od -j

Re: mbtowc(3) errno for incomplete character

2016-02-06 Thread Ingo Schwarze
Hi, Todd C. Miller wrote on Sat, Feb 06, 2016 at 03:33:08PM -0700: > This makes sense to me. It is possible that the author mistakenly > believed the mbrtowc(3) manual. Absolutely possible. That's why documentation is so important. Bugs in documenation usually breed bugs in code. So i guess

mbtowc(3) errno for incomplete character

2016-02-05 Thread Ingo Schwarze
Hi, here is a very wide-spread bug, affecting all operating systems i was able to check. What happens if an incomplete character is passed to mbtowc(3)? POSIX is quite clear: If s is not a null pointer, mbtowc() shall either return 0 (if s points to the null byte), or return the number of

Re: mbtowc(3) errno for incomplete character

2016-02-05 Thread Ingo Schwarze
Hi Stefan, Stefan Sperling wrote on Fri, Feb 05, 2016 at 04:06:50PM +0100: > On Fri, Feb 05, 2016 at 03:53:44PM +0100, Ingo Schwarze wrote: >> Index: mbtowc.c >> === >> RCS file: /cvs/src/lib/libc/locale/mbt

Re: Some df(1) cleanup

2016-02-05 Thread Ingo Schwarze
Hi, Theo Buehler wrote on Mon, Feb 01, 2016 at 06:23:33PM +0100: > On Mon, Feb 01, 2016 at 05:41:25PM +0100, Theo Buehler wrote: >> On Mon, Feb 01, 2016 at 05:17:03PM +0100, Michal Mazurek wrote: >>> mntbuf = calloc(argc, sizeof(struct statfs)); >>> if (mntbuf == NULL)

Re: Replace less(1)'s stdbool clone with the real McCoy

2016-01-29 Thread Ingo Schwarze
Hi Michael, Michael McConville wrote on Fri, Jan 29, 2016 at 11:33:50AM -0500: > Does this make sense? We usually don't use bool, it is pointless. I'd say leave the type as int, just delete the silly macros, and use 0 and 1 directly. Yours, Ingo

Re: /usr/src/usr.sbin/lpr/common_source/rmjob.c diff

2016-01-26 Thread Ingo Schwarze
Hi Theo, Theo Buehler wrote on Wed, Jan 27, 2016 at 12:04:43AM +0100: > Todd Millert wrote: >> Please don't, alarm(3) is perfectly fine to be using. We should >> probably remove that line from the manual. > The comment of alarm being made obsolete by setitimer has been there > for 30 years: >

RCS: Mdocdate expansion

2016-01-25 Thread Ingo Schwarze
Hi, tj@ just noticed that our RCS still doesn't know how to expand Mdocdate. One consequence is that rcsdiff(1) shows wrong Mdocdate lines - typically, for each revision, the ones from the previous revision. That in turn causes cvsweb to show wrong Mdocdate lines in diffs. I'm showing the

Re: Willing to help

2016-01-25 Thread Ingo Schwarze
Hi, Rodrigo Mosconi wrote on Mon, Jan 25, 2016 at 06:54:32PM -0200: > I would like to receive some help/mentoring. Please don't reply on tech@, this is off-topic here. I replied on misc@. Yours, Ingo

Re: Writing Documentation

2016-01-23 Thread Ingo Schwarze
Hi Timo, Timo wrote on Sat, Jan 23, 2016 at 10:46:55AM +0200: > On 23/01/2016 10:44, Martijn van Duren wrote: >> On 01/23/16 09:35, Timo wrote: >>> Hi who is responsible for writing documentation for OpenBSD? >>> I'd like to get involved in writing documentation for OpenBSD Nice to hear that.

Re: bug in fputwc(3) error reporting

2016-01-23 Thread Ingo Schwarze
Hi, Ingo Schwarze wrote on Sun, Jan 10, 2016 at 10:22:28PM +0100: > Todd C. Miller wrote on Sun, Jan 10, 2016 at 12:33:07PM -0700: >> On Sun, 10 Jan 2016 19:55:53 +0100, Ingo Schwarze wrote: >>> So, my conclusion is that it's the C standard that is carelessly >>>

Re: security(8) mailbox check question

2016-01-23 Thread Ingo Schwarze
Hi, the smtpd(8) daemon supports "deliver to maildir" out of the box, and even though putting the user maildirs below /var/mail/ is not the default, it's one of many possible and logical choices, and i see nothing wrong with it. Adam Wolk noticed on misc@ that currently security(8) doesn't like

Re: [patch] ls + utf-8 support

2016-01-17 Thread Ingo Schwarze
And now with the patch... - Forwarded message from Ingo Schwarze <schwa...@usta.de> - From: Ingo Schwarze <schwa...@usta.de> Date: Sun, 17 Jan 2016 21:37:56 +0100 To: Stuart Henderson <st...@openbsd.org>, Ted Unangst <t...@tedunangst.com> Cc: Mart

Re: [patch] ls + utf-8 support

2016-01-17 Thread Ingo Schwarze
Hi, Stuart Henderson wrote on Sun, Jan 17, 2016 at 07:46:23PM +: > On 2016/01/17 14:29, Ted Unangst wrote: >> Ingo Schwarze wrote: >>> The old ls(1) also weeded out non-printable bytes, in particular >>> control codes. >> The old ls only had th

Re: [patch] ls + utf-8 support

2016-01-17 Thread Ingo Schwarze
Hi Martijn, Martijn van Duren wrote on Sun, Jan 17, 2016 at 12:58:38PM +0100: > I've come across a fair amount of malformed file names by all sorts > of causes. Be it malware or just human error. When such a malformed > character is in an inconvenient place and can't be auto-completed > I

Re: start UTF-8 support for ksh(1) vi editing mode

2016-01-17 Thread Ingo Schwarze
Hi Martin, hi Theo, thank you for your feedback! Martijn van Duren wrote on Sun, Jan 17, 2016 at 12:06:26PM +0100: > When applying this patch and running in an environment without an > UTF-8 LC_ALL or LC_CTYPE the isu8cont gives the reverse problem of > the current ksh having UTF-8 filenames

start UTF-8 support for ksh(1) vi editing mode

2016-01-16 Thread Ingo Schwarze
Hi, the last few days i basically dug in to focus on understanding the vi editing mode in ksh(1). Given the quick partial success with the emacs mode, i hoped that the usual 20/80 rule might apply. However, the code implementing vi mode seems substantially more contorted to me than the code

Re: UTF-8 support for colrm(1)

2016-01-10 Thread Ingo Schwarze
Hi, Ingo Schwarze wrote on Wed, Dec 23, 2015 at 07:44:05PM +0100: > Steffen Nurpmeso wrote on Wed, Dec 23, 2015 at 11:45:36AM +0100: >> Ingo Schwarze <schwa...@usta.de> wrote: >>> For example, colrm(1). [Regarding one of the various bugs in FreeBSD:] >>> 4

Re: bug in fputwc(3) error reporting

2016-01-10 Thread Ingo Schwarze
Hi, Ted Unangst wrote on Wed, Dec 30, 2015 at 01:22:17AM -0500: > Philip Guenther wrote: >> On Tue, Dec 29, 2015 at 2:34 PM, Todd C. Miller wrote: >>> Since POSIX defers to ISO C we should be following the ISO C standard >>> with respect to behavior when an encoding error occurs. As such, >>>

Re: bug in fputwc(3) error reporting

2016-01-10 Thread Ingo Schwarze
Hi Todd, Todd C. Miller wrote on Sun, Jan 10, 2016 at 12:33:07PM -0700: > On Sun, 10 Jan 2016 19:55:53 +0100, Ingo Schwarze wrote: >> So, my conclusion is that it's the C standard that is carelessly >> worded, not POSIX. I don't think the C standard intends to say >> that

Re: Clarify fold(1)

2016-01-05 Thread Ingo Schwarze
Hi, Philip Guenther wrote on Tue, Jan 05, 2016 at 12:17:13AM -0800: > On Mon, Jan 4, 2016 at 11:15 PM, Michal Mazurek <akf...@jasminek.net> wrote: >> On 01:24:35, 5.01.16, Ingo Schwarze wrote: >>> +If an output line would be broken after a non-blank character but &g

ksh(1) emacs mode: more UTF-8 fixes

2016-01-05 Thread Ingo Schwarze
Hi, here are two very simple fixes for ksh(1) emacs input mode. The first hunk lets you insert non-ASCII UTF-8 characters without screwing up the display. Specifically, after inserting a continuation byte, it backs up to the start byte and starts re-printing there. The second hunk fixes

ksh(1) emacs mode: UTF-8 support for word handling

2016-01-05 Thread Ingo Schwarze
Hi, this very simple diff provides partial, naive UTF-8 support for word handling in ksh(1) emacs mode. It improves all functions involving words (forward-word, backward-word, delete-word-forward, delete-word-backward, downcase-word, upcase-word, capitalize-word) by allowing non-ASCII

Re: new expr(1)

2016-01-05 Thread Ingo Schwarze
Hi, Ted Unangst wrote on Tue, Jan 05, 2016 at 03:10:05PM -0500: > Rafael Sadowski wrote: >> $ mem=`sysctl -n hw.usermem` >> $ echo $mem >> 8302469120 >> $ expr $mem + 1 >> -287465471 >> >> OpenBSD's expr can only process values between -2147483648 >> and +2147483647. According to

Re: remove language catalogs from vi

2016-01-05 Thread Ingo Schwarze
Hi, Martijn van Duren wrote on Mon, Jan 04, 2016 at 05:16:57PM +0100: > On 12/02/15 20:36, Martijn van Duren wrote: >> I've had a discussion with bentley@ about some patches for vi. >> Some of which I've send to Zhihao from the nvi2 project to keep >> the projects somewhat in sync. I'm still

Re: xr mktime

2016-01-04 Thread Ingo Schwarze
Hi Ted, Ted Unangst wrote on Wed, Dec 30, 2015 at 11:51:34AM -0500: > Neither strftime nor strptime describe the fields inside struct tm, > and while they eventually point that way in references, strftime > provides no guidance as to which of its nine (9!) references > I should read next. I

Re: HISTORY and AUTHORS for rs(1), lam(1), jot(1)

2016-01-04 Thread Ingo Schwarze
Hi, Michal Mazurek wrote on Mon, Jan 04, 2016 at 09:08:58PM +0100: > These are FreeBSD commits 731fe330c9 and 739c57d8c2. A request > from what appears to be the author himself prompted these changes: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196786 > And a comment in the source files

Re: Clarify fold(1)

2016-01-04 Thread Ingo Schwarze
Hi, Michal Mazurek wrote on Mon, Jan 04, 2016 at 08:27:50PM +0100: > Fold line after the last blank character within the first > .Ar width > column positions (or bytes). > +If a blank character does not exist within the width, then > +a longer line will still be split at the width. > The

Re: bugs in printf(3)

2016-01-04 Thread Ingo Schwarze
Hi Todd, Todd C. Miller wrote on Mon, Dec 28, 2015 at 10:46:08AM -0700: > On Fri, 25 Dec 2015 00:30:29 +0100, Ingo Schwarze wrote: >> Besides, i don't see the point in messing with FILE flags at all >> in case of encoding errors. As opposed to fgetwc(3) and fputwc(3), >&g

Re: memory leak in libc

2015-12-25 Thread Ingo Schwarze
Hi Fritjof, frit...@alokat.org wrote on Fri, Dec 25, 2015 at 11:56:33AM +0100: > it looks like there is a memory leak in libc. > In file "src/lib/libc/stdio/makebuf.c" line 62 malloc(3) is called, > but never freed, when printf(3) is called. I think that's a false positive. The pointer to the

Re: memory leak in libc

2015-12-25 Thread Ingo Schwarze
Hi Mark, Mark Kettenis wrote on Fri, Dec 25, 2015 at 12:30:43PM +0100: > frit...@alokat.org wrote: >> it looks like there is a memory leak in libc. In file >> "src/lib/libc/stdio/makebuf.c" line 62 malloc(3) is called, but >> never freed, when printf(3) is called. > Not really a leak. That

Re: bugs in printf(3)

2015-12-25 Thread Ingo Schwarze
Hi, more is broken in printf(3). Ingo Schwarze wrote on Fri, Dec 25, 2015 at 12:30:29AM +0100: > Fourth file, fourth broken file. > This is the worst bug found so far. [...] > When fprintf(fp, "...%ls...", ...) encounters an encoding error, > it trashes fp BEYOND REPAIR, c

Re: utf8 input in el_gets(3)

2015-12-24 Thread Ingo Schwarze
Hi Christian & Michael, Michael McConville wrote on Thu, Dec 24, 2015 at 04:19:03PM -0500: > Christian Heckendorf wrote: >> A couple of somewhat recent changes in NetBSD's libedit permit >> el_gets(3) to accept multibyte characters if the locale supports >> it. Ugh. The amount of indirection

bugs in printf(3)

2015-12-24 Thread Ingo Schwarze
Fourth file, fourth broken file. This is the worst bug found so far. All i'm doing is grepping libc/stdio for "EILSEQ". So far, every single instance i looked at was buggy. I think we should cvs rm libc. The code quality just isn't up to OpwnBSD standards. When fprintf(fp, "...%ls...", ...)

bug in fputwc(3) error reporting

2015-12-24 Thread Ingo Schwarze
Third file, third bug. SO FAR, EACH AND EVERY BLOODY PLACE I LOOKED AT WAS BROKEN. When fputwc(3) encounters an encoding error, it neglects to set the error indicator, just like fgetwc(3) did before i fixed it today. Setting the error indicator is required by the manual and by the standard.

bug in fgetws(3) EOF detection

2015-12-24 Thread Ingo Schwarze
Crap alert. Seriously. My impression is, whereever you look in the wide character functions in our libc, it's broken. At least, i looked at two files of twenty lines each and found a bug in each of them. I don't believe in luck. I expect more cheap targets. When errno happens to be EILSEQ

fgetwc(3) error reporting bug

2015-12-23 Thread Ingo Schwarze
Hi, i just noticed a bug in fgetwc(3) in our libc, the function used to implement getwc(3), getwchar(3), getws(3), getwln(3) and the wscanf(3) family of functions. In case of an encoding error, it does not set the error indicator, such that a program correctly checking ferror(3) after WEOF may

Re: UTF-8 support for colrm(1)

2015-12-23 Thread Ingo Schwarze
Hi Steffen, Steffen Nurpmeso wrote on Wed, Dec 23, 2015 at 11:45:36AM +0100: > Ingo Schwarze <schwa...@usta.de> wrote: >> For example, colrm(1). >> >> 4. The backspace character (U+0008) backs up by one display position >>rather than by one charact

UTF-8 support for colrm(1)

2015-12-22 Thread Ingo Schwarze
Hi, the most important small base system utilities fixed with respect to the most important UTF-8 issues (or at least having patches on tech@), i still didn't encounter a single case where a function written for one utility could be reused in another. So before tackling larger beasts like shells

Re: UTF-8 support for fmt(1)

2015-12-16 Thread Ingo Schwarze
Hi, Ingo Schwarze wrote on Tue, Dec 08, 2015 at 10:37:29PM +0100: > here is UTF-8 support for fmt(1). > This does not include the -c case; the patch is already large enough. Meanwhile, i committed that. Here is a simple solution for the -c case. The loop in center_stream() is de

UTF-8 support for ps(1)

2015-12-15 Thread Ingo Schwarze
tf, *memf, *swapf, *cols, errbuf[_POSIX2_LINE_MAX]; + + setlocale(LC_CTYPE, ""); if ((cols = getenv("COLUMNS")) != NULL && *cols != '\0') { const char *errstr; Index: utf8.c =

Re: UTF-8 support for uniq(1)

2015-12-11 Thread Ingo Schwarze
Oh well. If something is supposedly simple... I got three OKs on this code, including one senior developer calling it simple and saying it shows how something like this should be done. Fortunately, Patrick Keshishian privately mailed me that he suspected a regression. Even though the

UTF-8 support for uniq(1)

2015-12-10 Thread Ingo Schwarze
Hi, here is a simple one. The uniq(1) utility only needs UTF-8 support to distinguish blank and non-blank characters with -f and to skip characters with -s. The former is easy to implement with mbtowc(3) and iswblank(3), the latter with mblen(3). There is no need for wrapper functions or a

Re: ksh(1): utf8 in emacs editing mode

2015-12-08 Thread Ingo Schwarze
Hi Sebastien, Sebastien Marie wrote on Tue, Dec 08, 2015 at 07:06:57AM +0100: > On Tue, Dec 08, 2015 at 01:19:35AM +0100, Ingo Schwarze wrote: >> i'd like to propose a simplified version of this patch Frederic Nowak >> posted a few weeks ago for commit. Our experience is prob

UTF-8 support for fmt(1)

2015-12-08 Thread Ingo Schwarze
Hi, here is UTF-8 support for fmt(1). This does not include the -c case; the patch is already large enough. Because tedu@ said he didn't see value in splitting the cut(1) diff, i dare sending it as one big patch. If anybody wants to have it split into steps for easier review and a safer

Re: UTF-8 support for wc(1)

2015-12-04 Thread Ingo Schwarze
Hi Todd, Todd C. Miller wrote on Thu, Dec 03, 2015 at 11:40:55AM -0700: > On Sun, 29 Nov 2015 17:45:55 +0100, Ingo Schwarze wrote: >> our wc(1) utility currently violates POSIX in two ways: >> >> 1. The -m option counts bytes instead of characters. >>

UTF-8 support for ls(1)

2015-11-30 Thread Ingo Schwarze
nt(path, 1); } static void Index: utf8.c === RCS file: utf8.c diff -N utf8.c --- /dev/null 1 Jan 1970 00:00:00 - +++ utf8.c 30 Nov 2015 15:46:44 - @@ -0,0 +1,51 @@ +/* $OpenBSD$ */ + +/* + * Copyright (c) 2015 In

Re: UTF-8 support for ls(1)

2015-11-30 Thread Ingo Schwarze
Hi Dmitrij, Dmitrij D. Czarkoff wrote on Mon, Nov 30, 2015 at 11:37:12PM +0100: > Ingo Schwarze said: >> * I am resetting mbtowc(3) internal state after failure, >>even though that has no effect on OpenBSD, if only as a >>reminder that there be dragons. It

UTF-8 support for wc(1)

2015-11-29 Thread Ingo Schwarze
Hi, our wc(1) utility currently violates POSIX in two ways: 1. The -m option counts bytes instead of characters. The patch given below fixes that. 2. Word counting with -w only treats ASCII whitespace as word boundaries and regards two words joined by non-ASCII whitespace as one

Re: implementation of cut -c

2015-11-23 Thread Ingo Schwarze
Hi Ted, Ingo Schwarze wrote on Sun, Nov 15, 2015 at 06:56:37PM +0100: > Ted Unangst wrote on Sat, Nov 14, 2015 at 01:22:33PM -0500: >> One other program which I think will provide some insight is cut. >> It cares, perhaps even more than others, about bytes and chars >> an

implementation of cut -c

2015-11-15 Thread Ingo Schwarze
Hi Ted, Ted Unangst wrote on Sat, Nov 14, 2015 at 01:22:33PM -0500: > One other program which I think will provide some insight is cut. > It cares, perhaps even more than others, about bytes and chars > and bytes in the middle of chars. The following fully implements -c. While here, reduce the

Re: utf8 in rs

2015-11-14 Thread Ingo Schwarze
if (p == NULL) err(1, "no memory"); allocsize = newsize; - sp += p - elem; + sp = sp == NULL ? p : p + (sp - elem); elem = p; endelem = elem + allocsize; return(sp); Index: utf8.c ===

Re: telnet: Delete tracefile command.

2015-11-13 Thread Ingo Schwarze
Hi Theo, > CVSROOT: /cvs > Module name: src > Changes by: dera...@cvs.openbsd.org 2015/11/13 09:53:46 > > Modified files: > usr.bin/telnet : commands.c telnet.1 > > Log message: > Delete tracefile command. Tracefiles can now only be specified at > program startup. Who uses

Re: pledge telnet

2015-11-13 Thread Ingo Schwarze
Hi Theo, Theo de Raadt wrote on Fri, Nov 13, 2015 at 01:36:23AM -0700: > I really want to delete telnet entirely, I often use it for testing unencrypted SMTP and HTTP across the Internet. Which tool would you recommend for that purpose? > but there are still occasions when someone might want

Re: pledge("stdio") for arch(1)/machine(1)

2015-11-13 Thread Ingo Schwarze
Hi, Theo de Raadt wrote on Fri, Nov 13, 2015 at 08:21:41AM -0700: > Theo Buehler wrote: >> This straightforward pledge("stdio") is one of the last uncommitted ones >> from Theo's big 'tame in userland' diff and seems to have been >> overlooked so far. > I think arch.c gains no value from being

fix segfault in rs(1)

2015-11-09 Thread Ingo Schwarze
Hi, schwarze@isnote $ cat rs.c | rs -H 61 line 1 [...] 25 line 50 26 line 12338 Segmentation fault (core dumped) rs(1) -H always segfaults for input larger than 4 KB. The reason is that, in get_line(), * Initially, (irows == 0), curline gets set to the static buffer ibuf. * -H

Re: chgrp(1) & chown(8): mark -h and -R as mutually exclusive

2015-11-06 Thread Ingo Schwarze
Hi Frederic, Frederic Nowak wrote on Fri, Nov 06, 2015 at 08:58:14AM +0100: > On 05 November 2015 at 19:02 Ingo Schwarze <schwa...@usta.de> wrote: >> http://mdocml.bsd.lv/mdoc/ > Thanks, I hadn't seen that resource before. Looks very interesting! > Would it make sense t

Re: ftp.1: "dir |more" example not working as intended

2015-11-05 Thread Ingo Schwarze
Hi Frederic, Frederic Nowak wrote on Tue, Nov 03, 2015 at 04:59:35PM +0100: > I think the "dir |more" example in ftp.1 is not working as intended. > > ls (and by extension its synonym dir) expects to be called like this: > > ls [remote-directory [local-file]] > > Therefore, "dir |more" would

Re: remove NLS directory

2015-11-05 Thread Ingo Schwarze
Hi Stefan, Stefan Sperling wrote on Thu, Nov 05, 2015 at 10:49:30PM +0100: > On Thu, Nov 05, 2015 at 04:29:12PM +0100, Alexander Bluhm wrote: >> After removing National Language Support (NLS) from base, I think >> the directory /usr/share/nls should go. Having a non-existing >> default path in

Re: err(3) trivia

2015-11-05 Thread Ingo Schwarze
Hi Michael, Michael McConville wrote on Thu, Nov 05, 2015 at 09:09:51PM -0500: > Apparently the programmer didn't know that you could pass it NULL. > However, including the function name seems more informative. For malloc failure, including a function name is not necessary because the message

Re: ftp.1: "dir |more" example not working as intended

2015-11-04 Thread Ingo Schwarze
Hi, Frederic Nowak wrote on Tue, Nov 03, 2015 at 04:59:35PM +0100: > I think the "dir |more" example in ftp.1 is not working as intended. True. > ls (and by extension its synonym dir) expects to be called like this: > > ls [remote-directory [local-file]] > > Therefore, "dir |more" would

Re: wc does not count last line if no trailing newline present

2015-11-04 Thread Ingo Schwarze
Hi, Jason McIntyre wrote on Wed, Nov 04, 2015 at 07:51:30AM +: > the clarity is good, but i worry that you're making a clear sentence > harder to grasp. posix spec itself says -l counts "newline characters", > which i find easier to understand in itself, but as flag -l i find it > much

Re: does anoybody use ul?

2015-10-23 Thread Ingo Schwarze
Hi Ted, Ted Unangst wrote on Fri, Oct 23, 2015 at 03:47:56AM -0400: > ul appears somewhat useless for its intended purpose. > > echo _xxx_ | ul does not result in underlined text in an xterm, > so I doubt many people are using this. > > Unlike, say, mandoc, it can't output Greek letters. > I

<    2   3   4   5   6   7   8   9   10   >