public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Craig Howland <howland@LGSInnovations.com>
To: <newlib@sourceware.org>
Subject: Re: [PATCH] Add man page entry for strnstr.c.
Date: Wed, 30 Aug 2017 14:59:00 -0000	[thread overview]
Message-ID: <bf12874f-a8be-0280-93da-d37211ead54a@LGSInnovations.com> (raw)
In-Reply-To: <1504062237-19638-2-git-send-email-1473996754@qq.com>

On 08/29/2017 11:03 PM, Sichen Zhao wrote:
> ---
>   newlib/libc/string/strings.tex |  4 ++++
>   newlib/libc/string/strnstr.c   | 39 +++++++++++++++++++++++++++++++++++++++
>   2 files changed, 43 insertions(+)
>
> diff --git a/newlib/libc/string/strings.tex b/newlib/libc/string/strings.tex
> index c619886..6aec5fe 100644
> ...
>   
>   @page
> diff --git a/newlib/libc/string/strnstr.c b/newlib/libc/string/strnstr.c
> index 05d86ee..fe3da6e 100644
> --- a/newlib/libc/string/strnstr.c
> +++ b/newlib/libc/string/strnstr.c
> @@ -1,3 +1,42 @@
> ...
> +
> +TRAD_SYNOPSIS
> +	#include <string.h>
> +	size_t strnstr(<[s1]>, <[s2]>, <[n]>)
> +	char *<[s1]>;
> +        char *<[s2]>;
> +	size_t <[n]>;
You can leave out the TRAD_SYNOPSIS section, as it is has been ignored by the 
document-generation tools for years.
> +
> +DESCRIPTION
> +	Locates the first occurrence in the string pointed to by <[s1]> of
> +	the sequence of limited to the <[n]> characters in the string
> +        pointed to by <[s2]>
As I read this, is it saying that is looks for at most n characters of s2 within 
s1.  However, this disagrees with the description in the source just before the 
function, itself, which says "Find the first occurrence of find in s, where the 
search is limited to the first slen characters of s."
> +
> +RETURNS
> +	Returns a pointer to the located string segment, or a null
> +	pointer if the string <[s2]> is not found. If <[s2]> points to
> +	a string with zero length, <[s1]> is returned.
> +
> +
> +PORTABILITY
> +<<strnstr>> is ANSI C.
> +
> +<<strnstr>> requires no supporting OS subroutines.
> +
> +QUICKREF
> +	strnstr ansi pure
strnstr() is not ANSI C.  (According to the gate in the header when added, it is 
BSD.)

  reply	other threads:[~2017-08-30 14:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30  3:04 [PATCH v2] Modify strnstr.c Sichen Zhao
2017-08-30 13:35 ` [PATCH] Add man page entry for strnstr.c Sichen Zhao
2017-08-30 14:59   ` Craig Howland [this message]
2017-08-30 14:19 ` [PATCH v2] Modify strnstr.c Corinna Vinschen
2017-09-04  9:04   ` Sichen Zhao
2017-08-30 15:04 ` Craig Howland
2017-09-10  4:04 ` Brian Inglis
2017-09-10  4:27 ` Brian Inglis

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=bf12874f-a8be-0280-93da-d37211ead54a@LGSInnovations.com \
    --to=howland@lgsinnovations.com \
    --cc=newlib@sourceware.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).