[ghex] Don't try to convert the file name to absolute path



commit bf3049ef682571a5e52e902bf5817c49a3e29954
Author: Kalev Lember <kalevlember gmail com>
Date:   Sat Feb 18 19:36:35 2012 +0200

    Don't try to convert the file name to absolute path
    
    I assume using full paths was originally needed because gtk filechooser
    didn't handle relative paths well. However, this isn't the case any more
    and with removing the code, we can get rid of one more place with
    hardcoded / directory separator.

 src/ghex-window.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/src/ghex-window.c b/src/ghex-window.c
index 073d490..f12f21a 100644
--- a/src/ghex-window.c
+++ b/src/ghex-window.c
@@ -807,7 +807,6 @@ cursor_moved_cb(GtkHex *gtkhex, gpointer user_data)
 gboolean
 ghex_window_load(GHexWindow *win, const gchar *filename)
 {
-    gchar *full_path;
     HexDocument *doc;
     GtkWidget *gh;
     GtkWidget *vbox;
@@ -818,18 +817,7 @@ ghex_window_load(GHexWindow *win, const gchar *filename)
     g_return_val_if_fail(GHEX_IS_WINDOW(win), FALSE);
     g_return_val_if_fail(filename != NULL, FALSE);
 
-    if(*filename != '/') {
-        gchar *cwd;
-        
-        cwd = g_get_current_dir();
-        full_path = g_strconcat(cwd, "/", filename, NULL);
-        g_free(cwd);
-    }
-    else
-        full_path = g_strdup(filename);
-    
-    doc = hex_document_new_from_file(full_path);
-    g_free(full_path);
+    doc = hex_document_new_from_file (filename);
     if(!doc)
         return FALSE;
     hex_document_set_max_undo(doc, max_undo_depth);



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