This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] argp: argp.doc prints incorrectly when it starts with "\v" [BZ #19038]
- From: Girish Joshi <girish946 at gmail dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 6 May 2019 09:38:06 -0400
- Subject: Re: [PATCH] argp: argp.doc prints incorrectly when it starts with "\v" [BZ #19038]
- References: <CALkY8p960_gyY_Q1C+FPKuRYYyBCyp7V=PZpu8XaNW5Mxkxdgg@mail.gmail.com> <871s1bep2u.fsf@oldenburg2.str.redhat.com>
Hi Florian,
> I assume this bug user-visible, so it should have a bug in Bugzilla
> <https://sourceware.org/bugzilla/>. Would you please file one?
>
Here[1] is a Bugzilla entry for this.
> Could you write a test case for this? Or at least post how to reproduce
> the issue in a minimal program?
>
It can be reproduced with following code.
#include<stdlib.h>
#include<argp.h>
static char doc[] = "\vthis is post_doc";
static struct argp argp = {NULL, NULL, NULL, doc};
int main(int argc, char *args[]){
argp_parse(&argp, argc, args, 0, 0, NULL);
}
the output of the above code looks like:
this is post_doc
-?, --help Give this help list
--usage Give a short usage message
this is post_doc
In this case the doc is being printed two times.
As mentioned in the comment by Kenny Stauffer on Bugzilla the first
occurrence of `this is post_doc` is erroneous.
If we change the doc[] in the above code to something else like
static char doc[] = "this is pre_doc\vthis is post_doc";
We get the output like:
this is pre_doc
-?, --help Give this help list
--usage Give a short usage message
this is post_doc
[1]: https://sourceware.org/bugzilla/show_bug.cgi?id=19038