Thread (4 messages) flat view 4 messages, 2 authors, 2016-09-13

Re: [PATCH v2] ls-files: adding support for submodules

From: Brandon Williams <hidden>
Date: 2016-09-13 03:36:04

 static void write_name(const char *name)
 {
        /*
+        * NEEDSWORK: To make this thread-safe, full_name would have to be owned
+        * by the caller.
+        *
+        * full_name get reused across output lines to minimize the allocation
+        * churn.
+        */
+       static struct strbuf full_name = STRBUF_INIT;
+       if (output_path_prefix != '\0') {
It was pointed out to me that this should be:
    if (*output_path_prefix != '\0') {

+               strbuf_reset(&full_name);
+               strbuf_addstr(&full_name, output_path_prefix);
+               strbuf_addstr(&full_name, name);
+               name = full_name.buf;
+       }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help