[glib: 1/3] gdummyfile: Return NULL from get_basename() if no path is stored




commit 628e1c5893717a3489934052e52212847aef3d4b
Author: Philip Withnall <pwithnall endlessos org>
Date:   Wed Mar 10 19:10:04 2021 +0000

    gdummyfile: Return NULL from get_basename() if no path is stored
    
    Rather than returning a URI, which definitely won’t be a valid basename.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #2328

 gio/gdummyfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/gdummyfile.c b/gio/gdummyfile.c
index 58442ccbc..3bf5ba920 100644
--- a/gio/gdummyfile.c
+++ b/gio/gdummyfile.c
@@ -126,7 +126,7 @@ g_dummy_file_get_basename (GFile *file)
   
   if (dummy->decoded_uri)
     return g_path_get_basename (dummy->decoded_uri->path);
-  return g_strdup (dummy->text_uri);
+  return NULL;
 }
 
 static char *


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