[Github-comments] [geany/geany] Fix 1069 (#1445)

Thomas Martitz notifications at xxxxx
Wed Jul 5 05:49:52 UTC 2017


@vfaronov Many thanks for testing.

Regarding 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. 

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.

In 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.

```
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);
 
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1445#issuecomment-313002161
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20170705/054f2780/attachment.html>


More information about the Github-comments mailing list