Revision: 4599 http://geany.svn.sourceforge.net/geany/?rev=4599&view=rev Author: eht16 Date: 2010-01-31 16:22:26 +0000 (Sun, 31 Jan 2010)
Log Message: ----------- Fix removing leading double slashes in filenames which are used for network resources on Windows (closes #2844085).
Modified Paths: -------------- branches/geany-0.18.1/ChangeLog branches/geany-0.18.1/src/utils.c
Modified: branches/geany-0.18.1/ChangeLog =================================================================== --- branches/geany-0.18.1/ChangeLog 2010-01-31 15:18:37 UTC (rev 4598) +++ branches/geany-0.18.1/ChangeLog 2010-01-31 16:22:26 UTC (rev 4599) @@ -118,6 +118,13 @@ longer exists or is incompatible.
+2009-08-29 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * src/utils.c: + Fix removing leading double slashes in filenames which are used for + network resources on Windows (closes #2844085). + + 2009-08-27 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/geany.h:
Modified: branches/geany-0.18.1/src/utils.c =================================================================== --- branches/geany-0.18.1/src/utils.c 2010-01-31 15:18:37 UTC (rev 4598) +++ branches/geany-0.18.1/src/utils.c 2010-01-31 16:22:26 UTC (rev 4599) @@ -1721,13 +1721,20 @@ const gchar *c, *needle; gchar *tmp; gssize pos; + gboolean preserve_double_backslash = FALSE;
g_return_if_fail(g_path_is_absolute(filename));
+ if (str->len >= 2 && strncmp(str->str, "\\", 2) == 0) + preserve_double_backslash = TRUE; + /* replace "/./" and "//" */ utils_string_replace_all(str, G_DIR_SEPARATOR_S "." G_DIR_SEPARATOR_S, G_DIR_SEPARATOR_S); utils_string_replace_all(str, G_DIR_SEPARATOR_S G_DIR_SEPARATOR_S, G_DIR_SEPARATOR_S);
+ if (preserve_double_backslash) + g_string_prepend(str, "\"); + /* replace "/../" */ needle = G_DIR_SEPARATOR_S ".." G_DIR_SEPARATOR_S; while (1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.