Re: [vpp-dev] unformat %s eats newlines

2018-02-02 Thread Dave Barach (dbarach)
eas Schultz Sent: Friday, February 2, 2018 12:47 PM To: vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io> Subject: [vpp-dev] unformat %s eats newlines A typical construct to parse arguments is to use unformat in a while loop that checks for UNFORMAT_END_OF_INPUT. For multiline input that rel

Re: [vpp-dev] unformat %s eats newlines

2018-02-02 Thread Andreas Schultz
Florin Coras schrieb am Fr., 2. Feb. 2018 um 18:57 Uhr: > Not exactly the most elegant solution but have you tried adding a space > after the string to be parsed? > Tried that, but doesn't help. Andreas Florin > > > On Feb 2, 2018, at 9:47 AM, Andreas Schultz < > andreas.schu...@travelping.com

Re: [vpp-dev] unformat %s eats newlines

2018-02-02 Thread Andreas Schultz
ilto:vpp-dev-boun...@lists.fd.io] *On > Behalf Of *Andreas Schultz > *Sent:* Friday, February 2, 2018 12:47 PM > *To:* vpp-dev@lists.fd.io > *Subject:* [vpp-dev] unformat %s eats newlines > > > > A typical construct to parse arguments is to use unformat in a while loop > th

Re: [vpp-dev] unformat %s eats newlines

2018-02-02 Thread Dave Barach (dbarach)
.io [mailto:vpp-dev-boun...@lists.fd.io] On Behalf Of Andreas Schultz Sent: Friday, February 2, 2018 12:47 PM To: vpp-dev@lists.fd.io Subject: [vpp-dev] unformat %s eats newlines A typical construct to parse arguments is to use unformat in a while loop that checks for UNFORMAT_END_OF_INPUT. For multiline

Re: [vpp-dev] unformat %s eats newlines

2018-02-02 Thread Florin Coras
Not exactly the most elegant solution but have you tried adding a space after the string to be parsed? Florin > On Feb 2, 2018, at 9:47 AM, Andreas Schultz > wrote: > > A typical construct to parse arguments is to use unformat in a while loop > that checks for UNFORMAT_END_OF_INPUT. > For mu

[vpp-dev] unformat %s eats newlines

2018-02-02 Thread Andreas Schultz
A typical construct to parse arguments is to use unformat in a while loop that checks for UNFORMAT_END_OF_INPUT. For multiline input that relies on the detection of "\n" in the input stream. The problem is that a construct like: unformat (input, "name %_%v%_", &name) eats the newline when it