This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] argp: argp.doc prints incorrectly when it starts with "\v" [BZ #19038]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]