tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Cc: Ingo Schwarze <schwarze@usta.de>
Subject: Re: line termination in manuals
Date: Tue, 25 Jan 2011 00:16:19 +0100	[thread overview]
Message-ID: <4D3E0843.1010608@bsd.lv> (raw)
In-Reply-To: <20110122225933.GL12520@iris.usta.de>

>> Has somebody checked whether groff accepts these in the same way?
>
> It does.
>
>
> Joerg Sonnenberger wrote on Sat, Jan 22, 2011 at 11:29:38PM +0100:
>> On Sat, Jan 22, 2011 at 11:18:36PM +0100, Ingo Schwarze wrote:
>
>>> When the last character in blk.buf is '\r' (without a newline
>>> at the end of the file), my first attempt would have overrun
>>> the buffer by one byte.
>
>> Right. What about the same condition for the first if?
>
> Has anybody mentioned that handling of null-terminated strings
> is less error-prone than of buffers with a length, because there
> is the null at the end and you don't that easily overrun?
>
> Joerg, you are right, and not only that, the bounds check was off
> by one as well.  Checking i+1<  sz and then accessing buf[i+2]
> is not smart.
>
> Maybe i should write poems instead, or something.

.Dd $Mdocdate$
.Dt FOO 1
.Os
.Sh NAME
.Nm foo
.Nd a poem by pretend\-Ingo
.Sh SYNOPSIS
.Nm Roses
.Ar e red, violets
.Ar e blue...

Incidentally, whenever you get the \r\n logic ironed out, check it in. 
I've been wanting to have DOS file support for a while...

(Should we specify that the -Tascii output is always UNIX newline 
terminated?)

Thanks,

Kristaps
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2011-01-24 23:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-22 19:56 Ingo Schwarze
2011-01-22 20:05 ` Joerg Sonnenberger
2011-01-22 21:28   ` Ingo Schwarze
2011-01-22 21:35     ` Joerg Sonnenberger
2011-01-22 22:18       ` Ingo Schwarze
2011-01-22 22:28         ` Kristaps Dzonsons
2011-01-22 22:29         ` Joerg Sonnenberger
2011-01-22 22:59           ` Ingo Schwarze
2011-01-24 23:16             ` Kristaps Dzonsons [this message]
2011-01-25  0:09               ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D3E0843.1010608@bsd.lv \
    --to=kristaps@bsd.lv \
    --cc=schwarze@usta.de \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).