dia r4255 - in trunk: . lib



Author: hans
Date: Sun Feb  1 21:04:23 2009
New Revision: 4255
URL: http://svn.gnome.org/viewvc/dia?rev=4255&view=rev

Log:
2009-02-01  Hans Breuer  <hans breuer org>

	* lib/dia_dirs.c(dia_get_canonical_path) : shortcut for pathes not 
	including ".." or "./" to keep UNC pathes intact; bug #362397


Modified:
   trunk/ChangeLog
   trunk/lib/dia_dirs.c

Modified: trunk/lib/dia_dirs.c
==============================================================================
--- trunk/lib/dia_dirs.c	(original)
+++ trunk/lib/dia_dirs.c	Sun Feb  1 21:04:23 2009
@@ -156,9 +156,14 @@
 dia_get_canonical_path(const gchar *path)
 {
   gchar  *ret = NULL;
-  gchar **list = g_strsplit (path, G_DIR_SEPARATOR_S, -1);
+  gchar **list;
   int i = 0, n = 0;
 
+  /* shortcut for nothing to do (also keeps UNC path intact */
+  if (!strstr(path, "..") && !strstr(path, "." G_DIR_SEPARATOR_S))
+    return g_strdup(path);
+
+  list = g_strsplit (path, G_DIR_SEPARATOR_S, -1);
   while (list[i] != NULL) {
     if (0 == strcmp (list[i], ".")) {
       /* simple, just remove it */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]