summaryrefslogtreecommitdiff
path: root/gutils.c
diff options
context:
space:
mode:
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>2000-09-28 07:35:02 +0000
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>2000-09-28 07:35:02 +0000
commit6088718e19cce2b1ebb3f52965cbc1e8ed3a0eef (patch)
tree1ab0a1c2041327733f2e34cf68148de8e4691ea3 /gutils.c
parentccee9157202b9556708ca997262995963abdc10e (diff)
downloadglib-6088718e19cce2b1ebb3f52965cbc1e8ed3a0eef.tar.gz
max_len can't be initialized statically as it might call a function. So do
2000-09-28 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gutils.c (g_get_current_dir): max_len can't be initialized statically as it might call a function. So do it at first call.
Diffstat (limited to 'gutils.c')
-rw-r--r--gutils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gutils.c b/gutils.c
index 1f3c3a347..c7284ca29 100644
--- a/gutils.c
+++ b/gutils.c
@@ -425,7 +425,10 @@ g_get_current_dir (void)
{
gchar *buffer = NULL;
gchar *dir = NULL;
- static gulong max_len = (G_PATH_LENGTH == -1) ? 2048 : G_PATH_LENGTH;
+ static gulong max_len = 0;
+
+ if (max_len == 0)
+ max_len = (G_PATH_LENGTH == -1) ? 2048 : G_PATH_LENGTH;
/* We don't use getcwd(3) on SUNOS, because, it does a popen("pwd")
* and, if that wasn't bad enough, hangs in doing so.