* src/gpath.c (g_path_get_dirname): If the pathname starts with
* a
"/", return the "/".
svn path=/trunk/mono/; revision=67334
2006-11-03 Miguel de Icaza <miguel@novell.com>
+ * src/gpath.c (g_path_get_dirname): If the pathname starts with a
+ "/", return the "/".
+
* test/string-util.c (test_strlcpy): Add new test.
* src/gunicode.c (g_filename_from_utf8): g_strlcpy needs the full
p = strrchr (filename, G_DIR_SEPARATOR);
if (p == NULL)
return g_strdup (".");
+ if (p == filename)
+ return g_strdup ("/");
count = p - filename;
r = g_malloc (count + 1);
strncpy (r, filename, count);
s = g_path_get_dirname ("dir.c");
if (strcmp (s, ".") != 0)
return FAILED ("Expected `.', got %s", s);
+ g_free (s);
+
+ s = g_path_get_dirname ("/index.html");
+ if (strcmp (s, "/") != 0)
+ return FAILED ("Expected [/], got [%s]", s);
+
return OK;
}