Thread (27 messages) flat view 27 messages, 7 authors, 2016-08-13

Re: [PATCH 1/5] Add generic 'strbuf_readlink()' helper function

From: Jay Soffian <hidden>
Date: 2016-06-15 22:45:47

On Wed, Dec 17, 2008 at 1:42 PM, Linus Torvalds
[off-list ref] wrote:
+       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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help