Hi Ales and all,
On Wednesday 16 February 2005 04:35, Ales Hvezda wrote:
> >On Sunday 13 February 2005 19:38, Bill Wilson wrote:
> >> g_setenv is new since glib 2.4, so you could get this if your
> >> setup is finding a 2.2 glib instead of 2.4.
> >
> >I have glib version 2.2.3 installed.
> >Mmhh, I am not planing to update my old computer.
>
> Is this still an open issue? It would be shame to break
> compatibility with 2.2.x over something as silly as "g_setenv".
I've used this patch to replace g_setenv.
Please take a look at it, I'm a little out of practice.
regards
Werner
? cvs_diff.txt
Index: g_rc.nw
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/libgeda/noweb/g_rc.nw,v
retrieving revision 1.9
diff -r1.9 g_rc.nw
370c370,371
<
---
> char gedadatarc[]="GEDADATARC=\0";
> char *buffer=NULL;
375,376c376,380
< g_setenv ("GEDADATARC", rc_path, TRUE);
< free (rc_path);
---
> buffer = (char *) malloc(strlen(gedadatarc)+strlen(rc_path)+1);
>
> putenv(strcat(strcpy(buffer,gedadatarc),rc_path));
> /* g_setenv ("GEDADATARC", rc_path, TRUE);*/ /*requires glib 2.4.x*/
> /* free (rc_path); putenv needs the memory? --> man 3 putenv */
Index: libgeda.nw
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/libgeda/noweb/libgeda.nw,v
retrieving revision 1.9
diff -r1.9 libgeda.nw
82a83,91
> char *new_data=NULL;
> char *geda_data = getenv("GEDADATA");
>
> if (geda_data == NULL) {
> new_data = (char *) malloc (strlen("GEDADATA=\0")+strlen(GEDADATADIR)+1);
> new_data = strcat(strcpy(new_data,"GEDADATA=\0"), GEDADATADIR);
> putenv(new_data);
> /*free(new_data); putenv takes over the memory? --> man 3 putenv */
> }
84c93
< g_setenv ("GEDADATA", GEDADATADIR, FALSE);
---
> /* g_setenv ("GEDADATA", GEDADATADIR, FALSE); */ /*requires glib 2.4.x*/