<p><a href="https://github.com/vfaronov" class="user-mention">@vfaronov</a> Many thanks for testing.</p>
<p>Regarding the bug. I assume PATH_MAX is just 260 on Windows. I've read <a href="http://insanecoding.blogspot.de/2007/11/pathmax-simply-isnt.html">http://insanecoding.blogspot.de/2007/11/pathmax-simply-isnt.html</a> and it appears PATH_MAX is pretty broken in general.</p>
<p>The tag data contains the full path name. Apparently it contains something weird (non-null) if it exceeds PATH_MAX, while from the code I'd think it contains NULL (but that would crash Geany). To be sure, please check with the following diff.</p>
<p>In any case, this is a separate issue. We have our own <code>realpath()</code> on windows which doesn't handle this case. The the underlying data this PR uses is already wrong. You should see the error message about <code>utils_tidy_path()</code> even without my patch.</p>
<pre><code>diff --git a/src/symbols.c b/src/symbols.c
index f4f259b72..874666399 100644
--- a/src/symbols.c
+++ b/src/symbols.c
@@ -1933,8 +1933,12 @@ static void show_goto_popup(GeanyDocument *doc, GPtrArray *tags, gboolean have_b
        /* If popup would show multiple files presend a smart file list that allows
         * to easily distinguish the files while avoiding the file paths in their entirety */
        file_names = g_new(gchar *, tags->len);
+       int n = g_random_int()%100;
        foreach_ptr_array(tmtag, i, tags)
+       {
                file_names[i] = tmtag->file->file_name;
+               printf("goto_popup %d: %s", n, tmtag->file->file_name ? tmtag->file->file_name : NULL);
+       }
        short_names = utils_strv_shorten_file_list(file_names, tags->len);
        g_free(file_names);
 
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/1445#issuecomment-313002161">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ70THTi6Uuo68qDOCs5KUARJpX8Zks5sKyQAgaJpZM4MnYrc">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ3jr55ITRyNQ-G94CO1GQakBX-NUks5sKyQAgaJpZM4MnYrc.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/1445#issuecomment-313002161"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@kugel- in #1445: @vfaronov Many thanks for testing.\r\n\r\nRegarding the bug. I assume PATH_MAX is just 260 on Windows. I've read http://insanecoding.blogspot.de/2007/11/pathmax-simply-isnt.html and it appears PATH_MAX is pretty broken in general. \r\n\r\nThe tag data contains the full path name. Apparently it contains something weird (non-null) if it exceeds PATH_MAX, while from the code I'd think it contains NULL (but that would crash Geany). To be sure, please check with the following diff.\r\n\r\nIn any case, this is a separate issue. We have our own `realpath()` on windows which doesn't handle this case. The the underlying data this PR uses is already wrong. You should see the error message about `utils_tidy_path()` even without my patch.\r\n\r\n```\r\ndiff --git a/src/symbols.c b/src/symbols.c\r\nindex f4f259b72..874666399 100644\r\n--- a/src/symbols.c\r\n+++ b/src/symbols.c\r\n@@ -1933,8 +1933,12 @@ static void show_goto_popup(GeanyDocument *doc, GPtrArray *tags, gboolean have_b\r\n \t/* If popup would show multiple files presend a smart file list that allows\r\n \t * to easily distinguish the files while avoiding the file paths in their entirety */\r\n \tfile_names = g_new(gchar *, tags-\u003elen);\r\n+\tint n = g_random_int()%100;\r\n \tforeach_ptr_array(tmtag, i, tags)\r\n+\t{\r\n \t\tfile_names[i] = tmtag-\u003efile-\u003efile_name;\r\n+\t\tprintf(\"goto_popup %d: %s\", n, tmtag-\u003efile-\u003efile_name ? tmtag-\u003efile-\u003efile_name : NULL);\r\n+\t}\r\n \tshort_names = utils_strv_shorten_file_list(file_names, tags-\u003elen);\r\n \tg_free(file_names);\r\n \r\n```"}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/1445#issuecomment-313002161"}}}</script>