[gnome-builder/gnome-builder-41] foundry: fix default install paths
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-41] foundry: fix default install paths
- Date: Mon, 17 Jan 2022 01:24:52 +0000 (UTC)
commit c3a4289829ed3df1d9c1627bc459bd8614125803
Author: Christian Hergert <chergert redhat com>
Date: Sun Jan 16 12:20:27 2022 -0800
foundry: fix default install paths
Avoid things like : in install paths so that we don't risk breaking various
PATH, GSETTINGS_SCHEMA_DIRS, and other path-like queries.
src/libide/foundry/ide-runtime.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/foundry/ide-runtime.c b/src/libide/foundry/ide-runtime.c
index 894762c4d..7363a1910 100644
--- a/src/libide/foundry/ide-runtime.c
+++ b/src/libide/foundry/ide-runtime.c
@@ -154,16 +154,24 @@ ide_runtime_real_prepare_configuration (IdeRuntime *self,
{
g_autofree gchar *install_path = NULL;
g_autofree gchar *project_id = NULL;
+ g_autofree gchar *id = NULL;
IdeContext *context;
context = ide_object_get_context (IDE_OBJECT (self));
project_id = ide_context_dup_project_id (context);
+ id = g_strdup (priv->id);
+
+ /* Make sure we don't have things that can muck up PATH type
+ * environment variables like ":".
+ */
+ g_strdelimit (project_id, "@:/", '-');
+ g_strdelimit (id, "@:/", '-');
install_path = g_build_filename (g_get_user_cache_dir (),
"gnome-builder",
"install",
project_id,
- priv->id,
+ id,
NULL);
ide_config_set_prefix (config, install_path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]