<feed xmlns='http://www.w3.org/2005/Atom'>
<title>halibut/bk_man.c, branch master</title>
<subtitle>My halibut tree</subtitle>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/'/>
<entry>
<title>Fix two potential buffer under/overruns.</title>
<updated>2017-05-14T07:49:07+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2017-05-14T07:08:57+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=41ef29132b50404f6157d83d1edf9a133e422c9f'/>
<id>41ef29132b50404f6157d83d1edf9a133e422c9f</id>
<content type='text'>
The one in wcwidth.c actually came up in one of my valgrind runs: if
you passed it a non-null-terminated wide string (specifically, one
that reaches invalid memory exactly when the length parameter runs
out), it would illegally load the character beyond the end of the
string before noticing that the length parameter said it shouldn't.

The one in bk_man.c may well not be able to come up at all, but I
spotted it in passing and I thought I might as well fix it - it makes
me twitch on general principles to see any use of buf[len-1] without
having checked len&gt;0 first.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The one in wcwidth.c actually came up in one of my valgrind runs: if
you passed it a non-null-terminated wide string (specifically, one
that reaches invalid memory exactly when the length parameter runs
out), it would illegally load the character beyond the end of the
string before noticing that the length parameter said it shouldn't.

The one in bk_man.c may well not be able to come up at all, but I
spotted it in passing and I thought I might as well fix it - it makes
me twitch on general principles to see any use of buf[len-1] without
having checked len&gt;0 first.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add \s for 'strong' text, i.e. bold rather than italics. I've missed</title>
<updated>2013-03-10T16:58:01+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2013-03-10T16:58:01+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=dcf080aa0e011de37a154e9e8a97dd7546a4a1b1'/>
<id>dcf080aa0e011de37a154e9e8a97dd7546a4a1b1</id>
<content type='text'>
this a couple of times in Halibut markup recently (in particular, it's
handy to have a typographical distinction between 'this term is
emphasised because it's new' and 'this term is emphasised because I
want you to pay attention to it'), so here's an implementation,
basically parallel to \e.

One slight oddity is that strong text in headings will not be
distinguished in some output formats, since they already use bolded
text for their headings.

[originally from svn r9772]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this a couple of times in Halibut markup recently (in particular, it's
handy to have a typographical distinction between 'this term is
emphasised because it's new' and 'this term is emphasised because I
want you to pay attention to it'), so here's an implementation,
basically parallel to \e.

One slight oddity is that strong text in headings will not be
distinguished in some output formats, since they already use bolded
text for their headings.

[originally from svn r9772]
</pre>
</div>
</content>
</entry>
<entry>
<title>Revamp of the Halibut error handling mechanism.</title>
<updated>2012-08-29T18:13:11+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2012-08-29T18:13:11+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=1489dc15967970576d08f3f2b22c6e1c939bcbcf'/>
<id>1489dc15967970576d08f3f2b22c6e1c939bcbcf</id>
<content type='text'>
I'm not quite sure why I ever thought it was a good idea to have a
central variadic error() function taking an integer error code
followed by some list of arguments that depend on that code. It now
seems obvious to me that it's a much more sensible idea to have a
separate function per error, so that we can check at compile time that
the arguments to each error call are of the right number and type! So
I've done that instead.

A side effect is that the errors are no longer formatted into a
fixed-size buffer before going to stderr, so I can remove all the
%.200s precautions in the format strings.

[originally from svn r9639]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I'm not quite sure why I ever thought it was a good idea to have a
central variadic error() function taking an integer error code
followed by some list of arguments that depend on that code. It now
seems obvious to me that it's a much more sensible idea to have a
separate function per error, so that we can check at compile time that
the arguments to each error call are of the right number and type! So
I've done that instead.

A side effect is that the errors are no longer formatted into a
fixed-size buffer before going to stderr, so I can remove all the
%.200s precautions in the format strings.

[originally from svn r9639]
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow a hastily selected subset of the output formats to also accept</title>
<updated>2009-10-24T09:33:21+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2009-10-24T09:33:21+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=6c481aff452a0eed147fc73144b461fe7c263d9e'/>
<id>6c481aff452a0eed147fc73144b461fe7c263d9e</id>
<content type='text'>
"-" as a special file name meaning standard output. I've restricted
it to just those output formats which can predictably output only
one file, just for the sake of not having to faff too much with the
others.

Probably what I should have done for all of this would have been to
write a set of wrappers around fopen, fclose and everything in
between, and use them everywhere. Those wrappers would uniformly
detect "-" and convert it into stdin or stdout as appropriate, would
avoid fclosing those files for real when told to close them, and
would also be able to handle reading a little bit of data from the
start of a file and then pushing it all back even if the file were
not seekable (which would allow input.c to lose the ugly special
case whereby it can't currently read font files from standard
input).

[originally from svn r8729]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"-" as a special file name meaning standard output. I've restricted
it to just those output formats which can predictably output only
one file, just for the sake of not having to faff too much with the
others.

Probably what I should have done for all of this would have been to
write a set of wrappers around fopen, fclose and everything in
between, and use them everywhere. Those wrappers would uniformly
detect "-" and convert it into stdin or stdout as appropriate, would
avoid fclosing those files for real when told to close them, and
would also be able to handle reading a little bit of data from the
start of a file and then pushing it all back even if the file were
not seekable (which would allow input.c to lose the ugly special
case whereby it can't currently read font files from standard
input).

[originally from svn r8729]
</pre>
</div>
</content>
</entry>
<entry>
<title>Revise r8309 to use \- rather than - when trying to emit a literal U+002D;</title>
<updated>2009-09-06T13:37:27+00:00</updated>
<author>
<name>Jacob Nevins</name>
<email>jacobn@chiark.greenend.org.uk</email>
</author>
<published>2009-09-06T13:37:27+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=0a4281ca5b029a961fbef0856e27dee2a23c8cdb'/>
<id>0a4281ca5b029a961fbef0856e27dee2a23c8cdb</id>
<content type='text'>
apparently this is preferred (it's what pod2man uses); cf Debian #496063,
#159872.

[originally from svn r8641]
[r8309 == 73e8c7d1b4ac77ec1b5acc700cb3af277a150bcf]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
apparently this is preferred (it's what pod2man uses); cf Debian #496063,
#159872.

[originally from svn r8641]
[r8309 == 73e8c7d1b4ac77ec1b5acc700cb3af277a150bcf]
</pre>
</div>
</content>
</entry>
<entry>
<title>More portable attempt to get a literal U+0027 than r8321, pinched from pod2man</title>
<updated>2009-09-06T12:59:33+00:00</updated>
<author>
<name>Jacob Nevins</name>
<email>jacobn@chiark.greenend.org.uk</email>
</author>
<published>2009-09-06T12:59:33+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=c336fe89f0c6122ccbc7e5dd607f4ec6b3bd8853'/>
<id>c336fe89f0c6122ccbc7e5dd607f4ec6b3bd8853</id>
<content type='text'>
(via Colin in Debian bug#496063).

[originally from svn r8640]
[r8321 == 5e7a3a5b1bbaccb7ce7d61bb9bc4654924135dfb]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(via Colin in Debian bug#496063).

[originally from svn r8640]
[r8321 == 5e7a3a5b1bbaccb7ce7d61bb9bc4654924135dfb]
</pre>
</div>
</content>
</entry>
<entry>
<title>Extend r8309 to try to ensure that single-quote/apostrophe characters in code</title>
<updated>2008-11-23T17:41:44+00:00</updated>
<author>
<name>Jacob Nevins</name>
<email>jacobn@chiark.greenend.org.uk</email>
</author>
<published>2008-11-23T17:41:44+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=5e7a3a5b1bbaccb7ce7d61bb9bc4654924135dfb'/>
<id>5e7a3a5b1bbaccb7ce7d61bb9bc4654924135dfb</id>
<content type='text'>
contexts get output usefully in the face of UTF-8 *roff implementations.
Works on Debian-derived distributions (and hence along with r8309 should fix
#496063), but I'm slightly worried about portability as I've used a named
character "\(aq" which doesn't appear in the "classic" reference CS TR #54.

[originally from svn r8321]
[r8309 == 73e8c7d1b4ac77ec1b5acc700cb3af277a150bcf]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
contexts get output usefully in the face of UTF-8 *roff implementations.
Works on Debian-derived distributions (and hence along with r8309 should fix
#496063), but I'm slightly worried about portability as I've used a named
character "\(aq" which doesn't appear in the "classic" reference CS TR #54.

[originally from svn r8321]
[r8309 == 73e8c7d1b4ac77ec1b5acc700cb3af277a150bcf]
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't translate hyphens into \(hy inside \c{...} or code paragraphs,</title>
<updated>2008-11-21T19:15:50+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2008-11-21T19:15:50+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=73e8c7d1b4ac77ec1b5acc700cb3af277a150bcf'/>
<id>73e8c7d1b4ac77ec1b5acc700cb3af277a150bcf</id>
<content type='text'>
because otherwise UTF-8 versions of man(1) tend to turn them into
Unicode hyphen characters, with the result that if you cut and paste
sample command lines out of man pages in the obvious way then the
things that look like hyphens are not in fact the character that the
program in question would recognise as an option introducer.

[originally from svn r8309]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
because otherwise UTF-8 versions of man(1) tend to turn them into
Unicode hyphen characters, with the result that if you cut and paste
sample command lines out of man pages in the obvious way then the
things that look like hyphens are not in fact the character that the
program in question would recognise as an option introducer.

[originally from svn r8309]
</pre>
</div>
</content>
</entry>
<entry>
<title>`man', at least on Debian 3.1, will treat a paragraph beginning with</title>
<updated>2006-10-11T11:13:30+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2006-10-11T11:13:30+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=2b03a64dbede7b625dd2cabe1fcc2c5a4036b188'/>
<id>2b03a64dbede7b625dd2cabe1fcc2c5a4036b188</id>
<content type='text'>
a period specially _even_ if there's an \fB or similar escape
sequence before the period. Therefore, man_rdaddctrl() now doesn't
clear the QUOTE_INITCTRL flag just because it generated some text;
instead, its call sites clear the flag when the _type_ of generated
text is appropriate for this. This should remove an error from the
`lns' man page (utils/lns/lns.but), which was where I noticed the
problem.

[originally from svn r6871]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
a period specially _even_ if there's an \fB or similar escape
sequence before the period. Therefore, man_rdaddctrl() now doesn't
clear the QUOTE_INITCTRL flag just because it generated some text;
instead, its call sites clear the flag when the _type_ of generated
text is appropriate for this. This should remove an error from the
`lns' man page (utils/lns/lns.but), which was where I noticed the
problem.

[originally from svn r6871]
</pre>
</div>
</content>
</entry>
<entry>
<title>Factor out another routine from man_rdaddwc(), this one to add a control</title>
<updated>2006-05-07T12:55:32+00:00</updated>
<author>
<name>Ben Harris</name>
<email>bjh21@bjh21.me.uk</email>
</author>
<published>2006-05-07T12:55:32+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=f91db5e8ccfc6f602cf3c38fa5e0e4cb3a7eb9c3'/>
<id>f91db5e8ccfc6f602cf3c38fa5e0e4cb3a7eb9c3</id>
<content type='text'>
string to the output.  This incidentally fixes a bug whereby font changes
at the start of a line weren't resetting QUOTE_INITCTRL.

[originally from svn r6660]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
string to the output.  This incidentally fixes a bug whereby font changes
at the start of a line weren't resetting QUOTE_INITCTRL.

[originally from svn r6660]
</pre>
</div>
</content>
</entry>
</feed>
