Re: [PATCH 1/5] Add generic 'strbuf_readlink()' helper function
- From
Jay Soffian <jaysoffian@gmail.com>
- Date
- Dec 17, 2008, 21:26 UTC
- Message-ID
- <76718490812171326q4d8896c1yb535873c71eec23f@mail.gmail.com>
- In-Reply-To
- <alpine.LFD.2.00.0812171042120.14014@localhost.localdomain>
On Wed, Dec 17, 2008 at 1:42 PM, Linus Torvalds <torvalds@linux-foundation.org> wrote:
Show 17 quoted lines
> + while (hint < STRBUF_MAXLINK) {
> + int len;
> +
> + strbuf_grow(sb, hint);
> + len = readlink(path, sb->buf, hint);
> + if (len < 0) {
> + if (errno != ERANGE)
> + break;
> + } else if (len < hint) {
> + strbuf_setlen(sb, len);
> + return 0;
> + }
> +
> + /* .. the buffer was too small - try again */
> + hint *= 2;
> + continue;
> + }Why the continue statement at the end of the loop?
j.