After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 669689 - Retrieve cwd and environ in local GApplicationCommandLine
Retrieve cwd and environ in local GApplicationCommandLine
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-02-08 16:14 UTC by jessevdk@gmail.com
Modified: 2012-02-08 16:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Retrieve cwd and environ in local GApplicationCommandLine (3.55 KB, patch)
2012-02-08 16:14 UTC, jessevdk@gmail.com
accepted-commit_now Details | Review
Retrieve cwd and environ in local GApplicationCommandLine (3.55 KB, patch)
2012-02-08 16:44 UTC, jessevdk@gmail.com
committed Details | Review

Description jessevdk@gmail.com 2012-02-08 16:14:12 UTC
Currently, GApplicationCommandLine does not contain the cwd and environ
in the local case. The attached patch fixes this.
Comment 1 jessevdk@gmail.com 2012-02-08 16:14:51 UTC
Created attachment 207121 [details] [review]
Retrieve cwd and environ in local GApplicationCommandLine
Comment 2 Allison Karlitskaya (desrt) 2012-02-08 16:31:42 UTC
Review of attachment 207121 [details] [review]:

looks good with one very minor tweak

::: gio/gapplicationcommandline.c
@@ +253,3 @@
+
+  g_free (cmdline->priv->cwd);
+  g_strfreev (cmdline->priv->environ);

hum.  looks like the environment was leaking before :)

@@ +409,3 @@
 g_application_command_line_get_environ (GApplicationCommandLine *cmdline)
 {
+  return (const gchar * const *)cmdline->priv->environ;

(const gchar **) is sufficient here
Comment 3 jessevdk@gmail.com 2012-02-08 16:44:49 UTC
Created attachment 207125 [details] [review]
Retrieve cwd and environ in local GApplicationCommandLine
Comment 4 jessevdk@gmail.com 2012-02-08 16:45:39 UTC
New patch for completeness. Actually before there was no leak because environ was the internal byte array of the gvariant.
Comment 5 jessevdk@gmail.com 2012-02-08 16:46:23 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.