Remove relative/untidy path elements when creating new documents

with a filename (e.g. from the command-line) (#2823998).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4007 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2009-07-21 16:23:05 +00:00
parent 46ecf7061d
commit d906a77975
2 changed files with 17 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2009-07-21 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/document.c:
Remove relative/untidy path elements when creating new documents
with a filename (e.g. from the command-line) (#2823998).
2009-07-20 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/callbacks.c:

View File

@ -684,7 +684,16 @@ GeanyDocument *document_new_file_if_non_open(void)
GeanyDocument *document_new_file(const gchar *utf8_filename, GeanyFiletype *ft,
const gchar *text)
{
GeanyDocument *doc = document_create(utf8_filename);
GeanyDocument *doc;
if (utf8_filename && g_path_is_absolute(utf8_filename))
{
gchar *tmp;
tmp = utils_strdupa(utf8_filename); /* work around const */
utils_tidy_path(tmp);
utf8_filename = tmp;
}
doc = document_create(utf8_filename);
g_assert(doc != NULL);