[gnome-builder] editor: use g_path_get_dirname() instead of dirname().
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] editor: use g_path_get_dirname() instead of dirname().
- Date: Sat, 27 Dec 2014 06:04:07 +0000 (UTC)
commit 17044ff5e1fa951d490f272701aab98ca27192ca
Author: Christian Hergert <christian hergert me>
Date: Fri Dec 26 22:03:25 2014 -0800
editor: use g_path_get_dirname() instead of dirname().
Dirname has side-effects which are non-obvious, so I'd rather just
use g_path_get_dirname(). Thankfully, both of these functions actually
seem to work okay on URIs like ssh:///foo/bar.
src/editor/gb-editor-workspace.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/editor/gb-editor-workspace.c b/src/editor/gb-editor-workspace.c
index d61492b..8cb48b6 100644
--- a/src/editor/gb-editor-workspace.c
+++ b/src/editor/gb-editor-workspace.c
@@ -185,7 +185,7 @@ gb_editor_workspace_action_open (GSimpleAction *action,
gchar *uri;
file_uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog));
- uri = g_strdup (dirname (file_uri));
+ uri = g_path_get_dirname (file_uri);
if (g_strcmp0 (priv->current_folder_uri, uri) != 0)
{
g_free (priv->current_folder_uri);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]