[nautilus] directory: check for a non-empty hostname too



commit 098cd14197364d6d6b9665f9d65b78214a001d3c
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Sep 4 10:46:28 2012 -0400

    directory: check for a non-empty hostname too
    
    In addition to checking for hostname != NULL, also check that it's not
    empty before using it for the file name.

 libnautilus-private/nautilus-directory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libnautilus-private/nautilus-directory.c b/libnautilus-private/nautilus-directory.c
index 5ac71c7..e2724e8 100644
--- a/libnautilus-private/nautilus-directory.c
+++ b/libnautilus-private/nautilus-directory.c
@@ -466,7 +466,7 @@ nautilus_directory_get_name_for_self_as_new_file (NautilusDirectory *directory)
 	g_object_unref (file);
 
 	nautilus_uri_parse (directory_uri, &hostname, NULL, NULL);
-	if (hostname == NULL) {
+	if (hostname == NULL || (strlen (hostname) == 0)) {
 		name = g_strdup (directory_uri);
 	} else if (scheme == NULL) {
 		name = g_strdup (hostname);



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